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

libpsl: make python both a build and runtime dependency #321150

Open
wants to merge 1 commit into
base: staging
Choose a base branch
from

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.

@@ -61,6 +62,7 @@ stdenv.mkDerivation rec {
"--with-psl-distfile=${publicsuffix-list}/share/publicsuffix/public_suffix_list.dat"
"--with-psl-file=${publicsuffix-list}/share/publicsuffix/public_suffix_list.dat"
"--with-psl-testfile=${publicsuffix-list}/share/publicsuffix/test_psl.txt"
"PYTHON=${lib.getDev buildPackages.python3}/bin/python3"
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...

@@ -61,6 +62,7 @@ stdenv.mkDerivation rec {
"--with-psl-distfile=${publicsuffix-list}/share/publicsuffix/public_suffix_list.dat"
"--with-psl-file=${publicsuffix-list}/share/publicsuffix/public_suffix_list.dat"
"--with-psl-testfile=${publicsuffix-list}/share/publicsuffix/test_psl.txt"
"PYTHON=${lib.getBin buildPackages.python3}/bin/python3"
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants