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

Distinguish between HPATH, SPATH and plain PATH #166

Open
sternenseemann opened this issue Nov 3, 2024 · 0 comments
Open

Distinguish between HPATH, SPATH and plain PATH #166

sternenseemann opened this issue Nov 3, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@sternenseemann
Copy link

Description

Paths are currently just parsed into parts of strings and identifiers (in case of interpolation). Nix has three distinct types of paths that need to be treated differently (at least they are in evaluation):

  • Regular paths may be subject to path interpolation. They also need may need to be resolved to absolute paths. We could be very precise and distinguish between absolute and relative paths (Upstream C++ Nix doesn't), but probably path libraries are in general well equipped to correctly to consume both relative and absolute paths and ensure that they are absolute…
  • Home relative paths may be subject to path interpolation. They need to be resolved relative to the current user's home directory.
  • NIX_PATH expressions (SPATH tokens) need to be resolved based on the configured nix search path (usually via the NIX_PATH environment variable). They are not subject to path interpolation.

It would be great if they were distinct on the type level. Currently, you need to parse what rnix gives you again to figure out what kind of path you are dealing with.

@sternenseemann sternenseemann added the enhancement New feature or request label Nov 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant