nix-community / crate2nix

rebuild only changed crates in CI with crate2nix and nix
https://nix-community.github.io/crate2nix/
Apache License 2.0
335 stars 82 forks source link

rustc 1.73 breaks crate2nix cross compilation #313

Closed ghost closed 5 months ago

ghost commented 8 months ago

Heads up, crate2nix cross compilation breaks in a really bizzarre way with rustc 1.73 (merged to nixpkgs staging but not yet on master).

Here's the sort of error I get (git revert on just the bump commit 4dd6faeac97ed065cacb470dfb06938657476470 produces a successful build):

unpacking sources
unpacking source archive /nix/store/jh7v7dxcggd9bwgc26bgsni5pcpx3lyf-base64-0.9.3.tar.gz
source root is base64-0.9.3
setting SOURCE_DATE_EPOCH to timestamp 1536935516 of file base64-0.9.3/Cargo.toml.orig
patching sources
updateAutotoolsGnuConfigScriptsPhase
updateAutotoolsGnuConfigScriptsPhase
configuring
Running cd .
building
Building src/lib.rs (base64)
Running rustc --crate-name base64 src/lib.rs --out-dir target/lib -L dependency=target/deps --cap-lints allow -C opt-level=3 -C codegen-units=1 --remap-path-prefix=/build=/ --extern byteorder=/nix/store/1snfqlgq7724vmwdd5pqr9bybm5hg9dx-rust_byteorder-1.5.0-aarch64-unknown-linux-gnu-lib/lib/libbyteorder-4edd459ab3.rlib --extern safemem=/nix/store/
error[E0460]: found possibly newer version of crate `std` which `safemem` depends on
 --> src/line_wrap.rs:1:1
  |
1 | extern crate safemem;
  | ^^^^^^^^^^^^^^^^^^^^^
  |
  = note: perhaps that crate needs to be recompiled?
  = note: the following crate versions were found:
          crate `std`: /nix/store/ydcb6kcnwd21x20094np93lsmv0mx0j2-aarch64-unknown-linux-gnu-rustc-1.73.0/lib/rustlib/aarch64-unknown-linux-gnu/lib/libstd-96a218355ebbc422.rlib
          crate `std`: /nix/store/ydcb6kcnwd21x20094np93lsmv0mx0j2-aarch64-unknown-linux-gnu-rustc-1.73.0/lib/rustlib/aarch64-unknown-linux-gnu/lib/libstd-96a218355ebbc422.so
          crate `safemem`: /nix/store/qia0skxhqnvsd1j6mvrfvgdc1zd6x950-rust_safemem-0.3.3-aarch64-unknown-linux-gnu-lib/lib/libsafemem-ef842881df.rlib

error: aborting due to previous error

For more information about this error, try `rustc --explain E0460`.

I am investigating. Most likely lead is this part of the output:

-          crate `std`: /nix/store/ydcb6k.../lib/libstd-96a218355ebbc422.rlib
+          crate `std`: /nix/store/ydcb6k.../lib/libstd-96a218355ebbc422.so
ghost commented 8 months ago

This doesn't affect all crates.

In fact, I'm having a hard time identifying the common feature of the crates it does affect.

So instead I'm trying a git bisect of rust to see which change over there caused trouble.

ghost commented 7 months ago
flokli commented 7 months ago

I think this got fixed with https://github.com/nix-community/crate2nix/pull/309, no? Can this issue be closed?

flokli commented 5 months ago

@kolloch can this be closed?

kolloch commented 5 months ago

@flokli I wish I new. @amjoseph-nixpkgs can it be closed?