-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cudaPackages: make getOutput work again #301180
cudaPackages: make getOutput work again #301180
Conversation
Testing in https://hercules-ci.com/github/SomeoneSerge/nixpkgs-cuda-ci/jobs/10443. I see that stuff like opencv and blender builds alright |
Ooc why is it safe to remove this now? Have we landed a change to how the outputs work since this code was originally written? |
@samuela I updated the description to provide some context |
I could have sworn this was something necessitated by our use of multiple outputs due to the The only relevant reference I’ve seen so far is Line 1763 in 274e6aa
@SomeoneSerge have you verified that this doesn’t introduce extra stuff to any of the split component outputs? So long as it still works and the outputs and closures of consumers are as expected, I’m fine with this change. |
Well
I guess Speaking of refactoring, I think |
Looked at the outputs of a few different programs and didn't see anything out of place. As an example, here's On this PR: $ nix build --impure -L .#cudaPackages.libcublas^*
$ for f in result*; do echo "Looking at $f"; nix path-info -rSsh "./$f"; done
Looking at result
/nix/store/7n0mbqydcipkpbxm24fab066lxk68aqk-libunistring-1.1 1.7M 1.7M
/nix/store/a2fqd5k8ymb2cadb5awp5b90a5m8acln-gcc-13.2.0-libgcc 155.8K 155.8K
/nix/store/rxganm4ibf31qngal3j3psp20mak37yy-xgcc-13.2.0-libgcc 155.8K 155.8K
/nix/store/s32cldbh9pfzd9z82izi12mdlrw0yf8q-libidn2-2.3.7 352.7K 2.1M
/nix/store/ddwyrxif62r8n6xclvskjyy6szdhvj60-glibc-2.39-5 28.7M 31.0M
/nix/store/c2yb135iv4maadia5f760b3xhbh6jh61-gcc-13.2.0-lib 8.7M 39.8M
/nix/store/l8ylz3d598vm310zy5bg5mkd77ahjxwf-libcublas-12.2.5.6-lib 604.1M 643.9M
/nix/store/8q4q9vl32hy63bmmdd2wc78zqn9wqc1x-libcublas-12.2.5.6-dev 549.9K 644.5M
/nix/store/yynka8djck214kpjgwrvbnhw5ij46xsi-libcublas-12.2.5.6-static 889.8M 889.8M
/nix/store/m5774innl5b78vc8yg1jm1wq0fii6m4q-libcublas-12.2.5.6 499.2K 1.5G
Looking at result-dev
/nix/store/7n0mbqydcipkpbxm24fab066lxk68aqk-libunistring-1.1 1.7M 1.7M
/nix/store/a2fqd5k8ymb2cadb5awp5b90a5m8acln-gcc-13.2.0-libgcc 155.8K 155.8K
/nix/store/rxganm4ibf31qngal3j3psp20mak37yy-xgcc-13.2.0-libgcc 155.8K 155.8K
/nix/store/s32cldbh9pfzd9z82izi12mdlrw0yf8q-libidn2-2.3.7 352.7K 2.1M
/nix/store/ddwyrxif62r8n6xclvskjyy6szdhvj60-glibc-2.39-5 28.7M 31.0M
/nix/store/c2yb135iv4maadia5f760b3xhbh6jh61-gcc-13.2.0-lib 8.7M 39.8M
/nix/store/l8ylz3d598vm310zy5bg5mkd77ahjxwf-libcublas-12.2.5.6-lib 604.1M 643.9M
/nix/store/8q4q9vl32hy63bmmdd2wc78zqn9wqc1x-libcublas-12.2.5.6-dev 549.9K 644.5M
Looking at result-lib
/nix/store/7n0mbqydcipkpbxm24fab066lxk68aqk-libunistring-1.1 1.7M 1.7M
/nix/store/a2fqd5k8ymb2cadb5awp5b90a5m8acln-gcc-13.2.0-libgcc 155.8K 155.8K
/nix/store/rxganm4ibf31qngal3j3psp20mak37yy-xgcc-13.2.0-libgcc 155.8K 155.8K
/nix/store/s32cldbh9pfzd9z82izi12mdlrw0yf8q-libidn2-2.3.7 352.7K 2.1M
/nix/store/ddwyrxif62r8n6xclvskjyy6szdhvj60-glibc-2.39-5 28.7M 31.0M
/nix/store/c2yb135iv4maadia5f760b3xhbh6jh61-gcc-13.2.0-lib 8.7M 39.8M
/nix/store/l8ylz3d598vm310zy5bg5mkd77ahjxwf-libcublas-12.2.5.6-lib 604.1M 643.9M
Looking at result-static
/nix/store/yynka8djck214kpjgwrvbnhw5ij46xsi-libcublas-12.2.5.6-static 889.8M 889.8M On $ nix build --impure -L .#cudaPackages.libcublas^*
$ for f in result*; do echo "Looking at $f"; nix path-info -rSsh "./$f"; done
Looking at result
/nix/store/a2fqd5k8ymb2cadb5awp5b90a5m8acln-gcc-13.2.0-libgcc 155.8K 155.8K
/nix/store/rxganm4ibf31qngal3j3psp20mak37yy-xgcc-13.2.0-libgcc 155.8K 155.8K
/nix/store/7n0mbqydcipkpbxm24fab066lxk68aqk-libunistring-1.1 1.7M 1.7M
/nix/store/s32cldbh9pfzd9z82izi12mdlrw0yf8q-libidn2-2.3.7 352.7K 2.1M
/nix/store/ddwyrxif62r8n6xclvskjyy6szdhvj60-glibc-2.39-5 28.7M 31.0M
/nix/store/c2yb135iv4maadia5f760b3xhbh6jh61-gcc-13.2.0-lib 8.7M 39.8M
/nix/store/gk7iybbaak978qr2kchzbzpg5alkkxza-libcublas-12.2.5.6-lib 604.1M 643.9M
/nix/store/9bq0574rddqfk8acd429m2p8ywc4fr03-libcublas-12.2.5.6-dev 549.9K 644.5M
/nix/store/fq4qmlz74j8l3yf56vby7j5121sjfhz2-libcublas-12.2.5.6-static 889.8M 889.8M
/nix/store/7d3lkvaqvjf3765zmvznmkkn5wrkjmdk-libcublas-12.2.5.6 499.2K 1.5G
Looking at result-dev
/nix/store/7n0mbqydcipkpbxm24fab066lxk68aqk-libunistring-1.1 1.7M 1.7M
/nix/store/a2fqd5k8ymb2cadb5awp5b90a5m8acln-gcc-13.2.0-libgcc 155.8K 155.8K
/nix/store/rxganm4ibf31qngal3j3psp20mak37yy-xgcc-13.2.0-libgcc 155.8K 155.8K
/nix/store/s32cldbh9pfzd9z82izi12mdlrw0yf8q-libidn2-2.3.7 352.7K 2.1M
/nix/store/ddwyrxif62r8n6xclvskjyy6szdhvj60-glibc-2.39-5 28.7M 31.0M
/nix/store/c2yb135iv4maadia5f760b3xhbh6jh61-gcc-13.2.0-lib 8.7M 39.8M
/nix/store/gk7iybbaak978qr2kchzbzpg5alkkxza-libcublas-12.2.5.6-lib 604.1M 643.9M
/nix/store/9bq0574rddqfk8acd429m2p8ywc4fr03-libcublas-12.2.5.6-dev 549.9K 644.5M
Looking at result-lib
/nix/store/7n0mbqydcipkpbxm24fab066lxk68aqk-libunistring-1.1 1.7M 1.7M
/nix/store/a2fqd5k8ymb2cadb5awp5b90a5m8acln-gcc-13.2.0-libgcc 155.8K 155.8K
/nix/store/rxganm4ibf31qngal3j3psp20mak37yy-xgcc-13.2.0-libgcc 155.8K 155.8K
/nix/store/s32cldbh9pfzd9z82izi12mdlrw0yf8q-libidn2-2.3.7 352.7K 2.1M
/nix/store/ddwyrxif62r8n6xclvskjyy6szdhvj60-glibc-2.39-5 28.7M 31.0M
/nix/store/c2yb135iv4maadia5f760b3xhbh6jh61-gcc-13.2.0-lib 8.7M 39.8M
/nix/store/gk7iybbaak978qr2kchzbzpg5alkkxza-libcublas-12.2.5.6-lib 604.1M 643.9M
Looking at result-static
/nix/store/fq4qmlz74j8l3yf56vby7j5121sjfhz2-libcublas-12.2.5.6-static 889.8M 889.8M It may be surprising that the |
@SomeoneSerge @samuela looks like I wasn't thorough enough: this change broke compilation of NCCL (and I suspect other downstream consumers which access components unqualified): https://gist.github.com/ConnorBaker/deda25fd1c2b89e76770a7f3a2eceb41 I don't fully understand what's happening here. Luckily, there aren't that many occurrences across Nixpkgs: [connorbaker@nixos-desktop:~/Packages/nixpkgs]$ rg "outputSpecified"
lib/customisation.nix
350: outputSpecified = true;
lib/tests/misc.nix
329: { dev.outPath = "/dev"; outPath = "/default"; outputSpecified = true; }
lib/attrsets.nix
1763: if ! pkg ? outputSpecified || ! pkg.outputSpecified
pkgs/build-support/buildenv/default.nix
64: (if (! drv ? outputSpecified || ! drv.outputSpecified)
pkgs/development/compilers/llvm/15/default.nix
94: # we need to reintroduce `outputSpecified` to get the expected behavior e.g. of lib.get*
pkgs/development/compilers/llvm/18/default.nix
90: # we need to reintroduce `outputSpecified` to get the expected behavior e.g. of lib.get*
pkgs/development/compilers/llvm/12/default.nix
65: # we need to reintroduce `outputSpecified` to get the expected behavior e.g. of lib.get*
pkgs/development/compilers/llvm/16/default.nix
95: # we need to reintroduce `outputSpecified` to get the expected behavior e.g. of lib.get*
pkgs/development/compilers/llvm/git/default.nix
95: # we need to reintroduce `outputSpecified` to get the expected behavior e.g. of lib.get*
pkgs/development/compilers/llvm/13/default.nix
91: # we need to reintroduce `outputSpecified` to get the expected behavior e.g. of lib.get*
pkgs/development/compilers/llvm/14/default.nix
88: # we need to reintroduce `outputSpecified` to get the expected behavior e.g. of lib.get*
pkgs/development/compilers/llvm/9/default.nix
62: # we need to reintroduce `outputSpecified` to get the expected behavior e.g. of lib.get*
70: llvm-polly = tools.libllvm-polly.lib // { outputSpecified = false; };
pkgs/development/compilers/llvm/17/default.nix
90: # we need to reintroduce `outputSpecified` to get the expected behavior e.g. of lib.get*
pkgs/development/cuda-modules/generic-builders/manifest.nix
324: # anything of the sort. To remedy this, we set outputSpecified to true, and use
327: outputSpecified = true;
347: # causes Nix to prefer that output over the others if outputSpecified isn't set).
pkgs/tools/typesetting/tex/texlive/default.nix
119: toTLPkgList = drv: if drv.outputSpecified or false
135: // { outputSpecified = true; tlOutputName = tlTypeToOut.${p.tlType}; };
140: builtins.removeAttrs mainDrv [ "outputSpecified" ];
pkgs/tools/typesetting/tex/texlive/build-texlive-package.nix
82: outputSpecified = true;
204:builtins.removeAttrs mainDrv [ "outputSpecified" ]
pkgs/tools/typesetting/tex/texlive/build-tex-env.nix
49: isOldPkgList = p: ! p.outputSpecified or false && p ? pkgs && builtins.all (p: p ? tlType) p.pkgs;
62: (p: p.outputSpecified or false -> builtins.elem (p.tlOutputName or p.outputName) [ "out" "tex" "tlpkg" ])
78: specified = builtins.partition (p: p.outputSpecified or false) all;
118: formatPkgs = lib.filter (p: p ? formats && (p.outputSpecified or false -> p.tlOutputName or p.outputName == "tex") && builtins.any (f: f.enabled or true) p.formats) all;
183: (p: p.pname + (lib.optionalString (p.outputSpecified or false) " (${p.tlOutputName or p.outputName})"))
pkgs/tools/typesetting/tex/texlive/combine-wrapper.nix
32: toSpecified = { tlType, ... }@drv: drv // { outputSpecified = true; tlOutputName = tlTypeToOut.${tlType}; }; My gut tells me it's got to be one of these:
|
@ConnorBaker I just found |
Damn. The lock file seems wrong 🙈, I loaded it in the repl and I can still see the |
Something - maybe mkDerivation, maybe the splicing mechanism - replaces This is the same as removing |
Correct -- that's the exact reason that I had to specify that flag as false. |
There's a reference nixpkgs/pkgs/development/cuda-modules/generic-builders/manifest.nix Lines 82 to 90 in 97d675f
|
Not yet sure what the consequences are going to be, testing will show.
Description of changes
Currently,
cudaPackages
'manifest.nix
breakslib.getOutput
. Specifically the following lines resolve into the same store path ("$out"
) repeated thrice (as discovered by @ConnorBaker):nixpkgs/pkgs/development/cuda-modules/saxpy/default.nix
Lines 40 to 42 in f6ed1c3
The change must've slipped through during the "cuda-modules"/jetson support refactoring.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.