Refactor path handling. Prefer absolute paths wherever possible. #35
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.
Today paths are handled in a haphazard way, somewhat as a holdover from QuickBuild combined with the logic used to make paths portable.
Previously a "normalized" path was either repo-relative, or had placeholders, depending on context. Also, most paths were repo-relative, which is causing problems now that we're trying to do more with other paths outside the repo, like paths in the NuGet package cache.
This change rationalizes things by defining the following wrt paths:
Additionally, BXL's
AbsolutePath
adds a long path prefix (\\?\
) to long paths automatically, which messes with some of our string manipulation. For ease of use, I've avoided all usage ofAbsolutePath
except just before talking to the BXL APIs which require them. The alternative would be to useAbsolutePath
literally everywhere and add some helpers to their code for things like making relative paths, but I feel like tying so strongly to BXL's concept of paths isn't a great idea, especially since this project generically (barring specific impls) should not really be strongly tied to BXL's cache code at all. It is today unfortunately due to the local cache, but one day I hope to break that.