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

cargo: fix cross-compilation by adding missing zlib dependency #210248

Merged
merged 1 commit into from
Jan 11, 2023

Conversation

Mindavi
Copy link
Contributor

@Mindavi Mindavi commented Jan 11, 2023

Previously it was failing with:

Compiling cargo v0.67.1 (/build/rustc-1.66.1-src/src/tools/cargo)
error: linking with /nix/store/gcc-wrapper-11.3.0/bin/cc failed: exit status: 1
|
= note: /nix/store/binutils-2.39/bin/ld: skipping incompatible /nix/store/zlib-aarch64-unknown-linux-gnu-1.2.13/lib/libz.so when searching for -lz
/nix/store/binutils-2.39/bin/ld: cannot find -lz: No such file or directory
/nix/store/binutils-2.39/bin/ld: skipping incompatible /nix/store/zlib-aarch64-unknown-linux-gnu-1.2.13/lib/libz.so when searching for -lz
collect2: error: ld returned 1 exit status

Description of changes

Add zlib dependency as nativeBuildInput for cargo, since it appears it's needed.

No idea if this should still go in the cycle (#209180), let's discuss.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux (cross-compiled from aarch64-multiplatform)
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.05 Release Notes (or backporting 22.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

Previously it was failing with:

   Compiling cargo v0.67.1 (/build/rustc-1.66.1-src/src/tools/cargo)
error: linking with `/nix/store/gcc-wrapper-11.3.0/bin/cc` failed: exit status: 1
  |
  = note: /nix/store/binutils-2.39/bin/ld: skipping incompatible /nix/store/zlib-aarch64-unknown-linux-gnu-1.2.13/lib/libz.so when searching for -lz
          /nix/store/binutils-2.39/bin/ld: cannot find -lz: No such file or directory
          /nix/store/binutils-2.39/bin/ld: skipping incompatible /nix/store/zlib-aarch64-unknown-linux-gnu-1.2.13/lib/libz.so when searching for -lz
          collect2: error: ld returned 1 exit status
@ofborg ofborg bot added the 6.topic: cross-compilation Building packages on a different platform than they will be used on label Jan 11, 2023
@vcunat
Copy link
Member

vcunat commented Jan 11, 2023

I'll see if I can find which PR this is related to....

#210139 I expect.

@vcunat vcunat merged commit 39d522f into NixOS:staging-next Jan 11, 2023
@vcunat
Copy link
Member

vcunat commented Jan 11, 2023

OK, let me merge this rebuild optimistically (early), so that it can be fixed in this staging-next iteration without too many rebuilds.

@Mindavi
Copy link
Contributor Author

Mindavi commented Jan 12, 2023

This improved the situation somewhat, but didn't totally resolve it. Probably need #196333 for a full fix, but it's a bit in a limbo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants