setup-dart icon indicating copy to clipboard operation
setup-dart copied to clipboard

Improve the caching of the downloaded sdks

Open mit-mit opened this issue 4 years ago • 6 comments

From the review of https://github.com/dart-lang/setup-dart/pull/1 by @athomas:

Perhaps we should download this into ${RUNNER_TOOL_CACHE}/dart//

That would enable checking if the version is in the cache later. It would mean we'd have to resolve latest to a specific version though.

mit-mit avatar Dec 11 '20 12:12 mit-mit

We could cache the etag, too – then use a HEAD request to compare?

Starting to get a bit complex for a bash script, though...

kevmoo avatar Dec 14 '20 16:12 kevmoo

Ooo! See https://stackoverflow.com/a/12475760/39827

curl --dump-header header_dump www.google.no
 curl -I -v --header 'If-None-Match: "1d30-4c993ec28581d"' http://httpd.apache.org

kevmoo avatar Dec 14 '20 16:12 kevmoo

This could mitigate some of the flakiness we are seeing downloading the SDK.

natebosch avatar Apr 14 '22 18:04 natebosch

Someone wants to take a stab at that in a PR? Then we can commit that, and try out the action pinned to that commit in some repo and see if that helps with flakiness?

mit-mit avatar Apr 19 '22 11:04 mit-mit

This has already been done. The current script uses RUNNER_TOOL_CACHE

serverwentdown avatar Aug 01 '22 11:08 serverwentdown

From some investigation, I don't believe this action is using caching. We are writing the downloaded and uncompressed sdk into $RUNNER_TOOL_CACHE, but I don't believe that directory implies any automatic caching. I believe it's just the path to a directory with many pre-installed sdks for various languages (pre-installed for the specific image).

devoncarew avatar Feb 15 '23 01:02 devoncarew