about summary refs log tree commit diff
path: root/pkgs/by-name/pa
diff options
context:
space:
mode:
authoradisbladis2024-08-02 23:10:35 +1200
committeradisbladis2024-08-03 12:18:56 +1200
commite0816431a23a06692d86c0b545b4522b9a9bc939 (patch)
treefa70edcddaf56bc605f2ecdf153b2d9ba162d67a /pkgs/by-name/pa
parentadb3cee87d7bc92c97100efc7e30aeb6301e5fb6 (diff)
treewide: Pass self when overriding Python
Otherwise references to the Python interpreter inside the set are wrong, as demonstrated by:
``` nix
with import <nixpkgs> { };
let
  python' = python3.override {
    packageOverrides = final: prev: { requests = prev.requests.overridePythonAttrs(old: { version = "1337";  }); };
  };
in python'.pkgs.python.pkgs.requests
```
which returns the _non_ overriden requests.

And the same with `self`:
```
with import <nixpkgs> { };
let
  python' = python3.override {
    self = python';
    packageOverrides = final: prev: { requests = prev.requests.overridePythonAttrs(old: { version = "1337";  }); };
  };
in python'.pkgs.python.pkgs.requests
```
which returns the overriden requests.

This can manifest itself as file collisions when constructing environments or as subtly incorrect dependency graphs.
Diffstat (limited to 'pkgs/by-name/pa')
-rw-r--r--pkgs/by-name/pa/pacu/package.nix1
-rw-r--r--pkgs/by-name/pa/parsedmarc/package.nix1
2 files changed, 2 insertions, 0 deletions
diff --git a/pkgs/by-name/pa/pacu/package.nix b/pkgs/by-name/pa/pacu/package.nix
index 5c87d124ee96..0ee1f4f1c8cc 100644
--- a/pkgs/by-name/pa/pacu/package.nix
+++ b/pkgs/by-name/pa/pacu/package.nix
@@ -7,6 +7,7 @@
 
 let
   python = python3.override {
+    self = python;
     packageOverrides = self: super: { sqlalchemy = super.sqlalchemy_1_4; };
   };
 in
diff --git a/pkgs/by-name/pa/parsedmarc/package.nix b/pkgs/by-name/pa/parsedmarc/package.nix
index 6c08dced6326..acc8cee9782b 100644
--- a/pkgs/by-name/pa/parsedmarc/package.nix
+++ b/pkgs/by-name/pa/parsedmarc/package.nix
@@ -4,6 +4,7 @@
 
 let
   python = python3.override {
+    self = python;
     packageOverrides = self: super: {
       # https://github.com/domainaware/parsedmarc/issues/464
       msgraph-core = super.msgraph-core.overridePythonAttrs (old: rec {