Use a builder object to inquire, validate, and register a custom toolchain #839
+157
−60
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.
Previously, inquiring and validating a custom toolchain was coupled to registration, which made it difficult to simply look at the custom toolchain independent of registering it.
This change implements
ToolchainBuilder
, a builder object that finds, validates, and registers a custom toolchain. Each step can be performed independently, with the caveat that registration depends on validation which depends on finding the custom toolchain.Use cases include:
This change also cleans up some of the platform-specific symlink code by implementing a trait,
SymlinkOrFallback
, which different platforms can adopt.This change does not add or remove any existing functionality (except for maybe introducing opportunities for non-Unix-like or Windows platforms to register a custom toolchain).
Discussion at #607