Skip to content

Cached artifacts are not updated after switching channels #44118

Description

@timsneath

See the following log. This was on an upgrade of the master channel on Windows 10. Notice that there are two attempts to download the Dart SDK, with different engine hashes.

C:\git\dart_console>flutter upgrade
Checking Dart SDK version...
Downloading Dart SDK from Flutter engine b875c7a5ff5680d3c734e3b94ba707b4f3a9527a...
Unzipping Dart SDK...
Building flutter tool...
Running pub upgrade...
Upgrading Flutter from C:\git\flutter...
From github.com:flutter/flutter
   48ce60824..3422540bc  master                  -> origin/master
 * [new branch]          Hixie-patch-2           -> origin/Hixie-patch-2
 * [new branch]          Hixie-patch-3           -> origin/Hixie-patch-3
 * [new branch]          Hixie-patch-4           -> origin/Hixie-patch-4
 + 2d2a1ffec...e70236e36 beta                    -> origin/beta  (forced update)
   3cf88fed6..1946fc4da  dev                     -> origin/dev
 * [new branch]          hot_restart_lowercase_r -> origin/hot_restart_lowercase_r
 * [new branch]          revert-40607-animationOverview -> origin/revert-40607-animationOverview
 * [new branch]          revert-40710-flutterGold -> origin/revert-40710-flutterGold
 * [new branch]          revert-41415-exposeimage -> origin/revert-41415-exposeimage
 * [new branch]          revert-41780-fix_build  -> origin/revert-41780-fix_build
 * [new branch]          sjindel.elf             -> origin/sjindel.elf
   2d2a1ffec..68587a091  stable                  -> origin/stable
   1ced75cc2..eb6877bf9  v1.9.1-hotfixes         -> origin/v1.9.1-hotfixes
 * [new tag]             v1.10.14                -> v1.10.14
 * [new tag]             v1.10.7                 -> v1.10.7
 * [new tag]             v1.9.1+hotfix.6         -> v1.9.1+hotfix.6
 * [new tag]             v1.10.10                -> v1.10.10
 * [new tag]             v1.10.11                -> v1.10.11
 * [new tag]             v1.10.12                -> v1.10.12
 * [new tag]             v1.10.13                -> v1.10.13
 * [new tag]             v1.10.6                 -> v1.10.6
 * [new tag]             v1.10.8                 -> v1.10.8
 * [new tag]             v1.10.9                 -> v1.10.9
 * [new tag]             v1.9.1+hotfix.3         -> v1.9.1+hotfix.3
 * [new tag]             v1.9.1+hotfix.4         -> v1.9.1+hotfix.4
 * [new tag]             v1.9.1+hotfix.5         -> v1.9.1+hotfix.5
Checking out files:  93% (1154/1229)
Checking out files:  94% (1156/1229)
Checking out files:  95% (1168/1229)
Checking out files:  96% (1180/1229)
Checking out files:  97% (1193/1229)
Checking out files:  98% (1205/1229)
Checking out files:  99% (1217/1229)
Checking out files: 100% (1229/1229)
Checking out files: 100% (1229/1229), done.
Updating 3cf88fed6..3422540bc
 .../AppIcon.appiconset/app_icon_1024.png           |  Bin 0 -> 46993 bytes
 .../AppIcon.appiconset/app_icon_128.png            |  Bin 0 -> 3276 bytes
 .../AppIcon.appiconset/app_icon_16.png             |  Bin 0 -> 1429 bytes
 .../AppIcon.appiconset/app_icon_256.png            |  Bin 0 -> 5933 bytes
 .../AppIcon.appiconset/app_icon_32.png             |  Bin 0 -> 1243 bytes
 .../AppIcon.appiconset/app_icon_512.png            |  Bin 0 -> 14800 bytes
 .../AppIcon.appiconset/app_icon_64.png             |  Bin 0 -> 1874 bytes
 .../AppIcon.appiconset/app_icon_1024.png           |  Bin 0 -> 46993 bytes
 .../AppIcon.appiconset/app_icon_128.png            |  Bin 0 -> 3276 bytes
 .../AppIcon.appiconset/app_icon_16.png             |  Bin 0 -> 1429 bytes
 .../AppIcon.appiconset/app_icon_256.png            |  Bin 0 -> 5933 bytes
 .../AppIcon.appiconset/app_icon_32.png             |  Bin 0 -> 1243 bytes
 .../AppIcon.appiconset/app_icon_512.png            |  Bin 0 -> 14800 bytes
 .../AppIcon.appiconset/app_icon_64.png             |  Bin 0 -> 1874 bytes
 .../hermetic}/devices_test.dart                    |    0
 .../hermetic}/install_test.dart                    |    0
 .../permeable}/format_test.dart                    |    0
 .../permeable}/upgrade_test.dart                   |    0
 1200 files changed, 58861 insertions(+), 20479 deletions(-)
