-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
stdenv: add no-broken-symlinks hook #370750
stdenv: add no-broken-symlinks hook #370750
Conversation
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.
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? |
LGTM, should we get this a Hydra jobset, or do we just send it to staging? CC @vcunat. |
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.
Requesting change for the tests of relative symlinks, especially the error case due to interpolation.
The rest of the suggestions and thoughts are not blocking.
With regard to merge target, I favor staging rather than the work of setting up a special Hydra jobset, just on the grounds that we think these are generally bugs. If we get a swath of brokenness, we can revert this and we'll be fine, as I see it.
…against absolute symlinks
Quick tip for testing:
|
All feedback addressed! @philiptaron if you're happy, please feel free to merge :) |
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.
Looks good, let's see how it tastes in staging. (All tests.stdenv
pass.)
Not even darwin stdenv passes: |
@vcunat any recommendations for where fixes should go? That is, should I add them to this branch and open new PRs, or have separate branches/PRs for fixes? Additionally, any way to test such changes on Darwin? I have a MacBook Pro laptop, but its beyond its capacity to rebuild staging. |
Just create new PRs against staging, and ideally post them in the staging room on Matrix so they can get merged quickly. |
I'd think that a MacBook Pro would be able to build stdenv from scratch. It would just take some time. Hydra runs just on Mac Minis after all. But I or OfBorg or others could run some builds, too, once there's a commit. |
Bisect says aa1405b
|
|
@ConnorBaker, is it backout time or fast-fix time? I'm at work today and can't participate in the fix-fest. |
I'd say it's fast-fix time! @jmbaur has a patch for systemd he's testing right now (one of their Meson build files was missing a conditional guard) and I'm free to fix things right now. @philiptaron in the interest of unbreaking stuff, would it be reasonable to create PRs with fixes or disable the hook and issues for followup so the additions don't get lost (because we consider breakage under the hook to be caused by bugs)? |
There is no rush for this staging cycle. Let's just take our time. We will have to eat this elephant eventually anyway. |
@vcunat the failure in clang-wrapper you posted here #376043 (comment) is similar to the failure posted here #370750 (comment); I'm going to make a PR to disable it for the wrapper to triage. |
|
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 = 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.