-
-
Notifications
You must be signed in to change notification settings - Fork 19.7k
Setuptools rust hook for cross compilation #212795
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,18 @@ | ||||||||||
| echo "Sourcing setuptools-rust-hook" | ||||||||||
|
|
||||||||||
| setuptoolsRustSetup() { | ||||||||||
| # This can work only if rustPlatform.cargoSetupHook is also included | ||||||||||
| if ! command -v cargoSetupPostPatchHook >/dev/null; then | ||||||||||
|
Cynerd marked this conversation as resolved.
Outdated
|
||||||||||
| echo "ERROR: setuptools-rust has to be used alongside with rustPlatform.cargoSetupHook!" | ||||||||||
| exit 1 | ||||||||||
| fi | ||||||||||
|
|
||||||||||
| export PYO3_CROSS_LIB_DIR="@pyLibDir@" | ||||||||||
| export CARGO_BUILD_TARGET=@cargoBuildTarget@ | ||||||||||
| # TODO theoretically setting linker should not be required because it is | ||||||||||
| # already set in pkgs/build-support/rust/hooks/default.nix but build fails | ||||||||||
| # on missing linker without this. | ||||||||||
| export CARGO_TARGET_@cargoLinkerVar@_LINKER=@targetLinker@ | ||||||||||
|
Comment on lines
12
to
15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
If you need this, it means splicing isn't working right. That's usually caused by referencing things via
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand how not to use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Let me be more explicit:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It appears that you have applied this suggestion. |
||||||||||
| } | ||||||||||
|
|
||||||||||
| preConfigureHooks+=(setuptoolsRustSetup) | ||||||||||
Uh oh!
There was an error while loading. Please reload this page.