-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
No short path literals #13374
Copy link
Copy link
Closed
Labels
featureFeature request or proposalFeature request or proposalgood first issueQuick win for first-time contributorsQuick win for first-time contributorsidea approvedThe given proposal has been discussed and approved by the Nix team. An implementation is welcome.The given proposal has been discussed and approved by the Nix team. An implementation is welcome.languageThe Nix expression language; parser, interpreter, primops, evaluation, etcThe Nix expression language; parser, interpreter, primops, evaluation, etc
Metadata
Metadata
Assignees
Labels
featureFeature request or proposalFeature request or proposalgood first issueQuick win for first-time contributorsQuick win for first-time contributorsidea approvedThe given proposal has been discussed and approved by the Nix team. An implementation is welcome.The given proposal has been discussed and approved by the Nix team. An implementation is welcome.languageThe Nix expression language; parser, interpreter, primops, evaluation, etcThe Nix expression language; parser, interpreter, primops, evaluation, etc
Fields
Give feedbackNo fields configured for issues without a type.
TLDR
In expressions,
foo/barbad,./foo/bargoodIs your feature request related to a problem?
Most path literal expressions start with
./in practice. (if not../)This is a good practice because it makes it clear from the start what's the role of the text that follows.
In fact the use of path literal expressions like
foo/bar.nixis sufficiently rare that experienced Nixers are unaware of this possibility (NixOS/nixpkgs#413892)Perhaps the time has come to take this convention.
Proposed solution
.I'd stop there, so that we can keep evaluating old expressions without significant intervention.
Opting out of an error may be hard when multiple hosts are involved in a deployment process that involves evaluation.
Alternative solutions
Linting. This is far less effective. We want everyone to stop using this syntax, not just those who have the knowledge and headspace for it, and we want good coverage; not just the projects that have integrated tooling.
Additional context
Similar to
no-absolute-path-literalsexperimental feature #8738A language redesign could parse
./foo/baras syntax sugar for${.}/foo/baror(.)/fooor something. We can't do that because we want to stay compatible, and that involves parsing things likefoo/bardirectly as a path literal anyway.Checklist
Add 👍 to issues you find important.