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

fileSystems: strip trailing slash of mountPoints #95308

Closed
wants to merge 1 commit into from

Conversation

Atemu
Copy link
Member

@Atemu Atemu commented Aug 13, 2020

Motivation for this change

Fixes #78951

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Copy link
Member

@aanderse aanderse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a simple change that looks fine to me... but I'm going to defer to someone who might know better if there are any implications to this change.

👍

@Mic92
Copy link
Member

Mic92 commented Aug 14, 2020

What do you think about this solution: #95406
This avoids duplicate mountpoints and improves validation.

@Atemu
Copy link
Member Author

Atemu commented Aug 14, 2020

Hm, I'd prefer if trivial things like these were just corrected automatically.

Preventing duplicates would be a desirable property though.

Would it perhaps be possible to strip the slash earlier, during the merge? I'm not too familiar how these submodules with custom names work and how they're merged unfortunately.

@Mic92
Copy link
Member

Mic92 commented Aug 14, 2020

I think there is an apply attribute that can be set will pre process values before doing a merge.

@Atemu Atemu force-pushed the filesystems-strip-trailing-slash branch from 7c88420 to a3394ac Compare December 16, 2020 08:11
@Atemu
Copy link
Member Author

Atemu commented Dec 16, 2020

There is indeed and it's a cleaner solution to the problem.

I could not figure out how to make it work with submodule names though, so duplicates are still possible. The purpose of this PR isn't to sanitise bad user configs but rather work around a bug in our handling of essential mountPoints, so that's fine.

@Atemu Atemu force-pushed the filesystems-strip-trailing-slash branch from 61f8a30 to 12d0004 Compare December 16, 2020 08:21
@Atemu Atemu force-pushed the filesystems-strip-trailing-slash branch from 12d0004 to 86f71da Compare December 16, 2020 08:21
Mic92 added a commit to Mic92/nixpkgs that referenced this pull request Jan 25, 2021
They are semantically the same as the non-slash version and therefore
are potential source of duplicates.

Also fixes NixOS#78951

Alternative to NixOS#95308
@stale
Copy link

stale bot commented Jun 16, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 16, 2021
@Artturin
Copy link
Member

since #95406 is merged i assume this can be closed

@Artturin Artturin closed this Oct 15, 2021
@Atemu Atemu deleted the filesystems-strip-trailing-slash branch November 26, 2023 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mounting the nix store on /nix/ fails but /nix works
4 participants