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
The "redist" cudatoolkit packages provide the "throw-all-in" $out output in addition to the split dev/lib/static outputs. Currently $out is implemented as a symlink farm, combining all of the other outputs that contain the real content:
This has two disadvantages: we spawn more symlinks which are expensive on distributed network filesystems, and we get larger runtime closures for the less maintained packages that use the default .out instead of the individual outputs (e.g. libcublas instead of [ libcublas.dev libcublas.lib libcublas.static ], #271078 (comment)): if we refer to a symlink from a RUNPATH in another package, we cannot discard the rest of the symlink farm, and then we cannot discard .static at runtime even though it's obviously useless after the build. This the same issue as when packages use {cudatoolkit,rocm}_merged = symlinkJoin ...
Proposal
Make $out contain just a single directory: nix-support. Reference the "real" outputs in their respective propagated{,Native}BuildInputs. This way the build time closure would remain expensive, but we the runtime closures would likely only include the .lib outputs and only when linking dynamically.
This should work out of the box for all of the normal packages that e.g. use FindCUDAToolkit.cmake and do not intentionally try to break it
This would break packages that might be somehow peeking into $out's internal structure, e.g. accessing its content by paths or use build systems that expect some sort of XXXX_ROOT variables. In these cases we can resort to symlinkJoin or try to fix the issue upstream
A related detail: I think might be important to ensure that $out is otherwise empty, because that way we know there are no dangling references. Currently we forget to move the pkg-config/*.pc files to $dev (ConnorBaker/cuda-redist-find-features#10) and they should obviously include references to $dev and $lib except that we forget to patch out the fhs paths (#224119) out of them
@NixOS/cuda-maintainers
The text was updated successfully, but these errors were encountered:
Issue description
The "redist" cudatoolkit packages provide the "throw-all-in"
$out
output in addition to the split dev/lib/static outputs. Currently$out
is implemented as a symlink farm, combining all of the other outputs that contain the real content:nixpkgs/pkgs/development/compilers/cudatoolkit/redist/build-cuda-redist-package.nix
Lines 142 to 147 in 1fd9c9c
This has two disadvantages: we spawn more symlinks which are expensive on distributed network filesystems, and we get larger runtime closures for the less maintained packages that use the default
.out
instead of the individual outputs (e.g.libcublas
instead of[ libcublas.dev libcublas.lib libcublas.static ]
, #271078 (comment)): if we refer to a symlink from a RUNPATH in another package, we cannot discard the rest of the symlink farm, and then we cannot discard.static
at runtime even though it's obviously useless after the build. This the same issue as when packages use{cudatoolkit,rocm}_merged = symlinkJoin ...
Proposal
Make
$out
contain just a single directory:nix-support
. Reference the "real" outputs in their respectivepropagated{,Native}BuildInputs
. This way the build time closure would remain expensive, but we the runtime closures would likely only include the.lib
outputs and only when linking dynamically.This should work out of the box for all of the normal packages that e.g. use
FindCUDAToolkit.cmake
and do not intentionally try to break itThis would break packages that might be somehow peeking into
$out
's internal structure, e.g. accessing its content by paths or use build systems that expect some sort ofXXXX_ROOT
variables. In these cases we can resort tosymlinkJoin
or try to fix the issue upstreamA related detail: I think might be important to ensure that
$out
is otherwise empty, because that way we know there are no dangling references. Currently we forget to move thepkg-config/*.pc
files to$dev
(ConnorBaker/cuda-redist-find-features#10) and they should obviously include references to$dev
and$lib
except that we forget to patch out the fhs paths (#224119) out of them@NixOS/cuda-maintainers
The text was updated successfully, but these errors were encountered: