You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just opening this to document trouble I had in case it helps someone save a few days of flailing--I don't have enough perspective on what kinds of problems were caused by stripping to understand which default is ideal.
Hodgepodge of observations in case they make this more searchable:
In the process of switching a project over from mach-nix to dream2nix, I noticed that a container containing the environment generated with dockerTools.buildLayeredImage was nearly twice as large as the old mach-nix-based container.
I added the environment to the new container by including packages.blah.pyEnv in its contents.
Unpacking the container filesystem and fishing around led me to identify the most-conspicuous difference as the presence of GCC.
Using nix-tree on it (I needed something like nix build .#blah && nix run github:nixos/nixpkgs#nix-tree -- --dot .#blah helped identify 5 packages as depending on GCC: libsass, misaka, psycopg2 rjsmin, sqlalchemy.
After a good bit of flailing about with override mechanisms, I eventually tracked this down by expanding my search beyond dream2nix stuff and finding a discourse thread where the same basic problem (unexpected runtime dependency on GCC) was identified as a side-effect of stripping being disabled. fix(pip): set dontStrip for all dependencies #673 disabled stripping by default here.
I ended up getting what I need with pip.overrideAll.mkDerivation.dontStrip = false;, but overriding this on the individual problem-packages also worked just fine if you need to be more precise (i.e., pip.overrides.misaka.mkDerivation.dontStrip = false;).
Since I extracted a minimal reproducible example in the process of figuring this out, I'll include links in case they help (ignore the repo name, I added it on top of a repro for a different problem I had):
Just opening this to document trouble I had in case it helps someone save a few days of flailing--I don't have enough perspective on what kinds of problems were caused by stripping to understand which default is ideal.
Hodgepodge of observations in case they make this more searchable:
dockerTools.buildLayeredImage
was nearly twice as large as the old mach-nix-based container.packages.blah.pyEnv
in its contents.nix-tree
on it (I needed something likenix build .#blah && nix run github:nixos/nixpkgs#nix-tree -- --dot .#blah
helped identify 5 packages as depending on GCC: libsass, misaka, psycopg2 rjsmin, sqlalchemy.pip.overrideAll.mkDerivation.dontStrip = false;
, but overriding this on the individual problem-packages also worked just fine if you need to be more precise (i.e.,pip.overrides.misaka.mkDerivation.dontStrip = false;
).Since I extracted a minimal reproducible example in the process of figuring this out, I'll include links in case they help (ignore the repo name, I added it on top of a repro for a different problem I had):
adding a package that holds on to GCC via abathur/flake_dream2nix_patchelf@d5a0b66 with demonstration in CI at https://github.com/abathur/flake_dream2nix_patchelf/actions/runs/9470568588/job/26091792723#step:8:17
adding fix via abathur/flake_dream2nix_patchelf@a9ed227 with demonstration in CI at https://github.com/abathur/flake_dream2nix_patchelf/actions/runs/9470810183/job/26092560974#step:8:16
The text was updated successfully, but these errors were encountered: