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

pythonMinimal: don't include site-customise #82405

Merged
merged 1 commit into from Mar 14, 2020

Conversation

grahamc
Copy link
Member

@grahamc grahamc commented Mar 12, 2020

Experimenting with patching the site-customize file causes mass
rebuilds for no reason.

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.

Experimenting with patching the site-customize file causes mass
rebuilds for no reason.
@FRidh
Copy link
Member

FRidh commented Mar 12, 2020

Note this would break python.buildEnv / python.withPackages. I suppose that is fine for this Python because its not intended for use with packages anyway.

@grahamc
Copy link
Member Author

grahamc commented Mar 12, 2020

Maybe renaming pythonMinimal to bootstrappingPython would be better, to indicate it isn't just a regular python you should use?

@adisbladis
Copy link
Member

I have every intention to use the minimal python with packages.

Me and @flokli spent a bit of time around last Nixcon experimenting with the Python test driver and pystemd.
I haven't touched this effort in a while but that's still something I'd like to accomplish.

@grahamc
Copy link
Member Author

grahamc commented Mar 12, 2020

Your intentions to use it may not match with the package maintainter's intentions in packaging it :P (so maybe there is a need for a minimal python, and a bootstrapping python, like @LnL7 was suggesting.)

@adisbladis
Copy link
Member

adisbladis commented Mar 12, 2020

@grahamc Well, I was the one who created python3Minimal for exactly that kind of purpose.

Another thing I'd like to see it used for is the minimal installer.

@grahamc
Copy link
Member Author

grahamc commented Mar 12, 2020

Oh 🙃

@FRidh FRidh added this to WIP in Staging via automation Mar 12, 2020
@flokli
Copy link
Contributor

flokli commented Mar 12, 2020

I recall @LnL7 mentioning something about copying over/vendoring a bootstrappingPython, so the python.buildEnv changes don't affect the glibc build.

@adisbladis
Copy link
Member

With @grahamc's change to the python3 expression I think we could add a bootstrapPython like this:

bootstrappingPython = python3Minimal.override { includeSiteCustomize = false; };

which still makes it possible to use python3Minimal with packages without causing spurious mass-rebuilds.

Obviously I'd like @LnL7 to chime in on this.

@LnL7
Copy link
Member

LnL7 commented Mar 12, 2020

See #77610 (comment).

For bootstrapping llvm I added a minimal python/boot.nix stripped as much as possible. Making the expression completely separate introduces a little bit of duplication but has the advantage that the regular expression, setup-hook, etc. can be changed freely without having to re-bootstrap.

@FRidh
Copy link
Member

FRidh commented Mar 12, 2020

Note I am looking into actually patching site.py instead of using sitecustomize.py because sitecustomize.py is loaded too late (#79702 (comment)).

@FRidh
Copy link
Member

FRidh commented Mar 14, 2020

For now I would like to go ahead with it. If we find the need to build packages with it, we create a separate pythonBoot.

@FRidh FRidh merged commit 39aac70 into NixOS:staging Mar 14, 2020
Staging automation moved this from WIP to Done Mar 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Staging
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

5 participants