Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[flutter_tools] Fix legacy version file not being ensured #133097

Conversation

christopherfujino
Copy link
Member

Fixes #133093

When I introduced the new, more robust version file //flutter/bin/cache/version.json in #124558, I changed class FlutterVersion into an abstract interface, implemented by _FlutterVersionFromGit (which is essentially the previous behavior) and _FlutterVersionFromFile, which merely reads the data it would have computed via git from //flutter/bin/cache/version.json.

While doing this, I made _FlutterVersionFromGit.ensureVersionFile() to be a no-op, since I assumed this would not be necessary since we already had a version file in the cache. However, this method was what was previously responsible for ensuring //flutter/version existed on disk. This means that if, for whatever reason, the user had //flutter/bin/cache/flutter.version.json present but NOT //flutter/version, the tool would have never created that file, and they would hit the tool crash seen in #133093.

This fixes the tool by ensuring //flutter/version exists regardless of if we're hydrating FlutterVersion from //flutter/bin/cache/flutter.version.json or not.

@github-actions github-actions bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Aug 23, 2023
Copy link
Contributor

@eliasyishak eliasyishak left a comment

Choose a reason for hiding this comment

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

LGTM, does this relate to the issue we saw yesterday where the version file was missing when running the ./dev/bots/docs.sh shell script?

@christopherfujino
Copy link
Member Author

LGTM, does this relate to the issue we saw yesterday where the version file was missing when running the ./dev/bots/docs.sh shell script?

That's a good point, I think you're right. It's still unclear to me how users are getting into this state, though.

@christopherfujino christopherfujino added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 23, 2023
@auto-submit auto-submit bot merged commit 9e59a68 into flutter:master Aug 23, 2023
125 checks passed
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Aug 24, 2023
flutter/flutter@bd836cc...deeb811

2023-08-24 zanderso@users.noreply.github.com Reverts "Roll Flutter Engine from aa98a9d2e86f to 3b92bb6eda19 (4 revisions) (#133224)" (flutter/flutter#133255)
2023-08-24 engine-flutter-autoroll@skia.org Roll Flutter Engine from aa98a9d2e86f to 3b92bb6eda19 (4 revisions) (flutter/flutter#133224)
2023-08-24 engine-flutter-autoroll@skia.org Roll Flutter Engine from 67e8b825cc91 to aa98a9d2e86f (4 revisions) (flutter/flutter#133220)
2023-08-24 engine-flutter-autoroll@skia.org Roll Flutter Engine from 27d75f6221d2 to 67e8b825cc91 (1 revision) (flutter/flutter#133214)
2023-08-23 katelovett@google.com Remove deprecated PlatformViewsService.synchronizeToNativeViewHierarchy (flutter/flutter#133175)
2023-08-23 engine-flutter-autoroll@skia.org Roll Flutter Engine from 58dc868c26cb to 27d75f6221d2 (14 revisions) (flutter/flutter#133211)
2023-08-23 katelovett@google.com Remove deprecated MaterialButtonWithIconMixin (flutter/flutter#133173)
2023-08-23 polinach@google.com Enable ChangeNotifier clients to dispatch event of object creation in constructor. (flutter/flutter#133060)
2023-08-23 goderbauer@google.com Enable literal_only_boolean_expressions (flutter/flutter#133186)
2023-08-23 47866232+chunhtai@users.noreply.github.com Add android analyzer commands for applinks (flutter/flutter#131009)
2023-08-23 reidbaker@google.com Bump memory usage in gradle for platform views (flutter/flutter#133155)
2023-08-23 christopherfujino@gmail.com [flutter_tools] Fix legacy version file not being ensured (flutter/flutter#133097)
2023-08-23 goderbauer@google.com Remove deprecated *TestValues from TestWindow (flutter/flutter#131098)
2023-08-23 engine-flutter-autoroll@skia.org Roll Flutter Engine from ac352ba95f43 to 58dc868c26cb (2 revisions) (flutter/flutter#133165)
2023-08-23 mdebbar@google.com [web] Remove unnecessary lint ignore (flutter/flutter#133164)
2023-08-23 jacksongardner@google.com Add `--experimental-wasm-type-reflection` and support newer emscripten builds. (flutter/flutter#133084)
2023-08-23 engine-flutter-autoroll@skia.org Roll Flutter Engine from 72a06427bd37 to ac352ba95f43 (2 revisions) (flutter/flutter#133158)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC rmistry@google.com,stuartmorgan@google.com,ychris@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

flutter version file not found during flutter pub get
2 participants