Checking Dart SDK version...
Downloading Dart SDK from Flutter engine 8ea19b1c76f69f7b50e4195f41dfb1cb49a9fe66...
Unzipping Dart SDK...
Building flutter tool...
Running pub upgrade...

Upgrading engine...
Downloading Android Maven dependencies...                          15.6s
Downloading android-arm-profile/windows-x64 tools...                0.5s
Downloading android-arm-release/windows-x64 tools...                0.4s
Downloading android-arm64-profile/windows-x64 tools...              0.5s
Downloading android-arm64-release/windows-x64 tools...              0.4s
Downloading android-x64-profile/windows-x64 tools...                0.5s
Downloading android-x64-release/windows-x64 tools...                0.6s
Downloading android-x86 tools...                                    2.0s
Downloading android-x64 tools...                                    1.9s
Downloading android-arm tools...                                    1.0s
Downloading android-arm-profile tools...                            0.5s
Downloading android-arm-release tools...                            0.5s
Downloading android-arm64 tools...                                  0.9s
Downloading android-arm64-profile tools...                          0.6s
Downloading android-arm64-release tools...                          0.5s
Downloading android-x64-profile tools...                            0.6s
Downloading android-x64-release tools...                            0.5s
Downloading android-x86-jit-release tools...                        0.7s
Downloading package sky_engine...                                   0.2s
Downloading common tools...                                         0.9s
Downloading common tools...                                         1.0s
Downloading windows-x64 tools...                                    2.5s

Flutter 1.10.15-pre.387 • channel master • [email protected]:flutter/flutter.git
Framework • revision 3422540bc4 (73 minutes ago) • 2019-11-04 09:09:20 -0800
Engine • revision 8ea19b1c76
Tools • Dart 2.6.0 (build 2.6.0-dev.8.2 bbe2ac28c9)

Running flutter doctor...
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel master, v1.10.15-pre.387, on Microsoft Windows [Version 10.0.18362.449], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.0)
[√] Android Studio (version 3.5)
[√] VS Code (version 1.39.2)
[!] Connected device
    ! No devices available

! Doctor found issues in 1 category.

C:\git\dart_console>

