Skip to content

rust/cargo.nix: fix pkgsCross.*.cargo again#227683

Merged
figsoda merged 3 commits intomasterfrom
unknown repository
Apr 22, 2023
Merged

rust/cargo.nix: fix pkgsCross.*.cargo again#227683
figsoda merged 3 commits intomasterfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Apr 22, 2023

Description of changes

Cross-compilation of cargo has regressed due to two issues:

  • Since rustPlatform.buildRustPackage: make auditable the default #223320 builds fail because cargo-auditable does not cross compile. This PR fixes the regression by keeping the previous audit=false default on cross builds until someone fixes cargo-auditable.

  • Recently our cargo.nix forgot how to locate the buildPlatform's libz.so. In order to remind it, this PR sets HOST_PKG_CONFIG_PATH for cross-compiled builds.

After this PR, pkgsCross.aarch64-multiplatform.cargo should build again.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux (cross from x86_64-linux)
  • Fits CONTRIBUTING.md.

Not much point in auditing things that can't be built.

Adam Joseph added 2 commits April 22, 2023 12:56
@github-actions github-actions bot added the 6.topic: rust General-purpose programming language emphasizing performance, type safety, and concurrency. label Apr 22, 2023
@ghost
Copy link
Copy Markdown
Author

ghost commented Apr 22, 2023

@ofborg build pkgsCross.aarch64-multiplatform.cargo

@ghost ghost marked this pull request as ready for review April 22, 2023 20:57
@ghost ghost requested review from Mic92, figsoda, winterqt and zowoq as code owners April 22, 2023 20:57
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Apr 22, 2023
Prior to this commit, builds of
`pkgsCross.aarch64-multiplatform.cargo` would fail due to being
unable to find `-lz` when compiling cargo's own `build.rs` for the
`buildPlatform`.

This environment variable uses the (very confusing) LLVM convention
of calling the buildPlatform "HOST".

Co-authored-by: figsoda <figsoda@pm.me>
@ghost
Copy link
Copy Markdown
Author

ghost commented Apr 22, 2023

Squashed.

@ghost ghost requested a review from figsoda April 22, 2023 21:50
@figsoda figsoda merged commit 4b5d340 into NixOS:master Apr 22, 2023
@Shnatsel
Copy link
Copy Markdown

Hello! Author of cargo auditable here 👋

Cross-compilation is implemented; if it doesn't work, that's a serious bug. Could you post a command reproducing the issue with cargo auditable alone, without the nix scaffolding?

Ideally I'd also like to track it as a github issue, but I can file that myself.

@figsoda
Copy link
Copy Markdown
Member

figsoda commented Apr 23, 2023

This could just be an issue with the packaging, I will take a look

@ghost ghost deleted the pr/cargo/unbreak-cross branch April 24, 2023 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: rust General-purpose programming language emphasizing performance, type safety, and concurrency. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants