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

rust: hooks: fix cross compilation #247442

Merged
merged 5 commits into from Sep 26, 2023
Merged

rust: hooks: fix cross compilation #247442

merged 5 commits into from Sep 26, 2023

Conversation

ghost
Copy link

@ghost ghost commented Aug 6, 2023

Description of changes

Currently there is some confusion in pkgs/build-support/rust/hooks/ regarding host vs target; right now there is only "host" defined, but whether it means "host" or "target" seems to fluctuate.

This commit corrects that, ensuring that all variables come in all three flavors (build, host, target) and are used consistently with the nixpkgs convention.

This also fixes the cross-compilation of packages which use maturinBuildHook -- hooks go in nativeBuildInputs and are phase-shifted backwards by one platform, so to them the hostPlatform looks like it is the targetPlatform.

Closes #247441
Closes #251539

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux (cross from x86_64-linux)
    • powerpc64le-linux

@ghost ghost requested review from zowoq, winterqt and figsoda as code owners August 6, 2023 03:28
@ofborg ofborg bot added the 6.topic: cross-compilation Building packages on a different platform than they will be used on label Aug 6, 2023
@ghost ghost requested a review from Artturin August 6, 2023 03:28
@ghost ghost linked an issue Aug 6, 2023 that may be closed by this pull request
@winterqt winterqt requested a review from alyssais August 6, 2023 03:39
@ghost ghost marked this pull request as draft August 6, 2023 05:59
@ghost ghost marked this pull request as ready for review August 6, 2023 23:28
@ghost ghost requested a review from Mic92 as a code owner August 6, 2023 23:28
@ghost
Copy link
Author

ghost commented Aug 6, 2023

@ofborg build pkgsCross.aarch64-multiplatform.python3Packages.adblock

@ghost
Copy link
Author

ghost commented Aug 7, 2023

🎉 🎉 🎉

pkgsCross.aarch64-multiplatform.python3Packages.adblock on x86_64-linux — Success

🎉 🎉 🎉

Copy link
Member

@alyssais alyssais left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I'd noticed this myself before, but tried and failed to fix it.

@alyssais alyssais added the 2.status: merge conflict This PR has merge conflicts with the target branch label Sep 10, 2023
@delroth delroth added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Sep 10, 2023
@nyabinary
Copy link
Contributor

Looks good to me as well

@ghost ghost removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Sep 25, 2023
Adam Joseph added 3 commits September 25, 2023 04:47
Currently there is a state of severe confusion in
pkgs/build-support/rust/hooks/ regarding host vs target; right now
there is only "host" defined, but whether it means "host" or
"target" seems to fluctuate.

This commit corrects that, ensuring that all variables come in all
three flavors (build, host, target) and are used consistently with
the nixpkgs convention.

This also fixes the cross-compilation of packages which use
`maturinBuildHook` -- hooks go in `nativeBuildInputs` and are
phase-shifted backwards by one platform, so they need to be careful
about distinguishing between build and host.

Closes #247441
@alyssais alyssais merged commit 33c0b7f into NixOS:staging Sep 26, 2023
10 checks passed
@ghost ghost deleted the pr/rust/cross/fixhooks branch October 22, 2023 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: cross-compilation Building packages on a different platform than they will be used on 6.topic: rust 10.rebuild-darwin: 501+ 10.rebuild-darwin: 5001+ 10.rebuild-linux: 501+ 10.rebuild-linux: 5001+ 12.approvals: 1 This PR was reviewed and approved by one reputable person
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pkgsCross.*.python3Packages.adblock does not build
3 participants