Skip to content

rust: hooks: fix cross compilation#247442

Merged
alyssais merged 5 commits intostagingfrom
unknown repository
Sep 26, 2023
Merged

rust: hooks: fix cross compilation#247442
alyssais merged 5 commits intostagingfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@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 figsoda, winterqt and zowoq 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
@github-actions github-actions bot added the 6.topic: rust General-purpose programming language emphasizing performance, type safety, and concurrency. 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
Copy Markdown
Author

ghost commented Aug 6, 2023

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

@ofborg ofborg bot requested review from Kranzes, marsam and sphaugh August 7, 2023 00:02
@ofborg ofborg bot added 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. labels Aug 7, 2023
@ghost
Copy link
Copy Markdown
Author

ghost commented Aug 7, 2023

🎉 🎉 🎉

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

🎉 🎉 🎉

Copy link
Copy Markdown
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 person. label Sep 10, 2023
@nyabinary
Copy link
Copy Markdown
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
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 General-purpose programming language emphasizing performance, type safety, and concurrency. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pkgsCross.*.python3Packages.adblock does not build

3 participants