Activity

  1. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    platform-windowsBuilding on or for Windows specifically
    on Nov 4, 2019
  2. timsneath commented on Nov 4, 2019

    @timsneath
    Author

    Also see #14700, which @tvolkert opened and was allegedly fixed with #14702. Might or might not be related.

  3. zanderso commented on Nov 5, 2019

    @zanderso
    Member

    #14700 looks unrelated. In the case here, the Dart SDK is downloaded once to build and run the flutter tool. It (or rather a newer 'it') is downloaded a second time as part of the upgrade. One could shift the 'upgrade' logic to the shell scripts to avoid the additional download, but that would run counter to an overall goal of having less logic in shell scripts.

  4. timsneath commented on Nov 19, 2019

    @timsneath
    Author

    I think we need to re-evaluate the trade-off here. The cost of expecting users to download another 200MB+ of Dart is a significant friction point for users who are on metered connections. I suspect that is more critical than reducing shell script logic. But there are other potential solutions here, for example using dart2native?

  5. added
    a: annoyanceRepeatedly frustrating issues with non-experimental functionality
    c: new featureNothing broken; request for a new capability
    c: performanceRelates to speed or footprint issues (see "perf:" labels)
    on Nov 19, 2019
  6. Hixie commented on Nov 22, 2019

    @Hixie
    Contributor

    I don't think this is really a bug. It's not the normal path. The normal path is that you download the SDK from the Web site, which includes Dart, and everything works without a download. Then later you run "flutter upgrade", and it downloads Dart once.

    To get into the state described here, you have to do something like switch channels then upgrade. The first Dart SDK download is really part of switching channels, not upgrading. We could explicitly make switching channels download the Dart SDK and compile the tool, like "upgrade" does, and then you would not see this anymore.

  7. timsneath commented on Nov 22, 2019

    @timsneath
    Author
  8. Hixie commented on Nov 27, 2019

    @Hixie
    Contributor

    I'm going to rename this to be about the channel switch case, but if you do find it occurs in other cases please file a new bug with precise steps to reproduce.

  9. changed the title [-]Dart SDK downloaded twice on `flutter upgrade`[/-] [+]Dart SDK downloaded twice on `flutter upgrade` after changing channels[/+] on Nov 27, 2019
  10. added this to the milestone on Nov 27, 2019
  11. 8 remaining items

  12. nandgator commented on Mar 24, 2020

    @nandgator

    The cost of expecting users to download another 200MB+ of Dart is a significant friction point for users who are on metered connections.

    But honestly, I think this point gets disqualified.
    I'm a user with metered connection on master branch (cause I want to test flutter on Linux). The Dart SDK gets downloaded at every flutter upgrade. And the issue:#53126 makes it worse by running everything all over again.

    According to this pull:#14610 I think they want to been on level with the bleeding edge Dart releases. This pull:#14702 (comment) says the Dart SDK must be removed bin/cache/dart-sdk. Right? What's the point in setting a whole 200MB+ SDK in cache?

    Wouldn't it be better (for "metered" Linux users) to at least have a provision to symlink an external Dart SDK, rather than downloading the same at every Flutter upgrade?


    If there's such a workaround please link / guide me through.

  13. christopherfujino commented on Mar 24, 2020

    @christopherfujino
    Contributor

    Wouldn't it be better (for "metered" Linux users) to at least have a provision to symlink an external Dart SDK, rather than downloading the same at every Flutter upgrade?

    If you're on master, technically you wouldn't have to re-download the Dart SDK with every upgrade, only if there was a new version of the Dart SDK. That being said, we vend the bleeding edge Dart SDK, so there are quite frequently new version of the Dart SDK.

    We vend the Dart SDK because the Flutter SDK is quite tightly coupled to the exact version of Dart it tracks. Although it's technically possible to override the Flutter tool downloading a new Dart SDK (the logic to download the Dart SDK is in //bin/flutter and //bin/internal/update_dart_sdk.sh, but I wouldn't recommend it as there would be a high probability of regression, and the breakages might not be immediately apparent.

  14. added
    P2Important issues not at the top of the work list
    on May 29, 2020
  15. osaxma commented on Jun 2, 2020

    @osaxma
    Contributor

    This is really annoying, time-consuming and it costs money for some. Not everywhere in the world people have unlimited data and fast internet. It became really discouraging to switch between channels because every time I switch, I've to to face a +200MB download.

    Also, today I ran flutter --version in VS Code terminal, and without consent, flutter started automatically downloading the Dart SDK.

    Screen Shot 2020-06-02 at 12 27 28 PM

  16. Hixie commented on Jun 9, 2020

    @Hixie
    Contributor

    That's not really the same as this bug. I recommend filing a new issue to cover that problem.

    This issue is specifically about the fact that when you switch channels, we don't download the Dart SDK for the new channel until the next command you run (unlike "upgrade", where we download it right away). Fixing this bug would not change the number of bits downloaded, just the timing of the downloads. If you have an issue with the number of bits, which is a perfectly reasonable concern to have, then we should track that in its own issue.

  17. removed this from the milestone on Aug 17, 2020
  18. CypherpunkSamurai commented on Sep 19, 2020

    @CypherpunkSamurai

    The only workaround i found to this is creating a separate copy of the flutter installation after an upgrade. For Windows zipping the flutter installation is enough, for Linux and Mac a tarball is preferable. Else, unless the separate channels are provided as release packages there seems no other ways to download a out of the box working flutter installation without upgrading.

    I'm on a metered connection as well, upgrading flutter seems a trouble when changing platforms during development.

  19. bartekpacia commented on Jan 4, 2023

    @bartekpacia
    Member

    (responding to this comment)

    @osaxma, you can use fvm (Flutter Version Manager) to have many flutters installed side-by-side. This is not perfect but it gets the job done for me :)

  20. mit-mit commented on Jun 1, 2023

    @mit-mit
    Member

    Assigning to Christopher who's been working on this in #118129

  21. changed the title [-]Dart SDK appears to be downloaded twice on `flutter upgrade` after changing channels[/-] [+]Cached artifacts are not updated after switching channels[/+] on Jun 8, 2023
  22. github-actions commented on Jun 23, 2023

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  23. locked as resolved and limited conversation to collaborators on Jun 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

P2Important issues not at the top of the work lista: qualityA truly polished experiencetoolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions