-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Get rid of CanonPath::fromCwd
#9948
Conversation
@@ -29,6 +29,6 @@ private: | |||
std::map<std::string, std::string> autoArgs; | |||
}; | |||
|
|||
SourcePath lookupFileArg(EvalState & state, std::string_view s, CanonPath baseDir = CanonPath::fromCwd()); | |||
SourcePath lookupFileArg(EvalState & state, std::string_view s, const Path * baseDir = nullptr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SourcePath lookupFileArg(EvalState & state, std::string_view s, const Path * baseDir = nullptr); | |
SourcePath lookupFileArg(EvalState & state, std::string_view s, std::optional<Path> baseDir = std::nullopt); |
seem cleaner, then we don't have to take addresses etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just did it that way because we didn't need a copy of a the base dir string, just a reference to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also recall that std::optional<const Path &>
doesn't work because C++ is silly.
31865c3
to
ff2315e
Compare
As discussed in the last Nix team meeting (2024-02-95), this method doesn't belong because `CanonPath` is a virtual/ideal absolute path format, not used in file systems beyond the native OS format for which a "current working directory" is defined. Progress towards NixOS#9205
ff2315e
to
4687bee
Compare
Motivation
As discussed in the last Nix team meeting (2024-02-95), this method doesn't belong because
CanonPath
is a virtual/ideal absolute path format, not used in file systems beyond the native OS format for which a "current working directory" is defined.Context
Progress towards #9205
Priorities and Process
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.