@@ -44,17 +44,16 @@ the environments to make the transition easier to review.
4444
4545@rnhmjoj & @timokau How unfortunate it is that Python's ` buildEnv ` doesn't know
4646to do anything besides setting ` NIX_PYTHONPATH ` - it knows nothing about other
47- env vars, which is totally legitimate for dependencies of the environment to
48- rely upon runtime. Declarative wrappers don't care about the meaning of env
49- vars - all of them are treated equally, considering all of the inputs of a
50- derivation equally.
47+ env vars, which some deps rely upon when eventually used. Declarative wrappers
48+ don't care about the meaning of env vars - all of them are treated equally,
49+ considering all of the inputs of a derivation equally.
5150
5251- [ pull 75851] ( https://github.com/NixOS/nixpkgs/pull/75851 )
5352- [ issue 87667] ( https://github.com/NixOS/nixpkgs/issues/87667 )
5453
5554Fixable with our current wrapping tools (I guess?) but it's unfortunate that we
5655have to trigger a rebuild of VLC and potentially increase it's closure size,
57- just because of a missing env var for some users. If only our wrapping
56+ just because of a missing env var for only _ some _ users. If only our wrapping
5857requirements were accessible via Nix attrsets, we could have instructed our
5958modules to consider this information when building the wrappers of the packages
6059in ` environment.systemPackages ` .
7877
7978I guess we don't wrap HPLIP because not everybody want to use these binaries
8079and hence want these GUI deps in their closure (if they were wrapped with a
81- setup hook)? Declarative wrappers would allow some users to use the wrapped
82- binaries and others not need it, via an override or a NixOS config flag,
83- without triggering a rebuild of HPLIP itself.
80+ setup hook)? Declarative wrappers would allow _ some_ users to use the wrapped
81+ binaries and others not to need this wrapping. Via an override or a NixOS
82+ config flag, without triggering a rebuild of HPLIP itself, these users would be
83+ easily satisfied.
8484
8585## Orchestrating wrapping hooks
8686
8787- [ issue 78792] ( https://github.com/NixOS/nixpkgs/issues/78792 )
8888
89- @worldofpeace you are correct. All of these setup-hooks are a mess, but at
90- least we have documented, yet not totally implemented this section of the
91- manual
89+ @worldofpeace you are correct. All of these setup-hooks are a mess. At least we
90+ have documented, (yet not totally implemented) this section of the manual
9291https://nixos.org/nixpkgs/manual/#ssec-gnome-common-issues-double-wrapped
9392
9493Declarative wrappers will deprecate the usage of our shell based hooks and will
9594wrap all executables automatically according to their needs, without requiring
96- the contributor a lot of knowledge of the wrapping system.
95+ the contributor a lot of knowledge of the wrapping system. Also, double
96+ wrappings will become a problem of the past.
9797
9898- [ issue 86369] ( https://github.com/NixOS/nixpkgs/issues/86369 )
9999
100- @ttuegel I get the sense [ you support this
101- idea ] ( https://github.com/NixOS/nixpkgs/issues/86369#issuecomment-626732191 ) .
102- But for anyone else interested, the issue is a bit complex, so once you'll read
103- the design of this RFC, and see examples of what the POC implementation of
104- declarative wrappers [ is capable
100+ @ttuegel I get the sense [ you support this idea of declarative
101+ wrappers ] ( https://github.com/NixOS/nixpkgs/issues/86369#issuecomment-626732191 ) .
102+ For anyone else interested in a summary , the issue is a bit complex, so once
103+ you'll read the design of this RFC, and see examples of what the POC
104+ implementation of declarative wrappers [ is capable
105105of] ( https://github.com/NixOS/nixpkgs/pull/85103#issuecomment-614195666 ) , I hope
106- you'll see how declarative wrappers can solve this issue.
106+ you'll see how declarative wrappers will solve this issue.
107107
108108
109109## Issues _ possibly_ fixable by declarative wrappers (?)
110110
111111- [ pull 61213] ( https://github.com/NixOS/nixpkgs/pull/61213 )
112112
113- I'm not sure what's the issue there. But, I'm sure that a Nix based builder of
114- a Python environment should make it easier to control and alter if needed, what
115- environment is used even by builders, not only user facing Python environments .
113+ I'm not sure what's the issue there. But, I'm sure that a declarative, Nix
114+ based builder of a Python environment, even if this environment is used only
115+ for a build, should make it easier to control and alter it's e.g ` $PATH ` .
116116
117117- [ issue 83667] ( https://github.com/NixOS/nixpkgs/issues/83667 )
118118
119119@FRidh I see no reason for Python deps of Python packages to need to be in
120- ` propagatedBuildInputs ` and not regular ` buildInputs ` . I think this was done so
121- in the past so it'd be easy to know how to wrap them? Declarative wrappers
122- won't require runtime-env-requiring deps to be only in ` propagatedBuildInputs `
123- or ` buildInputs ` - it should pick such deps from both lists. Hence, (I think) it
124- should be possible to make Python's static builds consistent with other
125- ecosystems.
120+ ` propagatedBuildInputs ` and not regular ` buildInputs ` but please correct me if
121+ I'm wrong. I think this was done so in the past so it'd be easy to know how to
122+ wrap them? Declarative wrappers won't require runtime-env-requiring deps to be
123+ only in ` propagatedBuildInputs ` or ` buildInputs ` - it should pick such deps
124+ from both lists. Hence, (I think) it should be possible to make Python's static
125+ builds consistent with other ecosystems.
126126
127127- [ issue 86054] ( https://github.com/NixOS/nixpkgs/issues/86054 )
128128
@@ -163,7 +163,7 @@ $ nix why-depends -f. kdeconnect kdeframeworks.kconfigwidgets.dev
163163```
164164
165165Also similar (but possibly fixable by moving ` gobject-introspection ` to a
166- different inputs list?
166+ different inputs list?):
167167
168168```
169169$ nix why-depends -f. beets gobject-introspection.dev
@@ -176,7 +176,7 @@ $ nix why-depends -f. beets gobject-introspection.dev
176176
177177- [ issue 60260] ( https://github.com/NixOS/nixpkgs/issues/60260 )
178178
179- General, justified complain about wrappers.
179+ General, justified complaint about wrappers.
180180
181181- [ issue 95027] ( https://github.com/NixOS/nixpkgs/issues/95027 )
182182- [ issue 23018] ( https://github.com/NixOS/nixpkgs/issues/23018 )
@@ -205,7 +205,7 @@ interface similar to
205205[ ` wrapMpv ` ] ( https://github.com/NixOS/nixpkgs/blob/a5985162e31587ae04ddc65c4e06146c2aff104c/pkgs/applications/video/mpv/wrapper.nix#L9-L23 )
206206and
207207[ ` wrapNeovim ` ] ( https://github.com/NixOS/nixpkgs/blob/a5985162e31587ae04ddc65c4e06146c2aff104c/pkgs/applications/editors/neovim/wrapper.nix#L11-L24 )
208- which will accept a single derivation or an array of them and it'll wrap all of
208+ which will accept a single derivation or an array of them and will wrap all of
209209their executables with the proper environment, based on their inputs.
210210
211211` wrapGeneric ` should iterate recursively all ` buildInputs ` and
@@ -319,9 +319,9 @@ Perhaps our shell hooks _can_ be fixed / improved, and we could help make it
319319easier to debug them via ` NIX_DEBUG ` . Then it might help us track down e.g why
320320environment variables are added twice etc. Still though, this wouldn't solve
321321half of the other issues presented here. Most importantly, the shell hooks rely
322- upon being in the inputs during build of the original derivation, hence mere
323- changes to an environment may trigger rebuilds that take a lot of time and
324- resources from avarage users. See [ this
322+ upon being in the inputs during build of the original derivation. Hence, mere
323+ requests for changes to an environment a wrapper sets, trigger rebuilds that
324+ take a lot of time and resources from average users. See [ this
325325comment] ( https://github.com/NixOS/nixpkgs/pull/88136#issuecomment-632674653 ) .
326326
327327# Unresolved questions
@@ -330,13 +330,13 @@ comment](https://github.com/NixOS/nixpkgs/pull/88136#issuecomment-632674653).
330330The POC implementation does 1 thing which I'm most sure could be done better,
331331and that's iterating ** recursively** all ` buildInputs ` and
332332` propagatedBuildInputs ` of the given derivations. This is currently implemented
333- via a recursive (Nix) function, that's prone to reach a state of infinite
334- recursion. But this risk is currently mitigated using an array of packages we
335- know don't need any env vars at runtime, and for sure are very much at the
336- bottom of the list of very common inputs . This is implemented
333+ with a recursive (Nix) function, prone to reach a state of infinite recursion.
334+ This risk is currently mitigated using an array of packages we know don't need
335+ any env vars at runtime, and for sure are very much at the bottom of the list
336+ of all Nixpkgs' dependency graph . This part is implemented
337337[ here] ( https://github.com/NixOS/nixpkgs/pull/85103/files#diff-44c2102a355f50131eb8f69fb7e7c18bR75-R131 ) .
338338
339- There are other methods of doing this recursive search, but TBH I haven't yet
339+ There are other methods of doing this recursive search, but I haven't yet
340340investigated all of them. For reference and hopefully for an advice, this need
341341was requested by others and discussed at:
342342
0 commit comments