-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
cc-wrapper: relocate proprietary-compiler-specific material #282220
Conversation
This commit deletes speculative comments which were self-merged with no approvals in PR #275947. If you think that "The above 'fix' may be incorrect" the correct response is to submit a PR which removes the 'fix' and get it reviewed. Likewise, if you think that "For clang it's not necessary" you should submit a PR which wraps it in `if !isClang`. `cc-wrapper` is full of too much junk as it is, let's not make things worse.
PR #275947, which was self-merged without approvals, inserted functionality specific to a propriteary closed-source compiler (CUDA) into cc-wrapper. This commit relocates this CUDA-specific functionality into the appropritate place: `cuda-modules`. It is unclear to me exactly what this function is supposed to be doing; much of it (like the `.kind` attributes) do not appear to be used *anywhere* in nixpkgs. Making sure we don't insert unexplained deadcode like this is one of the important functions of the review process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Adam,
Well this is wonderful. It had escaped my attention that the current implementation of stdenvAdapters.useLibsFrom
passing the unwrapped cc.cc
in gccForLibs
means there's nothing on the way to inspect the old wrapper's cxxStdlib
and whether it was libc++. This means that the "adapter" is now only functional when gccForLibs
is populated from a gcc+libstdc++ stdenv, not from a libc++ one.
Note that there also remains one more cc-wrapper composability issue regarding the propagation of e.g. coreutils
when creating new wrappers, as mentioned in #281750 (comment).
Note that this functionality, still half-broken as we've established above, is not in any way specific to any "proprietary compilers", it's specific to the general software that expects older toolchains, e.g. the non-proprietary tensorflow:
nixpkgs/pkgs/top-level/python-packages.nix
Line 14190 in 8b397b2
stdenv = pkgs.stdenvAdapters.useLibsFrom stdenv pkgs.gcc12Stdenv; |
This is especially relevant during the post-staging phases (i.e. now) when we get lots of failures from gcc major version updates, including in packages with many reverse dependencies.
A review would have helped a ton in getting things right early, fixing the obvious mistakes, and in pruning the garbage. The PR was open for three weeks for people to object or demand changes. I had notified people adjacent to the cc-wrapper, e.g. rrbutani, whose one year-old patchwork I based the PR off, and Daniel. I had asked for advice on discourse and later in the "Nix/NixOS Contributions" and the "Stdenv" matrix channels. Nobody came up with any suggestions at the time (save for the idea to move the bulk of the logic out into a new "stdenv adapter"), and nobody thought e.g. to redirect me to you. I get that, I do not expect people to be available 365 days in the year. I also don't expect people never to "touch" the parts that I maintain in Nixpkgs unless I intervene in a timely manner.
If you're still convinced I made the wrong call, please feel free to bring this up in any of the public channels suitable for policy discussions. Pushing dramatic commit messages straight into master doesn't really help with anything.
I would really much prefer if you would speak directly to me and react to my messages (#281750 and #275947 (comment)). I'm very glad to see #282221 open. Thanks for bringing it to my attention too, I consider an advancement in this conversation.
I'm interested in having a clean and composable cc-wrapper (or any alternative way to configure toolchains). Whatever we had encountered back in #223664 #225493 #220341 (comment) wasn't clean enough for me to be able to infer any context or build a notion of the public interface. This lead up to us relying on the correct libstdc++ being picked up by the compiler pretty much accidentally (#225661 (comment)) for several months. I get the impression that you must be one deeply invested in the wrapper and set on refactoring it, and that's great: I want to collaborate with somebody with this background. I hope that this message will be the only one where I resort to instigating drama, and that the further exchange will be technical, because I don't want to waste your time or mine.
Cheers
@@ -112,7 +112,7 @@ attrsets.filterAttrs (attr: _: (builtins.hasAttr attr prev)) { | |||
useCcForLibs = true; | |||
gccForLibs = ccForLibs-wrapper.cc; | |||
}; | |||
cxxStdlibDir = ccForLibs-wrapper.cxxStdlib.solib; | |||
cxxStdlibDir = ccForLibs-wrapper.cxxStdlib.solib or (throw "necessary to fix CI"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please elaborate, which CI you're referring to? The PR had passed the Ofborg checks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This branch is now reachable in the default (save for allowUnfree) instantiation of Nixpkgs and breaks the eval:
❯ NIXPKGS_ALLOW_UNFREE=1 nix-instantiate '.' -A tests.cuda
...
error: necessary to fix CI
Unbreaks evaluation after the refactoring in 86c28ee (NixOS#282220). Explicitly extending nvcc's LIBRARIES may have been redundant (building something mildly cursed like jaxlib may be necessary to verify) Previously: ``` ❯ NIXPKGS_ALLOW_UNFREE=1 nix-instantiate '.' -A tests.cuda ... error: necessary to fix CI ❯ nix build -f '.' --arg config '{ allowUnfree = true; }' -L python3Packages.torchWithCuda ... error: necessary to fix CI ``` Now: ``` ❯ NIXPKGS_ALLOW_UNFREE=1 nix-instantiate '.' -A tests.cuda /nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-cuda-samples-12.2.drv /nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-saxpy-unstable-2023-07-11.drv ... ```
@amjoseph-nixpkgs You need to tone done your commit messages and start communicating with others, continued collaboration really isn't going to work any other way. In your commit messages, please stick to the technical details, and stop the finger pointing already. It doesn't make for a healthy community. Now I understand that cc-wrapper is a crucial part of nixpkgs that, for which incoming changes need proper review, but no such thing happened on the other PR for close to a month. I don't think people should strictly "own" some code in nixpkgs, when they can't guarantee that review decisions are made in a timely fashion. This would ultimately block progress and prevent onboarding of new people to that section of the code. And finally In self-merging this change, you made the perfect case for why review is necessary. Adam, the way you communicate here needs to change now! // This message was written in my role as a member of the moderation team |
Moreover, to note that you also self merged and self reviewed #282210 as well. If you are going to criticize someone for self reviewing and self merging, I would hope you don't do the thing you're criticizing others for yourself as well, The process applies to everyone after all. |
Yes, because these two PRs are corrections for unapproved self-merges. I believe the corrective PR should be held to the same standard as the PR it corrects. |
Unbreaks evaluation after the refactoring in 86c28ee (NixOS#282220). Explicitly extending nvcc's LIBRARIES may have been redundant (building something mildly cursed like jaxlib may be necessary to verify) Previously: ``` ❯ NIXPKGS_ALLOW_UNFREE=1 nix-instantiate '.' -A tests.cuda ... error: necessary to fix CI ❯ nix build -f '.' --arg config '{ allowUnfree = true; }' -L python3Packages.torchWithCuda ... error: necessary to fix CI ``` Now: ``` ❯ NIXPKGS_ALLOW_UNFREE=1 nix-instantiate '.' -A tests.cuda /nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-cuda-samples-12.2.drv /nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-saxpy-unstable-2023-07-11.drv ... ```
Thank you for writing this, @mweinelt. I appreciate it, more than anything else that's been said in this discussion. I will change.
I absolutely agree and have said so many, many times. |
Description of changes
PR #275947, which was self-merged without any approvals, inserted functionality specific to a propriteary closed-source compiler (CUDA) into cc-wrapper.
This commit relocates this CUDA-specific functionality into the appropritate place:
cuda-modules
. Parts had to be disabled in order to make CI pass.The moved functionality may require this PR in order to reenable it: