Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustracer: fails on nixos-unstable #89481

Closed
erictapen opened this issue Jun 4, 2020 · 11 comments
Closed

rustracer: fails on nixos-unstable #89481

erictapen opened this issue Jun 4, 2020 · 11 comments
Assignees
Labels
0.kind: bug Something is broken 6.topic: rust

Comments

@erictapen
Copy link
Member

Describe the bug

rustracer fails to build on nixos-unstable (467ce5a atm).

$ nix-build -A rustracer
...
   Compiling rustc-ap-rustc_data_structures v651.0.0
error[E0599]: no method named `get` found for type `u64` in the current scope
   --> /build/racer-2.1.32-vendor.tar.gz/rustc-ap-rustc_data_structures/profiling.rs:348:66
    |
348 |             let thread_id = std::thread::current().id().as_u64().get() as u32;
    |                                                                  ^^^ method not found in `u64`

error[E0599]: no method named `get` found for type `u64` in the current scope
   --> /build/racer-2.1.32-vendor.tar.gz/rustc-ap-rustc_data_structures/profiling.rs:525:62
    |
525 |         let thread_id = std::thread::current().id().as_u64().get() as u32;
    |                                                              ^^^ method not found in `u64`

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0599`.
error: could not compile `rustc-ap-rustc_data_structures`.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
builder for '/nix/store/8lg8ms4k7jjyh807yyfyyv4vvr9yas1p-racer-2.1.32.drv' failed with exit code 101
error: build of '/nix/store/8lg8ms4k7jjyh807yyfyyv4vvr9yas1p-racer-2.1.32.drv' failed

Additional context

This seems to be racer-rust/racer#1093, however I don't understand why it used to work in the first place. Upstream suggests to use rustc from nightly >= 2020-02-10, we use 1.43.0. This used to not be a problem, as we are using RUSTC_BOOTSTRAP=1, a mechanism I don't understand.

Notify maintainers

@jagajaga @Ma27

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute: rustracer
# a list of nixos modules affected by the problem
module:
@erictapen erictapen added the 0.kind: bug Something is broken label Jun 4, 2020
@Ma27
Copy link
Member

Ma27 commented Jun 4, 2020

The problem is that some dependencies seem to require certain nightly versions we don't have in our package set. I'll hopefully have time to investigate soon.

@luc65r
Copy link
Contributor

luc65r commented Jun 5, 2020

rustracer and rustracerd don't build on master either.

I ping some more people, they fixed rustracerd when it didn't build.
@alyssais @bhipple @jonringer @LnL7

@Ma27
Copy link
Member

Ma27 commented Jun 5, 2020

@luc65r AFAICS the only issue is master (and the corresponding nixos-unstable-channel), right?

On release-20.03 (fdfd5ab) rustracer is building perfectly fine for me:

→ nix-build -A rustracer
/nix/store/zrwsqmn95x15d5jvz091mxa2kyx9msdc-racer-2.1.30

@Ma27 Ma27 self-assigned this Jun 9, 2020
@Ma27
Copy link
Member

Ma27 commented Jun 11, 2020

With rustc-1.44 (#89576) we can upgrade to 2.1.33 (just built and tested this combination locally):

diff --git a/pkgs/development/tools/rust/racer/default.nix b/pkgs/development/tools/rust/racer/default.nix
index 0a29577e0cd..f74e757184e 100644
--- a/pkgs/development/tools/rust/racer/default.nix
+++ b/pkgs/development/tools/rust/racer/default.nix
@@ -2,22 +2,22 @@
 
 rustPlatform.buildRustPackage rec {
   pname = "racer";
-  version = "2.1.30";
+  version = "2.1.33";
 
   src = fetchFromGitHub {
     owner = "racer-rust";
     repo = "racer";
-    rev = "c2b0080243fefdad7f7b223e8a7fdef3e1f0fa77";
-    sha256 = "0svvdkfqpk2rw0wxyrhkxy553k55lg7jxc0ly4w1195iwv14ad3y";
+    rev = "v${version}";
+    sha256 = "0fxcif42k8x70zwpi76h2jxyr048mjzakh52yzqavyr8irl55ll2";
   };
 
-  cargoSha256 = "0zaqa89z3nf23s2q1jpmfz4lygh4zq9ymql71d748fgjy9psr449";
+  cargoSha256 = "115ydgv4wd4bf3xhm96zlc9z1lhmrcnm1v5pgzl9846l27ka1z13";
 
-  buildInputs = [ makeWrapper ]
-                ++ stdenv.lib.optional stdenv.isDarwin Security;
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = stdenv.lib.optional stdenv.isDarwin Security;
 
   # a nightly compiler is required unless we use this cheat code.
-  RUSTC_BOOTSTRAP=1;
+  RUSTC_BOOTSTRAP = 1;
 
   RUST_SRC_PATH = rustPlatform.rustcSrc;
   postInstall = ''

Upgrading to 2.1.34 doesn't work for us, see also racer-rust/racer#1113.

I'm wondering though if we want to put rustracer into an external overlay using nixpkgs-mozilla in the mid-term since maintaining this with nightly rust is way easier AFAICS.

@NorfairKing
Copy link
Contributor

@Ma27 I'm not well-versed enough in how to deal with this. I'm trying to build YouCompleteMe and am not sure what to do with your comment.
Will this fix find its way into nixpkgs?

@Ma27
Copy link
Member

Ma27 commented Jun 21, 2020

Yes, as soon as the rustc update is out.

Until then, what's wrong with using the package from the stable channel?

@NorfairKing
Copy link
Contributor

@Ma27 Thanks for the quick response! Nothing, I'm just using nixpkgs-unstable on some of my machines. I guess that's the real problem with my workflow.

@Ma27
Copy link
Member

Ma27 commented Jun 21, 2020

To make sure you don't get me wrong: you don't have to change your default channel, you can do something like this: (import (builtins.fetchTarball https://github.com/NixOS/nixpkgs/archive/nixos-20.03-small.tar.gz) {}).rustracer as temporary solution.

@NorfairKing
Copy link
Contributor

Thanks! That helps, but I think I'll see if I can change my default channel instead.

@Ma27
Copy link
Member

Ma27 commented Jun 21, 2020

It should be possible to add another channel for stbale (e.g. nixpkgs-stable) and then do import <nixpkgs-stable>. But I may be wrong, I don't use nix-channel on my systems.

evanjs added a commit to evanjs/nixos_cfg that referenced this issue Jun 27, 2020
@evanjs
Copy link
Member

evanjs commented Jun 27, 2020

@NorfairKing I have all the channels I need specified in my config in case I need to do something like this.

evanjs added a commit to evanjs/nixos_cfg that referenced this issue Jul 1, 2020
@Ma27 Ma27 closed this as completed in 514afd2 Jul 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken 6.topic: rust
Projects
None yet
Development

No branches or pull requests

6 participants