[flutter_tools] only lock if an upgrade/download will be performed (linux/macos) and output building messages to stderr (#65422)
Currently an invocation of flutter/dart will always attempt to acquire a lock. This can pose problems for tools that attempt to run multiple dart/flutter instances. Instead update the lock logic (on Linux/macOS) so that we only attempt to acquire it if an update/snapshot needs to be performed. To avoid repeatedly performing downloads/snapshots if multiple flutter/dart invocations are fired off concurrently when an update needs to be performed, do a second check of the download/snapshot condition after the lock is released. Additionally, moves all of the building/debug output to stderr on both the bash and batch scripts. This allows machine mode consumption of the tool to ignore needing to parse/handle the rebuild messages.
This commit is contained in:
@@ -27,11 +27,11 @@ IF NOT EXIST "%flutter_root%\.git" (
|
||||
ECHO The flutter tool requires Git in order to operate properly;
|
||||
ECHO to set up Flutter, run the following command:
|
||||
ECHO git clone -b stable https://github.com/flutter/flutter.git
|
||||
EXIT /B 1
|
||||
EXIT 1
|
||||
)
|
||||
|
||||
REM Include shared scripts in shared.bat
|
||||
SET shared_bin=%FLUTTER_ROOT%/bin/internal/shared.bat
|
||||
SET shared_bin=%FLUTTER_ROOT%\bin\internal\shared.bat
|
||||
CALL "%shared_bin%"
|
||||
|
||||
SET flutter_tools_dir=%FLUTTER_ROOT%\packages\flutter_tools
|
||||
|
||||
Reference in New Issue
Block a user