Skip to content

audit: disable python when cross-compiling#164622

Merged
sternenseemann merged 1 commit intoNixOS:masterfrom
sternenseemann:nixos-cross
Mar 18, 2022
Merged

audit: disable python when cross-compiling#164622
sternenseemann merged 1 commit intoNixOS:masterfrom
sternenseemann:nixos-cross

Conversation

@sternenseemann
Copy link
Member

@sternenseemann sternenseemann commented Mar 17, 2022

To support this theoretically, the configure script upstream would need
to a) stop using PATH for finding python-config exclusively and allow
passing an absolute path to it and b) cease using the distutils module
for configuration purposes which of course requires running the host
python interpreter which is not possible in the cross case.

Description of changes
Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.05 Release Notes (or backporting 21.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

To support this theoretically, the configure script upstream would need
to a) stop using PATH for finding python-config exclusively and allow
passing an absolute path to it and b) cease using the distutils module
for configuration purposes which of course requires running the host
python interpreter which is not possible in the cross case.
@sternenseemann
Copy link
Member Author

This is the problematic bit in the configure script. As a side note, we should probably use --with-python3 in the future instead as well, but it also suffers from the same flaw, so it doesn't really matter.

@sternenseemann
Copy link
Member Author

cc @jonringer as well who enabled python by default.

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. labels Mar 17, 2022
Copy link
Contributor

@Mindavi Mindavi left a comment

Choose a reason for hiding this comment

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

Related to #123342.

Since python bindings were disabled in the past as well, I don't expect any issues to crop up from this in the near future.

Did not build/test, but looks safe to me.

@sternenseemann sternenseemann merged commit fcb6bb6 into NixOS:master Mar 18, 2022
@sternenseemann sternenseemann deleted the nixos-cross branch March 18, 2022 21:45
@vcunat vcunat mentioned this pull request Mar 27, 2022
10 tasks
@Mindavi Mindavi added the 6.topic: cross-compilation Building packages on a different platform than they will be used on label Apr 11, 2022
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 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants