Skip to content

Conversation

@rhelmot
Copy link
Contributor

@rhelmot rhelmot commented Jun 20, 2024

Description of changes

Previously, python3 was only provided as a buildInput. However, libpsl.bin distributes python scripts. To make them use the right python, provide python as a nativeBuildInput and specify which python to use for the build with a configure flag.

This rebuilds curl.dev. I'm not sure how far-reaching the consequences of that are, but it at least includes rebuilding rustc, so I'm targeting staging.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
    • x86_64-freebsd
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • 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/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 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
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@ofborg ofborg bot requested a review from c0bw3b June 20, 2024 04:51
@ofborg ofborg bot added 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. labels Jun 20, 2024
@rhelmot rhelmot mentioned this pull request Jun 20, 2024
14 tasks
Copy link
Member

Choose a reason for hiding this comment

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

Why getDev, dev output usually doesn't have bin

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh dear, now THAT is a typo. I have no idea how this worked in my testing...

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"PYTHON=${lib.getBin buildPackages.python3}/bin/python3"
"PYTHON=${lib.getExe buildPackages.python3}"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@Ericson2314
Copy link
Member

Description seems backwards? Also do we still need the one runnable at build time for cross?

@rhelmot
Copy link
Contributor Author

rhelmot commented Jul 20, 2024

You're right, the description is backwards. I'll fix it in a moment.

I recall attempting to switch python to just being a buildInput, but it failed, and I was in fact testing linux -> freebsd cross while working on this.

Previously, python3 was only provided as a nativeBuildInput. However,
libpsl.bin distributes python scripts. To make them use the right
python, provide python as a buildInput and specify which python to
use at build time with a configure flag.
@Ericson2314 Ericson2314 merged commit 02cbd68 into NixOS:staging Jul 24, 2024
@Ericson2314 Ericson2314 deleted the libpsl-python branch July 24, 2024 18:05
@vcunat
Copy link
Member

vcunat commented Aug 15, 2024

@Ericson2314, @alyssais: this has consequences for netbsd and openbsd cross. nix now fails with

error: Failed to evaluate python3-3.11.9: «unsupported»: is not available on the requested hostPlatform:

I just noticed by accident that jobs fell off Hydra, but I'm not personally interested in netbsd or openbds. Easy eval test e.g.:

nix eval -f pkgs/top-level/release-cross.nix x86_64-netbsd.nix.x86_64-linux.outPath

@alyssais
Copy link
Member

Oh, thanks for noticing!

@alyssais
Copy link
Member

Python can't (or at least refuses to) cross compile for NetBSD, so maybe the thing to do where we can't cross compile Python is just to not install the Python scripts? (Or leave them with unpatched shebangs, in case there's system Python?)

@jcaesar
Copy link
Contributor

jcaesar commented Aug 16, 2024

This also broke pkgsStatic.curl. I assume that's used somewhere, given it is actively maintained?

[Edit:] My apologies, this isn't quite right. This did add the dependency from pkgsStatic.libpsl to pkgsStatic.python3, but at the time of merging this, pkgsStatic.python3 was still building fine. So this isn't the root cause. [Edit2:] Updating to Python 3.12 was what broke pkgsStatic.python3. The temporary fix is to avoid this dependency.

@emilazy
Copy link
Member

emilazy commented Aug 16, 2024

Maybe the binaries should be a separate package altogether, as they’re probably relatively marginal?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants