stdenv: add no-broken-symlinks hook#370750
Conversation
K900
left a comment
There was a problem hiding this comment.
Conceptually LGTM, bash looks roughly OK and I don't trust myself to comment any further than that. Has anyone tried running the data on the number of broken symlinks in the current Hydra outputs?
|
As with @K900, this looks good to me in theory and I support the idea that a dangling or reflexive symlink is more often than not a bug. I'd love a test. Could you write a few using
|
865fa50 to
7aedd5a
Compare
|
The PR's base branch is set to staging, but 4 commits from the master branch are included. Make sure you know the right base branch for your changes, then:
|
7aedd5a to
229fdf0
Compare
|
Added docs and tests, force-pushed and rebased! @K900 and @philiptaron would you mind taking another look? |
|
I couldn't find an issue logged for cudaPackaes.tensorrt - I can try to create one if needed. |
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
|
I think it is not great that a cosmetic improvement breaks previously working derivations, without any automation for dealing with it. |
|
Where is the documentation for this feature? I don't think something like this should be merged without docs. |
https://nixos.org/manual/nixpkgs/unstable/#no-broken-symlinks.sh
That is true but was already done. |
|
Oops, I should have checked the PR's changes. Unfortunately the manual failed me here. If I encounter an error like |
Resolve build issues with Kaldi due to OpenFST dependency on GCC14 When compiling OpenFST (a Kaldi dependency) with GCC13, numerous warnings occur, such as: `warning: expected 'template' keyword before dependent template name`. However, with GCC14, these warnings escalate to errors, causing the build to fail. Consequently, the Kaldi package is no longer building with versions >25.05, as the standard environment (stdenv) now relies on GCC14. Building with gcc13Stdenv however still fails with: ``` > ERROR: noBrokenSymlinks: found 40 dangling symlinks, 0 reflexive symlinks and 0 unreadable symlinks ``` Looks like this is related to NixOS#370750 Setting `dontCheckForBrokenSymlinks = true;` can prevent it from happening.
Adds a setup hook which checks for broken symlinks; a symlink is considered broken if it's dangling (target doesn't exist) or reflexive (it refers to itself).
In my experience, outputs with broken symlinks are generally errors, and so we should provide a hook which can catch and report them.
The hook can be disabled by setting
dontCheckForBrokenSymlinks.Future work
Fixup PRs:
bluez: set dontCheckForBrokenSymlinks #376210(superseded by no-broken-symlinks: restrict checks to symlinks pointing inside the store #376261)systemd: set dontCheckForBrokenSymlinks #376218(superseded by no-broken-symlinks: restrict checks to symlinks pointing inside the store #376261)Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-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.