Parse engine src path from an absolute --local-engine#78496
Merged
jmagman merged 2 commits intoflutter:masterfrom Mar 18, 2021
Merged
Parse engine src path from an absolute --local-engine#78496jmagman merged 2 commits intoflutter:masterfrom
jmagman merged 2 commits intoflutter:masterfrom
Conversation
jmagman
commented
Mar 18, 2021
| return null; | ||
| } | ||
|
|
||
| Future<String> _findEngineSourceBySkyEngine(String packagePath) async { |
Member
Author
There was a problem hiding this comment.
This method was extracted from findEnginePath to make that method more readable, but has not been changed.
| return null; | ||
| } | ||
|
|
||
| String _findEngineSourceByLocalEngine(String localEngine) { |
| _logger.printTrace('Could not find engine source for $localEngine, skipping'); | ||
| } | ||
| if (localEngine != null) { | ||
| throwToolExit( |
Member
Author
There was a problem hiding this comment.
Now throw instead of silently fail if --local-engine is set but the engineSourcePath can't be found.
yjbanov
approved these changes
Mar 18, 2021
| final Directory localEngineDirectory = _fileSystem.directory(localEngine); | ||
| final Directory outDirectory = localEngineDirectory?.parent; | ||
| final Directory srcDirectory = outDirectory?.parent; | ||
| if (localEngineDirectory.existsSync() && outDirectory.basename == 'out' && srcDirectory.basename == 'src') { |
Contributor
There was a problem hiding this comment.
On line 98 localEngineDirectory is guarded against null, which means on this line it may still be null. Should we guard against null here? Or remove the guard above?
| return null; | ||
| } | ||
|
|
||
| Future<String> _findEngineSourceBySkyEngine(String packagePath) async { |
Contributor
There was a problem hiding this comment.
nit: would _findEngineSourceByDotPackagesFile be a better name?
Member
Author
There was a problem hiding this comment.
How about _findEngineSourceByPackageConfig?
Member
Author
|
Google testing failure unrelated. |
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.

This PR parses the
srcdirectory from--local-engineif it is an absolute path when--local-engine-src-pathis not specified. This will support LUCI recipes with local engine builds that are not a sibling to the flutter root (like--local-engine=/b/s/w/ir/cache/builder/src/out/host_debug_unopt).The tool will then continue with the previous resolution steps: parse the
srcdirectory from.packagessky_enginepath, then checks if theengineis a sibling directory to thefluttercheckout.It also exits the tool with a failure if
--local-engineis set but thesrcdirectory cannot be found, instead of silently failing and using thebin/cacheengine.Fixes #78072