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

python3: improve cross-compilation of extension modules, fixes #91171 #91178

Merged
merged 2 commits into from Jun 22, 2020

Conversation

@FRidh
Copy link
Member

FRidh commented Jun 20, 2020

Fixes #91171.

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
@FRidh FRidh changed the base branch from master to staging Jun 20, 2020
@FRidh FRidh requested review from knedlsepp, primeos and Mic92 Jun 20, 2020
@FRidh

This comment was marked as resolved.

@ofborg ofborg bot added the 6.topic: python label Jun 20, 2020
@primeos primeos mentioned this pull request Jun 20, 2020
2 of 10 tasks complete
@FRidh

This comment was marked as resolved.

@FRidh
Copy link
Member Author

FRidh commented Jun 20, 2020

Upstream PR!
python/cpython#7914

@Mic92
Copy link
Contributor

Mic92 commented Jun 21, 2020

Downside of this approach is that it only works in a nix-build or nix-shell.

This is not really a regression compilers don't work outside the nix-shell anyway.

@FRidh
Copy link
Member Author

FRidh commented Jun 21, 2020

Doesn't mean we need to enforce that shortcoming when we can avoid it.

@Mic92
Copy link
Contributor

Mic92 commented Jun 21, 2020

Doesn't mean we need to enforce that shortcoming when we can avoid it.

It should be easy enough to whatever one wants to use instead of nix-shell to also just export LDSHARED, CC, and CXX accordingly.

FRidh added 2 commits Jun 21, 2020
This should no longer be needed with python3 because it's now
set correctly in the interpreter.

Note that the build currently fails with and without this change.
@FRidh FRidh force-pushed the FRidh:ldshared branch from 84f4892 to 82f1704 Jun 21, 2020
@FRidh
Copy link
Member Author

FRidh commented Jun 21, 2020

Exactly.

So, as it is now cross-compiling pycryptodome succeeds. I also tried btrfs-progs because it exports LDSHARED, but unfortunately that package fails to build with and without the patch in this PR.

@ofborg ofborg bot requested a review from 7c6f434c Jun 21, 2020
@Mic92
Copy link
Contributor

Mic92 commented Jun 21, 2020

There is a report that btrfs-progs cross-compiles now as of #50925 (comment)

@FRidh FRidh merged commit 9c3a585 into NixOS:staging Jun 22, 2020
17 of 18 checks passed
17 of 18 checks passed
btrfs-progs, btrfs-progs.passthru.tests, python3, python3.passthru.tests on x86_64-darwin
Details
btrfs-progs, btrfs-progs.passthru.tests on x86_64-darwin No attempt
Details
Evaluation Performance Report Evaluator Performance Report
Details
btrfs-progs, btrfs-progs.passthru.tests, python3, python3.passthru.tests on aarch64-linux Success
Details
btrfs-progs, btrfs-progs.passthru.tests, python3, python3.passthru.tests on x86_64-linux Success
Details
grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-maintainers matching changed paths to changed attrs...
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="82f1704"; rev="82f170436d355d82c7e4bbef25fa7b1747b46330"; } ./pkgs/t
Details
grahamcofborg-eval-lib-tests nix-build --arg pkgs import ./. {} ./lib/tests/release.nix
Details
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="82f1704"; rev="82f170436d355d82c7e4bbef25fa7b1747b46330"; } ./nixos/
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="82f1704"; rev="82f170436d355d82c7e4bbef25fa7b1747b46330"; } ./nixos/
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="82f1704"; rev="82f170436d355d82c7e4bbef25fa7b1747b46330"; } ./nixos/
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="82f1704"; rev="82f170436d355d82c7e4bbef25fa7b1747b46330"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="82f1704"; rev="82f170436d355d82c7e4bbef25fa7b1747b46330"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="82f1704"; rev="82f170436d355d82c7e4bbef25fa7b1747b46330"; } ./pkgs/t
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.