nixpkgs/pkgs/build-support
Colin Putney 234bb31f61
Fix venv creation in Python environments
The way we build python environments is subtly broken. A python
environment should be semantically identical to a vanilla Python
installation in, say, /usr/local. The current implementation, however,
differs in two important ways. The first is that it's impossible to use
python packages from the environment in python virtual environments. The
second is that the nix-generated environment appears to be a venv, but
it's not.

This commit changes the way python environments are built:

  * When generating wrappers for python executables, we inherit argv[0]
    from the wrapper. This causes python to initialize its configuration
    in the environment with all the correct paths.
  * We remove the sitecustomize.py file from the base python package.
    This file was used tweak the python configuration after it was
    incorrectly initialized. That's no longer necessary.

The end result is that python environments no longer appear to be venvs,
and behave more like a vanilla python installation. In addition it's
possible to create a venv using an environment and use packages from
both the environment and the venv.
2024-03-21 19:26:57 -06:00
..
add-driver-runpath addDriverRunpath: init 2023-12-03 07:22:51 -08:00
add-opengl-runpath
agda agdaPackages.*: support literate Typst files 2023-10-24 20:34:05 +02:00
alternatives treewide: simplify exec format conditionals 2024-01-07 17:43:33 -08:00
appimage appimage-run: Add pipewire support 2024-02-18 22:34:27 +01:00
binary-cache pkgs/build-support: refactor drvs using __structuredAttrs = true 2023-10-04 18:37:00 +02:00
bintools-wrapper Revert "avrlibc: hook up libdir for cc-wrapper" 2024-03-14 20:09:11 +01:00
build-bazel-package buildBazelPackage: add support for bazel run targets 2023-08-02 16:05:55 +08:00
build-fhsenv-bubblewrap Merge pull request #277494 from trofi/buildFHSEnv-fix-eval 2024-02-22 21:00:19 +01:00
build-fhsenv-chroot build-fhs-user-env: add compatibility for pipewire alsa emulation 2024-02-02 22:38:49 -08:00
build-graalvm-native-image buildGraalvmNativeImage: fix UTF-8 encoding issue for JVM dependencies 2024-01-26 11:12:54 +00:00
buildenv build-support/buildenv: Hoist builder instantiation 2023-12-29 03:04:46 +13:00
cc-wrapper Merge remote-tracking branch 'upstream/master' into staging-next 2024-03-17 07:18:11 +00:00
coq
dart dartHooks.dartInstallHook: Add trailing newline 2024-01-18 12:17:43 +11:00
deterministic-uname deterministic-uname: fix default output 2023-09-17 00:08:43 +03:00
dhall
docker Merge pull request #292259 from dawidd6/docker-nix-ssl 2024-03-12 02:01:08 +01:00
dotnet nuget-to-nix: fix error handling 2024-03-06 10:14:21 -04:00
emacs Merge branch 'master' into staging-next 2023-12-31 02:31:32 +01:00
expand-response-params expand-response-params: explain what a "response file" is 2023-10-22 08:57:24 +03:00
fake-nss
fetch9front lib: add fetchFrom9Front 2023-07-23 13:16:28 -05:00
fetchbitbucket treewide: Make some fetchers overridable 2023-04-22 22:29:23 +02:00
fetchbower
fetchbzr treewide: refactor .attrs.sh detection 2023-10-04 18:36:57 +02:00
fetchcvs treewide: refactor .attrs.sh detection 2023-10-04 18:36:57 +02:00
fetchdarcs treewide: refactor .attrs.sh detection 2023-10-04 18:36:57 +02:00
fetchdebianpatch fetchDebianPatch: Require patch names with extensions 2023-09-14 18:55:30 +00:00
fetchdocker Merge staging-next into staging 2023-10-21 00:02:49 +00:00
fetchfirefoxaddon fetchfirefoxaddon: fix passing md5 to fetchurl 2023-07-28 16:18:15 -04:00
fetchfossil fetchfossil: support SRI hashes 2023-11-22 09:47:57 +01:00
fetchgit Merge branch 'master' into staging-next 2023-11-12 19:45:20 +01:00
fetchgitea treewide: Make some fetchers overridable 2023-04-22 22:29:23 +02:00
fetchgithub fetchFromGitHub: fix compatibility issue with nix-prefetch 2024-01-30 12:21:13 +01:00
fetchgitiles treewide: Make some fetchers overridable 2023-04-22 22:29:23 +02:00
fetchgitlab Merge pull request #268304 from panicgh/fetchgitlab-sparse-forcegit 2023-12-17 03:34:52 +01:00
fetchgitlocal treewide: Make some fetchers overridable 2023-04-22 22:29:23 +02:00
fetchgx
fetchhg treewide: refactor .attrs.sh detection 2023-10-04 18:36:57 +02:00
fetchipfs treewide: refactor .attrs.sh detection 2023-10-04 18:36:57 +02:00
fetchmavenartifact fetchMavenArtifact: deprecate phases & use pname+version 2023-03-26 18:44:55 +02:00
fetchmtn treewide: refactor .attrs.sh detection 2023-10-04 18:36:57 +02:00
fetchnextcloudapp fetchNextcloudApp: remove backwards compat for old interface 2023-08-20 13:41:43 +02:00
fetchpatch fetchpatch: add decode test 2023-03-11 21:39:29 +00:00
fetchpijul build-support/fetchpijul: Enable strictDeps 2023-12-06 18:40:07 +01:00
fetchpypi
fetchpypilegacy fetchPypiLegacy: add test 2024-02-17 17:11:59 +13:00
fetchrepoorcz
fetchrepoproject fetchrepoproject: fix a bug that was there since bef6bef0d2 2023-08-06 12:17:09 +00:00
fetchs3
fetchsavannah treewide: Make some fetchers overridable 2023-04-22 22:29:23 +02:00
fetchsourcehut fetchFromSourcehut: expose gitRepoUrl to consumers 2023-06-11 09:02:34 +01:00
fetchsvn treewide: refactor .attrs.sh detection 2023-10-04 18:36:57 +02:00
fetchsvnrevision
fetchsvnssh treewide: refactor .attrs.sh detection 2023-10-04 18:36:57 +02:00
fetchtorrent tests.fetchtorrent: add watched-cd license 2023-12-02 02:04:50 +01:00
fetchurl fetchurl/mirrors: add cdn.download.kde.org as default KDE mirror 2023-12-03 14:48:56 +03:00
fetchzip fetchzip: allow dropping unzip 2024-01-12 20:26:16 +01:00
flutter buildFlutterApplication: Change flutterHostPlatform to targetFlutterPlatform 2024-01-19 11:07:33 +11:00
go Merge pull request #276685 from katexochen/buildGoModule/buildid 2024-01-14 14:13:16 +01:00
icon-conv-tools
install-shell-files
java
kernel Merge pull request #283770 from r-ryantm/auto-update/makeInitrdNGTool 2024-02-10 22:19:21 -05:00
lib make-derivation.nix: Split makeDerivationArgument, mkDerivation with duplicate functionality 2024-03-12 18:16:56 +01:00
libredirect libredirect: don't test LFS64 functions on musl 2024-03-02 01:02:36 +01:00
make-darwin-bundle writeDarwinBundle: use binary wrapper 2023-08-21 13:29:12 +10:00
make-desktopitem
make-hardcode-gsettings-patch makeHardcodeGsettingsPatch: Support applying patches 2023-11-21 08:42:47 +01:00
make-pkgconfigitem
make-startupitem make-startupitem: fix typo in comment 2023-08-16 18:03:02 +02:00
mkshell doc: add explanatory code comment 2023-11-13 20:59:33 +01:00
mono-dll-fixer
nix-gitignore Merge pull request #239624 from Stunkymonkey/use-optionalString-then 2023-07-22 13:02:47 +02:00
node npmHooks.npmInstallHook: ignore bundle deps when calculating files to install 2024-03-14 14:04:51 +01:00
nuke-references nuke-references: add meta.mainProgram 2024-01-05 15:04:14 -05:00
ocaml ocamlPackages.buildTopkgPackage: Added 2023-09-28 12:03:20 +02:00
oci-tools ociTools: Fix invalid cgroup mount option 2023-12-27 19:41:07 +01:00
php build-support/php: update warnings when composer validate fails 2024-03-14 21:52:08 +01:00
pkg-config-wrapper treewide: use optionalAttrs instead of 'else {}' 2023-06-25 11:01:34 -03:00
portable-service
prefer-remote-fetch prefer-remote-fetch: add more fetchers which prefer local builds 2023-11-29 10:25:20 +01:00
references-by-popularity pkgs/build-support: refactor drvs using __structuredAttrs = true 2023-10-04 18:37:00 +02:00
release build-support/release: deprecate phases 2023-11-25 21:00:17 +01:00
remove-references-to Merge pull request #162447 from thefloweringash/remove-references-to-region 2023-05-17 12:34:28 +03:00
replace-secret replace-secret: add mainProgram 2023-11-26 16:27:42 +02:00
rust wrapRustc: wrap rustdoc 2024-03-02 13:09:07 +01:00
setup-hooks Fix venv creation in Python environments 2024-03-21 19:26:57 -06:00
singularity-tools apptainer, singularity: drop obsolete LOCALSTATEDIR dirs 2023-08-23 18:20:25 +08:00
src-only nixos/tests: Test that Remote SSH can patch Node 2023-06-09 18:21:41 +10:00
substitute substitute: Deprecate replacements, introduce replacementsList 2024-02-29 00:35:27 +01:00
substitute-files
testers macOS support for NixOS tests (#282401) 2024-03-02 06:33:14 +01:00
trivial-builders trivial-builders: Deduplicate docs 2024-03-11 11:33:14 +01:00
vm vmTools: update debian versions 2023-11-24 20:59:42 +04:00
wrapper-common wrapBintoolsWith: support LINK.EXE-style args in purity checks 2023-04-29 01:37:00 +00:00
writers Merge remote-tracking branch 'upstream/staging-next' into staging 2024-03-16 00:07:22 +00:00
build-maven.nix
checkpoint-build.nix doc: polish the docs of checkpointBuildTools 2024-01-09 01:34:21 +08:00
closure-info.nix closureInfo: handle empty path set explicitly 2023-11-04 09:54:41 +01:00
make-impure-test.nix
plugins.nix
replace-dependency.nix
setup-systemd-units.nix
source-from-head-fun.nix