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

rav1e: fix cross #225360

Merged
merged 1 commit into from Apr 15, 2023
Merged

rav1e: fix cross #225360

merged 1 commit into from Apr 15, 2023

Conversation

ghost
Copy link

@ghost ghost commented Apr 9, 2023

cargo cbuild needs to have the C{C,XX}_FOR_{${platform}} variables set just like cargo since it is basically a wrapper around cargo. Without these variables, it will try to use the hostPlatform C compiler to compile build.rs scripts, and will pass flags to that compiler which only make sense on the buildPlatform. So it's just doomed without the environment variables.

Right now it looks like rav1e is the only package we have that is using cargo-c, but if that changes in the future we should factor this out as its own hook, like maturinBuildHook and the others.

Closes #225356

Sorry about spamming everybody by calling git hub pull new without --base staging.

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

@ghost ghost changed the title ###### Description of changes rav1e: fix cross Apr 9, 2023
@ghost
Copy link
Author

ghost commented Apr 9, 2023

@ofborg build pkgsCross.aarch64-multiplatform.rav1e

@ghost
Copy link
Author

ghost commented Apr 13, 2023

@ofborg eval

@ofborg ofborg bot added the 6.topic: cross-compilation Building packages on a different sort platform than than they will be run on label Apr 13, 2023
@Artturin
Copy link
Member

Fp to get green status

@uninsane uninsane mentioned this pull request Apr 14, 2023
`cargo cbuild` needs to have the `C{C,XX}_FOR_{${platform}}`
variables set just like `cargo` since it is basically a wrapper
around cargo.  Without these variables, it will try to use the
`hostPlatform` C compiler to compile `build.rs` scripts, and will
pass flags to that compiler which only make sense on the
`buildPlatform`.  So it's just doomed without the environment
variables.

Right now it looks like `rav1e` is the only package we have that is
using `cargo-c`, but if that changes in the future we should factor
this out as its own hook, like `maturinBuildHook` and the others.
@Artturin Artturin marked this pull request as draft April 14, 2023 04:41
@Artturin Artturin changed the base branch from staging to master April 14, 2023 04:41
@Artturin Artturin marked this pull request as ready for review April 14, 2023 04:41
Copy link
Member

@Artturin Artturin left a comment

Choose a reason for hiding this comment

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

fine to go to master

@Artturin Artturin merged commit 1bb2362 into NixOS:master Apr 15, 2023
@ghost ghost deleted the pr/fixcross/rav1e-and-dont-spam-everybody branch April 15, 2023 21:10
@ghost
Copy link
Author

ghost commented Jun 1, 2023

Note to self, this PR contains the trick for fixing

warning: aarch64-unknown-linux-gnu-gcc: error: unrecognized command-line option ‘-m64’

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 sort platform than than they will be run on 10.rebuild-darwin: 101-500 10.rebuild-linux: 101-500
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pkgsCross.*.rav1e is broken
1 participant