Repository navigation
Would be nice if flutter run only downloaded the necessary artifacts #6491
Copy link
Copy link
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityteam-toolOwned by Flutter Tool teamOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.tool-still-validIssues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.Issues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.triaged-toolTriaged by Flutter Tool teamTriaged by Flutter Tool team
Description
I was on a train with bad wifi. It was painful.
I was trying to run the gallery on an iOS Simulator.
%flutter run
Building flutter tool...
Downloading package sky_engine... 8101ms
Running 'pub get' in sky_engine... 450ms
Downloading package sky_services... 596ms
Running 'pub get' in sky_services... 3139ms
Downloading package flutter_services... 1929ms
Running 'pub get' in flutter_services... 2294ms
Building Dart SDK summary... 1753ms
Downloading engine artifacts android-arm... 177027ms
Downloading engine artifacts android-arm-profile... 164117ms
Downloading engine artifacts android-arm-release... 115925ms
Downloading engine artifacts android-x64... 78964ms
Downloading engine artifacts android-x86... 78600ms
Downloading engine artifacts ios... 178979ms
Downloading engine artifacts ios-profile... 189778ms
Downloading engine artifacts ios-release... 152586ms
Downloading darwin-x64 tools... 232022ms
Downloading android-arm-profile/darwin-x64 tools... 34656ms
Downloading android-arm-release/darwin-x64 tools... 139862ms
Running 'pub get' in flutter_gallery... 870ms
FYI @danrubel
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityteam-toolOwned by Flutter Tool teamOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.tool-still-validIssues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.Issues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.triaged-toolTriaged by Flutter Tool teamTriaged by Flutter Tool team
Activity
eseidelGoogle commentedon Oct 29, 2016
We've had a couple complaints about downloads being slow or not resuming well from users in china who have network issues. Unclear if this specific bug would help them though.
olostan commentedon Nov 15, 2016
Faced same issue when decided to do some coding in airport while waiting for the flight. Had to restart downloading couple of times, downloads were failing.
As an idea (except limitation of needed resources) - may be download in parallel? Sometimes on bad connections that helps.
Hixie commentedon Dec 9, 2016
I just had this with
flutter analyze. There's really no reason to download an ARM engine if I want to analyze things... especially when I'm in a rush.cc @danrubel @devoncarew @jason-simmons
eseidelGoogle commentedon Feb 17, 2017
The flutter-intellij plugin has considered even working around this issue themselves: flutter/flutter-intellij#730
xster commentedon Jul 24, 2017
Hard to work on flutter tools too on slow networks. Each dev cycle involves changing some code of the tools, clear the tool's snapshot but building the new flutter tools is a network dependent operation which can take a while.
eseidelGoogle commentedon Jul 24, 2017
I'm confused. Rebuilding the flutter_tools snapshot shouldn't involve the network. Only downloading the engine artifacts should?
Hixie commentedon Nov 21, 2017
This would also solve the issue where "flutter upgrade" fails because you're on a version that is unable to download all the artifacts for whatever reason (e.g. we failed to upload them).
Hixie commentedon Jan 16, 2019
cc @jonahwilliams
2 remaining items
jonahwilliams commentedon Feb 22, 2019
This is somewhat blocked by the tree status, but is also related to how Gradle and XCode use artifacts. Currently they require everything up front, which we need to change eventually to make this work.
jonahwilliams commentedon Apr 22, 2019
We've made good progress on this. All new artifacts (macOS, Linux, Windows, Web, and Fuchsia) are lazy by default. There are still a few places in the tools where we end up downloading all of Android and iOS.
jonahwilliams commentedon Aug 31, 2020
For additional context from #64446 (which I am de-duping into this bug). There are some remaining cases where we eagerly download artifacts for devices that are connected but that we do not intend to use - this has mostly come up with the non-ephemeral devices.
A reasonable fix would be to defer additional artifact downloading until after we have selected a device.
xster commentedon Aug 31, 2020
+1 I still run into this on scenarios like downloading ios-release tools when I
flutter run (debug)on iOS devices etc.jonahwilliams commentedon Aug 31, 2020
That one is slightly separate, we download all of the bundles (debug/profile/release) all at once because splitting them up ended up breaking too many integration tests (at the time). it might be easier now that the build systems have been cleaned up
pedromassango commentedon Sep 1, 2020
A possible related issue #64822 (Cache the SDK on switching channel).