Skip to content
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

nixos/systemd.tmpfiles.packages: fix an edge case #95565

Merged
merged 1 commit into from Aug 16, 2020

Conversation

vcunat
Copy link
Member

@vcunat vcunat commented Aug 16, 2020

symlinkJoin can break (silently) when the passed paths contain symlinks
to directories. This should work now.

Down-side: when lib/tmpfiles.d doesn't exist for some passed package,
the error message is a little less explicit, because we never get
to the postBuild phase (and symlinkJoin doesn't provide a better way):
/nix/store/HASH-NAME/lib/tmpfiles.d: No such file or directory

Also, it seemed pointless to create symlinks for whole package trees
and using only a part of the result (usually very small part).

Motivation for this change

Real-life breakage example: #95222 (comment)

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Reviews requested from systemd.meta.maintainers.

symlinkJoin can break (silently) when the passed paths contain symlinks
to directories.  This should work now.

Down-side: when lib/tmpfiles.d doesn't exist for some passed package,
the error message is a little less explicit, because we never get
to the postBuild phase (and symlinkJoin doesn't provide a better way):
/nix/store/HASH-NAME/lib/tmpfiles.d: No such file or directory

Also, it seemed pointless to create symlinks for whole package trees
and using only a part of the result (usually very small part).
@vcunat
Copy link
Member Author

vcunat commented Aug 16, 2020

Maybe it's also worth adding extra checking code into symlinkJoin to hard-fail in case some of the paths contain a symlink that expands to a directory, as that problem seems difficult to anticipate in some cases.

@flokli
Copy link
Contributor

flokli commented Aug 16, 2020

This seems useful. We should probably still add more checking code to symlinkJoin, but this PR adding a comment is a good start.

@flokli flokli merged commit b3909d1 into NixOS:master Aug 16, 2020
@flokli flokli mentioned this pull request Aug 16, 2020
10 tasks
@vcunat vcunat deleted the p/symlinkJoin branch August 16, 2020 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants