Skip to content

refactor flutter upgrade to be 2 part, with the second part re-entrant#38325

Merged
christopherfujino merged 3 commits intoflutter:masterfrom
chris-forks:fix-upgrade
Aug 13, 2019
Merged

refactor flutter upgrade to be 2 part, with the second part re-entrant#38325
christopherfujino merged 3 commits intoflutter:masterfrom
chris-forks:fix-upgrade

Conversation

@christopherfujino
Copy link
Contributor

@christopherfujino christopherfujino commented Aug 12, 2019

Currently, if you run flutter upgrade on macOS Catalina and the upgrade path has a Dart SDK revision change, you will get an exception with a misleading VersionCheckError: Command exited with code -9: git log -n 1 --pretty=format:%ad --date=iso. The actual cause is calling the Flutter tool re-entrantly, which deletes the current Dart SDK (which the flutter upgrade process is using), after which any forked sub-processes would be killed (code -9 from the VersionCheckError message) by the macOS anti-malware software. See #33890 and dart-lang/sdk#37662 for more info.

This PR breaks up the flutter upgrade flow into two parts, the second half invoked re-entrantly via the hidden flag flutter upgrade --continue. This fixes the issue because after there are no steps following the re-entrant call of flutter upgrade --continue from the first dart process.

Description

Replace this paragraph with a description of what this PR is doing. If you're modifying existing behavior, describe the existing behavior, how this PR is changing it, and what motivated the change. If you're changing visual properties, consider including before/after screenshots (and runnable code snippets to reproduce them).

Related Issues

Fixes #33890

Tests

I re-wrote the existing upgrade_test.dart file to accommodate the new re-entrant command.

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require Flutter developers to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (Please read Handling breaking changes). Replace this with a link to the e-mail where you asked for input on this proposed change.
  • No, this is not a breaking change.

@fluttergithubbot fluttergithubbot added the tool Affects the "flutter" command-line tool. See also t: labels. label Aug 12, 2019
@jonahwilliams
Copy link
Contributor

Can you add some more context to the PR description on how this helps to resolve the underlying issue for Catalina?

@christopherfujino
Copy link
Contributor Author

Can you add some more context to the PR description on how this helps to resolve the underlying issue for Catalina?

Done.

@codecov
Copy link

codecov bot commented Aug 12, 2019

Codecov Report

Merging #38325 into master will decrease coverage by 0.95%.
The diff coverage is 60%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #38325      +/-   ##
==========================================
- Coverage   56.09%   55.13%   -0.96%     
==========================================
  Files         194      194              
  Lines       18181    18195      +14     
==========================================
- Hits        10198    10032     -166     
- Misses       7983     8163     +180
Flag Coverage Δ
#flutter_tool 55.13% <60%> (-0.96%) ⬇️
Impacted Files Coverage Δ
...ckages/flutter_tools/lib/src/commands/upgrade.dart 34.48% <60%> (+1.62%) ⬆️
...ages/flutter_tools/lib/src/macos/macos_device.dart 6% <0%> (-56%) ⬇️
packages/flutter_tools/lib/src/compile.dart 31.01% <0%> (-46.35%) ⬇️
packages/flutter_tools/lib/src/desktop.dart 48% <0%> (-40%) ⬇️
...ages/flutter_tools/lib/src/commands/build_aot.dart 24.48% <0%> (-11.23%) ⬇️
...ages/flutter_tools/lib/src/commands/build_aar.dart 87.5% <0%> (-6.25%) ⬇️
packages/flutter_tools/lib/src/version.dart 90.73% <0%> (-1.96%) ⬇️
packages/flutter_tools/lib/src/cache.dart 43.5% <0%> (-0.73%) ⬇️
packages/flutter_tools/lib/src/template.dart 96.66% <0%> (-0.16%) ⬇️
packages/flutter_tools/lib/src/vmservice.dart 37.3% <0%> (+0.15%) ⬆️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6f7630a...cabcc4f. Read the comment docs.

Copy link
Contributor

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@christopherfujino christopherfujino merged commit cd1e55b into flutter:master Aug 13, 2019
@christopherfujino christopherfujino deleted the fix-upgrade branch August 13, 2019 22:53
)
..addFlag(
'continue',
hide: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should expose this in verbose mode.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VersionCheckError during flutter upgrade on macOS 10.15 beta (Catalina)

5 participants