You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unify doctor checks and code that locates binary artifacts (executables, sdks) #9134
A lot of the tool presence/version checks we perform in flutter doctor would be useful to perform before steps that involve invocation of those tools.
Examples from the iOS side include checking Xcode and CocoaPods presence/version and presence of the Python six module before iOS build/run.
One option would be to factor out a tool class that has the ability to check presence/version of the tool and how to run it, then use this in the build step and in doctor.
@cbracken I strongly support this. I have started a sketch of ArtifactLocator. In addition to providing the kind of structure you are getting at, a locator will also keep an exhaustive history of how and where flutter_tools searched for the tool (this is mostly useful for diagnostics and debugging). WDYT?
/// Each artifact used by flutter_tools will have an ArtifactLocator class which can find the artifact's path and version.abstractclassArtifactLocator {
// For a given artifact (e.g. Android SDK), the list of locations.List<ArtifactLocation> locations;
// The preferred version (highest version or based on some other policy)ArtifactLocation preferred;
// The list of locations searched.List<ArtifactLocatorCheck> checks;
// Locates tool. Reports location if artifact was successfully located. Future<ArtifactLocation> locate([Version minimumVersion]);
}
/// The version and location of an artifact.classArtifactLocation {
finalVersion version;
finalUri location;
}
/// Used for diagnostics. classArtifactLocatorCheck {
// Location checked.finalUri location;
// Version found or null (if nothing was present).finalVersion version;
// A message. e.g. [Checked $JAVA_HOME environment variable].finalString message;
}
I'm dropping the 'doctor' label because this issue goes far beyond the 'doctor' and will actually affect all sub-tool finding / launching in flutter_tools.
changed the title [-]Refactor flutter doctor checks to be reusable elsewhere[/-][+]Unify doctor checks and code that locates binary artifacts (executables, sdks)[/+]on Apr 17, 2017
Closing as non-specific, some of this was done over the years, if there are particular places we should consolidate or refactor further, let's file specific issues.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
cbracken commentedon Mar 31, 2017
/cc @johnmccutchan
johnmccutchan commentedon Apr 2, 2017
@cbracken I strongly support this. I have started a sketch of
ArtifactLocator. In addition to providing the kind of structure you are getting at, a locator will also keep an exhaustive history of how and where flutter_tools searched for the tool (this is mostly useful for diagnostics and debugging). WDYT?cbracken commentedon Apr 10, 2017
SGTM - I like it. Extending this to all artifacts allows us to use it for local vs shipping engine etc.
johnmccutchan commentedon Apr 17, 2017
I'm dropping the 'doctor' label because this issue goes far beyond the 'doctor' and will actually affect all sub-tool finding / launching in flutter_tools.
[-]Refactor flutter doctor checks to be reusable elsewhere[/-][+]Unify doctor checks and code that locates binary artifacts (executables, sdks)[/+]4abf1d8 Revert "Revert "Use track-widget-creation transformer include…
4abf1d8 Revert "Revert "Use track-widget-creation transformer include…
4abf1d8 Revert "Revert "Use track-widget-creation transformer include…
4abf1d8 Revert "Revert "Use track-widget-creation transformer include…
4abf1d8 Revert "Revert "Use track-widget-creation transformer include…
4abf1d8 Revert "Revert "Use track-widget-creation transformer include…
4abf1d8 Revert "Revert "Use track-widget-creation transformer include…
4abf1d8 Revert "Revert "Use track-widget-creation transformer include…
matanlurey commentedon Jun 27, 2025
Closing as non-specific, some of this was done over the years, if there are particular places we should consolidate or refactor further, let's file specific issues.
github-actions commentedon Jul 11, 2025
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.