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

Store path quirks #11555

Open
5 tasks
roberth opened this issue Sep 20, 2024 · 1 comment
Open
5 tasks

Store path quirks #11555

roberth opened this issue Sep 20, 2024 · 1 comment
Labels
feature Feature request or proposal localization Nix should work well in every place portability Supporting more platforms store Issues and pull requests concerning the Nix store

Comments

@roberth
Copy link
Member

roberth commented Sep 20, 2024

Is your feature request related to a problem? Please describe.

This is a tracking issue for improving file system support in Nix. This should happen at its own pace. If you're a happy Linux user, please ignore. The purpose of this issue is to start the conversation among those interested.

Context: File systems can have various limitations; some are case insensitive and can not store two nodes that differ only by case. Others may have file name length limits, and Windows is known to reject certain file names characters, and names such as CON. Another is unicode normalization (much like case insensitivity) or a requirement for paths to be valid unicode.

Nix can employ workarounds to allow any NAR to be stored on such file systems without loss of information, but at the cost of build impurities. This allows certain builds that are tolerant of quirks to pass, and it allows any store to be used reliably as a vehicle for nix copy; for instance to reliably perform deployments to systems, including ones whose store does not have the quirk.

Currently, users have little awareness of this and little control over it.

Describe the solution you'd like

Let's define a store path quirk to be a derived property of a store path, that tells us which file system quirks will make it impossible to represent the NAR natively without transformation un such a file system.

  • Have a page in the manual about the known quirks
  • Display store path quirks in nix path-info
  • Display file system quirks in nix store info
  • New advanced derivation attributes to
    • check outputs against specific quirks
    • only allow a derivation to run on a system where the store and/or build directory lack certain quirks
    • perhaps: require inputs or input closures to not have certain quirks
  • As an implementation detail / optimization, save the quirks in the store db and narinfo

Why do this in Nix?

  1. The complexity of working around an unsolvable problem should not be hidden - basically the definition of a leaky abstraction. Exposing this complexity to users makes them aware and helps them solve their problems.
  2. Once quirk hacks have been applied, a builder can not see reliably that a quirk hack has been applied, as artifacts of the quirk hack may be false positives
  3. Nix always processes the tree anyway; may as well derive and store this info, as it's cheap

Describe alternatives you've considered

I think this is a decent sketch, but surely things can be improved.

Additional context

Priorities

Add 👍 to issues you find important.

@roberth roberth added feature Feature request or proposal store Issues and pull requests concerning the Nix store portability Supporting more platforms labels Sep 20, 2024
@roberth
Copy link
Member Author

roberth commented Sep 30, 2024

Quirks can also affect directories in the build sandbox, causing build impurities and failures such as #11595

@roberth roberth added the localization Nix should work well in every place label Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature request or proposal localization Nix should work well in every place portability Supporting more platforms store Issues and pull requests concerning the Nix store
Projects
None yet
Development

No branches or pull requests

1 participant