Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
294376fb
Commit
294376fb
authored
Jun 14, 2016
by
Ian Hickson
Committed by
GitHub
Jun 14, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix reentrant locking in pub upgrade (#4556)
parent
0e50ee6e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
5 deletions
+13
-5
cache.dart
packages/flutter_tools/lib/src/cache.dart
+2
-3
upgrade.dart
packages/flutter_tools/lib/src/commands/upgrade.dart
+4
-1
flutter_command_runner.dart
.../flutter_tools/lib/src/runner/flutter_command_runner.dart
+7
-1
No files found.
packages/flutter_tools/lib/src/cache.dart
View file @
294376fb
...
@@ -55,7 +55,7 @@ class Cache {
...
@@ -55,7 +55,7 @@ class Cache {
locked
=
true
;
locked
=
true
;
}
on
FileSystemException
{
}
on
FileSystemException
{
if
(!
printed
)
{
if
(!
printed
)
{
printStatus
(
'Waiting to be able to obtain lock of Flutter
cache
directory...'
);
printStatus
(
'Waiting to be able to obtain lock of Flutter
binary artifacts
directory...'
);
printed
=
true
;
printed
=
true
;
}
}
await
new
Future
/*<Null>*/
.
delayed
(
const
Duration
(
milliseconds:
50
));
await
new
Future
/*<Null>*/
.
delayed
(
const
Duration
(
milliseconds:
50
));
...
@@ -65,9 +65,8 @@ class Cache {
...
@@ -65,9 +65,8 @@ class Cache {
/// Releases the lock. This is not necessary unless the process is long-lived.
/// Releases the lock. This is not necessary unless the process is long-lived.
static
void
releaseLockEarly
()
{
static
void
releaseLockEarly
()
{
if
(!
_lockEnabled
)
if
(!
_lockEnabled
||
_lock
==
null
)
return
;
return
;
assert
(
_lock
!=
null
);
_lock
.
closeSync
();
_lock
.
closeSync
();
_lock
=
null
;
_lock
=
null
;
}
}
...
...
packages/flutter_tools/lib/src/commands/upgrade.dart
View file @
294376fb
...
@@ -45,10 +45,13 @@ class UpgradeCommand extends FlutterCommand {
...
@@ -45,10 +45,13 @@ class UpgradeCommand extends FlutterCommand {
return
code
;
return
code
;
// Check for and download any engine and pkg/ updates.
// Check for and download any engine and pkg/ updates.
// We run the 'flutter' shell script re-entrantly here
// so that it will download the updated Dart and so forth
// if necessary.
printStatus
(
''
);
printStatus
(
''
);
printStatus
(
'Upgrading engine...'
);
printStatus
(
'Upgrading engine...'
);
code
=
await
runCommandAndStreamOutput
(<
String
>[
code
=
await
runCommandAndStreamOutput
(<
String
>[
'bin/flutter'
,
'--no-color'
,
'precache'
'bin/flutter'
,
'--no-
lock'
,
'--no-
color'
,
'precache'
],
workingDirectory:
Cache
.
flutterRoot
);
],
workingDirectory:
Cache
.
flutterRoot
);
printStatus
(
''
);
printStatus
(
''
);
...
...
packages/flutter_tools/lib/src/runner/flutter_command_runner.dart
View file @
294376fb
...
@@ -48,6 +48,11 @@ class FlutterCommandRunner extends CommandRunner {
...
@@ -48,6 +48,11 @@ class FlutterCommandRunner extends CommandRunner {
negatable:
true
,
negatable:
true
,
hide:
!
verboseHelp
,
hide:
!
verboseHelp
,
help:
'Whether to use terminal colors.'
);
help:
'Whether to use terminal colors.'
);
argParser
.
addFlag
(
'lock'
,
negatable:
true
,
hide:
!
verboseHelp
,
help:
'Whether to lock the Flutter binary artifacts directory while running. (This prevents multiple simultaneous Flutter instances from colliding.)'
,
defaultsTo:
true
);
argParser
.
addFlag
(
'suppress-analytics'
,
argParser
.
addFlag
(
'suppress-analytics'
,
negatable:
false
,
negatable:
false
,
hide:
!
verboseHelp
,
hide:
!
verboseHelp
,
...
@@ -142,7 +147,8 @@ class FlutterCommandRunner extends CommandRunner {
...
@@ -142,7 +147,8 @@ class FlutterCommandRunner extends CommandRunner {
// enginePath's initialiser uses it).
// enginePath's initialiser uses it).
Cache
.
flutterRoot
=
path
.
normalize
(
path
.
absolute
(
globalResults
[
'flutter-root'
]));
Cache
.
flutterRoot
=
path
.
normalize
(
path
.
absolute
(
globalResults
[
'flutter-root'
]));
await
Cache
.
lock
();
if
(
globalResults
[
'lock'
]);
await
Cache
.
lock
();
if
(
globalResults
[
'suppress-analytics'
])
if
(
globalResults
[
'suppress-analytics'
])
flutterUsage
.
suppressAnalytics
=
true
;
flutterUsage
.
suppressAnalytics
=
true
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment