Repository navigation
Conversation
|
@rasendubi, thanks for your PR! By analyzing the annotation information on this pull request, we identified @edolstra, @aszlig and @abbradar to be potential reviewers |
This patch fixes NixOS#16614 and NixOS#16741. The first issue was caused by the fact that both `/share` and `/share/fish/vendor_completions.d` end in the `pathsToLink`. The `pkgs/build-support/buildenv/builder.pl` creates `/share`, then links `/share/fish` under `/share` and then tries to create the directory `/share/fish/vendor_completions.d` and fails because it already exists. The simplest way to reproduce the issue is to build the next Nix expression: ```nix let pkgs = import <nixpkgs> { }; in pkgs.buildEnv { name = "buildenv-issue"; paths = [ pkgs.fish pkgs.vim ]; pathsToLink = [ "/share" "/share/fish/vendor_completions.d" ]; } ``` The second issue is more critical and was caused by the fact findFiles doesn't recurse deep enough. It stops at first unique directory for the package (e.g., "/share" or even "/") and later the scripts decides it shouldn't link it as it doesn't match pathsToLink (e.g., "/share/fish"), so the result is empty. The test: ```nix let pkgs = import <nixpkgs> { }; in pkgs.buildEnv { name = "buildenv-issue"; paths = [ pkgs.fish pkgs.vim ]; pathsToLink = [ "/share/fish/functions" ]; } ``` or ```nix let pkgs = import <nixpkgs> { }; in pkgs.buildEnv { name = "buildenv-issue"; paths = [ pkgs.vim ]; pathsToLink = [ "/share" ]; } ```
c8cd0ac to
8943249
Compare
|
Awesome! |
|
I have tested this on current staging -- it results in a working system with no regression visible. I think we can merge this, but I'm not sure whether we want it in the current pack of staging patches or should wait till the next. cc @vcunat as one who'll most likely start staging evaluation and looked through recent patches. |
|
Thanks for fixing the bug after discovering it, and even going way further. I must admit, my motivation to do it myself was rather low, so thank you sir! |
|
@abbradar: you can merge immediately, if you feel confident it's OK. I can't get staging to re-evaluate now anyway, probably due to out-of-disk problem. |
|
Closed by 0172558 |
Things done
(nix.useChroot on NixOS,
or option
build-use-chrootinnix.confon non-NixOS)
nix-shell -p nox --run "nox-review wip"./result/bin/)This patch fixes #16614 and #16741.
The first issue was caused by the fact that both
/shareand/share/fish/vendor_completions.dend in thepathsToLink. Thepkgs/build-support/buildenv/builder.plcreates/share, then links/share/fishunder/shareand then tries to create the directory/share/fish/vendor_completions.dand fails because it already exists.The simplest way to reproduce the issue is to build the next Nix
expression:
The second issue is more critical and was caused by the fact findFiles
doesn't recurse deep enough. It stops at first unique directory for the
package (e.g., "/share" or even "/") and later the scripts decides it
shouldn't link it as it doesn't match pathsToLink (e.g., "/share/fish"),
so the result is empty.
The test:
or