types: remove Path* typedefs#15354
Merged
Ericson2314 merged 1 commit intoNixOS:masterfrom Feb 27, 2026
Merged
Conversation
0a1be0d to
f10346c
Compare
Ericson2314
reviewed
Feb 26, 2026
Ericson2314
reviewed
Feb 26, 2026
Ericson2314
reviewed
Feb 26, 2026
Ericson2314
reviewed
Feb 26, 2026
Ericson2314
reviewed
Feb 26, 2026
Ericson2314
reviewed
Feb 26, 2026
Ericson2314
reviewed
Feb 26, 2026
Ericson2314
reviewed
Feb 26, 2026
Ericson2314
reviewed
Feb 26, 2026
Ericson2314
reviewed
Feb 26, 2026
Ericson2314
reviewed
Feb 26, 2026
Ericson2314
reviewed
Feb 26, 2026
Ericson2314
reviewed
Feb 26, 2026
Ericson2314
reviewed
Feb 26, 2026
Ericson2314
reviewed
Feb 26, 2026
Ericson2314
reviewed
Feb 26, 2026
Ericson2314
reviewed
Feb 26, 2026
Ericson2314
reviewed
Feb 26, 2026
Ericson2314
reviewed
Feb 26, 2026
Ericson2314
reviewed
Feb 26, 2026
Ericson2314
reviewed
Feb 26, 2026
Ericson2314
reviewed
Feb 26, 2026
f10346c to
3f45105
Compare
Ericson2314
reviewed
Feb 26, 2026
Ericson2314
reviewed
Feb 26, 2026
de4aa1b to
7a4bd97
Compare
Merged
cabbcd8 to
a044829
Compare
Ericson2314
reviewed
Feb 27, 2026
Ericson2314
reviewed
Feb 27, 2026
Ericson2314
reviewed
Feb 27, 2026
Ericson2314
reviewed
Feb 27, 2026
Ericson2314
reviewed
Feb 27, 2026
Ericson2314
reviewed
Feb 27, 2026
a044829 to
4a8451b
Compare
This commit replaces all usages with their underlying types, that being `std::string` for store paths, `std::filesystem::path` for filesystem paths, `StringSet` for path sets, and `std::string_view` for non-owning references.
4a8451b to
fc08c86
Compare
Ericson2314
approved these changes
Feb 27, 2026
xokdvium
reviewed
Feb 27, 2026
Comment on lines
+225
to
+230
| struct AbsolutePath : std::filesystem::path | ||
| { | ||
| using path::path; | ||
| using path::operator=; | ||
|
|
||
| AbsolutePath(const std::filesystem::path & p) |
Contributor
There was a problem hiding this comment.
We should be careful to avoid slicing here. Maybe a better pattern would be private inheritance and using all necessary methods?
Member
There was a problem hiding this comment.
It could just be a wrapper type with a single std::filesystem::path field. That is easy to reason about for any C++ noobs :).
xokdvium
reviewed
Feb 27, 2026
| return bd.has_value() ? *bd | ||
| : buildDir.get().has_value() ? *buildDir.get() | ||
| : std::filesystem::path{stateDir.get()} / "builds"; | ||
| : AbsolutePath{stateDir.get() / "builds"}; |
Contributor
There was a problem hiding this comment.
This does slicing, not good
Member
There was a problem hiding this comment.
Wrapper type would instead have it take ownership, seems good.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
We want to get rid of the unnecessary Path* typedefs. This commit replaces all usages with their underlying types, that being
std::stringfor store paths,std::filesystem::pathfor filesystem paths,StringSet for path sets, andstd::string_view` for non-owning references.Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.