-
-
Notifications
You must be signed in to change notification settings - Fork 15.1k
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
python-cryptography: fix cross #226120
python-cryptography: fix cross #226120
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 |
---|---|---|
|
@@ -21,6 +21,11 @@ | |
, py | ||
, pytz | ||
, hypothesis | ||
, buildPackages | ||
, rust | ||
, cargo | ||
, rustc | ||
, python3 | ||
}: | ||
|
||
let | ||
|
@@ -46,15 +51,26 @@ buildPythonPackage rec { | |
|
||
cargoRoot = "src/rust"; | ||
|
||
env = { | ||
PYO3_CROSS_LIB_DIR = "${python3}/lib/"; | ||
CARGO_BUILD_TARGET = "${rust.toRustTargetSpec stdenv.hostPlatform}"; | ||
}; | ||
|
||
nativeBuildInputs = lib.optionals (!isPyPy) [ | ||
cffi | ||
] ++ [ | ||
rustPlatform.cargoSetupHook | ||
setuptools-rust | ||
] ++ (with rustPlatform; [ rust.cargo rust.rustc ]); | ||
cargo | ||
rustc | ||
Comment on lines
+62
to
+63
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 think we used rustPlaform to make sure all the rust things fit together. Can you describe the problem why you have split this? 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.
We should stop using @Artturin can probably explain this better, he actually understands it while I just pretend to. 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 would be similar to #211340 but it's not the issue here because those attrs are spliced correctly pkgsCross.aarch64-multiplatform.__splicedPackages.rustPlatform.rust.rustc.__spliced (because they're not inside a derivation, read through the issue.)
no aarch64-unknown-linux-gnu suffix so they should be for build 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. diff --git a/pkgs/development/python-modules/cryptography/default.nix b/pkgs/development/python-modules/cryptography/default.nix
index ba2407923f3..105a5dd4dfc 100644
--- a/pkgs/development/python-modules/cryptography/default.nix
+++ b/pkgs/development/python-modules/cryptography/default.nix
@@ -77,6 +77,8 @@ buildPythonPackage rec {
"--disable-pytest-warnings"
];
+ passthru = { inherit rustPlatform; };
+
disabledTestPaths = lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [
# aarch64-darwin forbids W+X memory, but this tests depends on it:
# * https://cffi.readthedocs.io/en/latest/using.html#callbacks
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.
In other words, it is exactly the issue here, but "spliced correctly" has been defined in a way that is totally contrary to peoples' expectations about how this should work, just so this can be declared I think it is time to admit that the splicing magic was not a good idea. It misleads people into thinking they know what's going on when they don't.
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's not a hack, it's just for inspecting the attrset and showing that the package attrs have __spliced. |
||
]; | ||
|
||
buildInputs = [ openssl ] | ||
++ lib.optionals stdenv.isDarwin [ Security libiconv ]; | ||
buildInputs = [ | ||
openssl | ||
setuptools-rust | ||
rustPlatform.cargoSetupHook | ||
Comment on lines
+68
to
+69
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. setuptools is consumed by the python that is building as far as I know. setup hooks also usually go to nativeBuildInputs. I assume the hooks themselves require some fixes to fix this properly. |
||
] ++ lib.optionals stdenv.isDarwin [ | ||
Security | ||
libiconv | ||
]; | ||
|
||
propagatedBuildInputs = lib.optionals (!isPyPy) [ | ||
cffi | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.