Repository navigation
Cached artifacts are not updated after switching channels #44118
Description
Activity
- addedtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.platform-windowsBuilding on or for Windows specificallyBuilding on or for Windows specifically
on Nov 4, 2019 #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.
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?Reacted by Shivam Singhania, Richard Alison, Darshan and Aashiq- addeda: annoyanceRepeatedly frustrating issues with non-experimental functionalityRepeatedly frustrating issues with non-experimental functionalityc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: performanceRelates to speed or footprint issues (see "perf:" labels)Relates to speed or footprint issues (see "perf:" labels)
on Nov 19, 2019 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.
Reacted by Christopher Fujino- Hmmm -- it feels like I've had this on a regular upgrade without changing channels (I don't change channels very often). Will keep an eye out. I'd be somewhat less worried if this only occurs with a channel switch.…On Thu, Nov 21, 2019 at 5:14 PM Ian Hickson ***@***.***> wrote: 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. — You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub <#44118?email_source=notifications&email_token=AARWL635HU5P2WD3KK6RSU3QU4W75A5CNFSM4JIXNASKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEE4GHLY#issuecomment-557343663>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AARWL6ZP3O65JNNPALWHN3DQU4W75ANCNFSM4JIXNASA> .
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.
- changed the title
[-]Dart SDK downloaded twice on `flutter upgrade`[/-][+]Dart SDK downloaded twice on `flutter upgrade` after changing channels[/+]on Nov 27, 2019 8 remaining items
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 onmasterbranch (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 incache?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.
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/flutterand//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.Reacted by nandgator- addedP2Important issues not at the top of the work listImportant issues not at the top of the work list
on May 29, 2020 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 --versionin VS Code terminal, and without consent, flutter started automatically downloading the Dart SDK.Reacted by nandgator, Richard Alison, Ashutosh Singh, Cypherpunk Samurai, Kshitiz Kamal, Chandra Sekhar Kode and Bartek PaciaThat'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.
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.
(responding to this comment)
@osaxma, you can use
fvm(Flutter Version Manager) to have manyflutters installed side-by-side. This is not perfect but it gets the job done for me :)Reacted by osamaAssigning to Christopher who's been working on this in #118129
Reacted by osama- 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 - added a commit that references this issue
on Jun 9, 2023 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 -vand a minimal reproduction of the issue.- locked as resolved and limited conversation to collaborators
on Jun 23, 2023

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