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

Setting up dart on a self hosted runner using tool cache not working as expected #35

Closed
jpelgrim opened this issue Jun 14, 2021 · 7 comments · Fixed by #44
Closed

Setting up dart on a self hosted runner using tool cache not working as expected #35

jpelgrim opened this issue Jun 14, 2021 · 7 comments · Fixed by #44

Comments

@jpelgrim
Copy link

jpelgrim commented Jun 14, 2021

We are in the process of migrating from GitHub's macos-latest runners to self hosted runners running on Mac Minis. When we use the dart-lang/setup-dart action now, the first run is fine, but from the second and onwards runs we run into the following issue.

Installing Dart SDK version "2.13.3" from the stable channel on macos-x64 
12Downloading https://storage.googleapis.com/dart-archive/channels/stable/release/2.13.3/sdk/dartsdk-macos-x64-release.zip... 
13 % Total % Received % Xferd Average Speed Time Time Time Current 
14 Dload Upload Total Spent Left Speed 
15 
16 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 
17 0 183M 0 20786 0 0 74501 0 0:42:56 --:--:-- 0:42:56 74235 
18 26 183M 26 48.2M 0 0 34.8M 0 0:00:05 0:00:01 0:00:04 34.8M 
19 64 183M 64 118M 0 0 52.9M 0 0:00:03 0:00:02 0:00:01 52.8M 
20100 183M 100 183M 0 0 58.6M 0 0:00:03 0:00:03 --:--:-- 58.6M 
21replace /Users/runner/actions-runner/_work/_tool/dart-sdk/bin/dart? [y]es, [n]o, [A]ll, [N]one, [r]ename: NULL 
22(EOF or read error, treating as "[N]one" ...) 
23Error: Download failed! Please check passed arguments. 
24Error: Process completed with exit code 1.

TL;DR How do we use the dart-lang/setup-dart properly, in combination with the tool cache and caching multiple dart versions. Maybe as a workaround we can just answer yes instead of NULL on the replace /Users/runner/actions-runner/_work/_tool/dart-sdk/bin/dart? question?

More detail

I see this in setup.sh

Unzipping dartsdk.zip into the RUNNER_TOOL_CACHE directory

# Download installation zip.
curl --connect-timeout 15 --retry 5 "$URL" > "${HOME}/dartsdk.zip"
unzip "${HOME}/dartsdk.zip" -d "${RUNNER_TOOL_CACHE}" > /dev/null

Then appending to the GITHUB_PATH

# Update paths.
echo "${HOME}/.pub-cache/bin" >> $GITHUB_PATH
echo "${RUNNER_TOOL_CACHE}/dart-sdk/bin" >> $GITHUB_PATH

So this action is not doing anything with versioning or checking if the requested version is already installed, like we see done in flutter for example

/Users/runner/actions-runner/_work/_tool runner$ ls -l flutter/
total 0
drwxr-xr-x  4 runner  staff   128B Jun 14 12:52 ./
drwxr-xr-x  6 runner  staff   192B Jun 14 14:26 ../
drwxr-xr-x  4 runner  staff   128B Jun 14 12:52 2.0.3-stable/
drwxr-xr-x  4 runner  staff   128B Jun 14 09:54 2.2.1-stable/

/Users/runner/actions-runner/_work/_tool runner$ ls -l dart-sdk
total 40
drwx------  10 runner  staff   320B Jun  9 13:02 ./
drwxr-xr-x   6 runner  staff   192B Jun 14 14:26 ../
-rw-r--r--   1 runner  staff   1.5K Jun  7 13:14 LICENSE
-rw-r--r--   1 runner  staff   981B Jun  7 13:14 README
drwx------  14 runner  staff   448B Jun 10 10:05 bin/
-rw-r--r--   1 runner  staff   189B Jun  9 13:02 dartdoc_options.yaml
drwxr-xr-x   9 runner  staff   288B Jun  9 13:02 include/
drwxr-xr-x  28 runner  staff   896B Jun  9 13:19 lib/
-rw-r--r--   1 runner  staff    41B Jun  9 13:02 revision
-rw-r--r--   1 runner  staff     7B Jun  9 13:02 version

Anybody else running into this?

Update: The https://github.com/cedx/setup-dart action doesn't have this issue, so reverting to that for now.

@hauketoenjes
Copy link

The issue seems to be related to the unzip command in this line:

unzip "${HOME}/dartsdk.zip" -d "${RUNNER_TOOL_CACHE}" > /dev/null

A possible solution would be to pass -o to disable user input and force overriding of files like described in the man page here: https://linux.die.net/man/1/unzip .

hauketoenjes added a commit to hauketoenjes/setup-dart that referenced this issue Aug 12, 2021
@mit-mit
Copy link
Member

mit-mit commented Oct 5, 2021

@hauketoenjes did you confirm that the -o option fixes the issue? If so, are you interested in sending a PR for that?

@hauketoenjes
Copy link

Hi, apologies for the delayed response. It seems like a pull request isn't needed anymore?

#44 is exactly what I did 👍🏼.

@mit-mit
Copy link
Member

mit-mit commented Oct 6, 2021

Yeah, I was doing another change so added in your suggested change. Thanks for the pointer!

@mit-mit
Copy link
Member

mit-mit commented Oct 8, 2021

This is now fixed in the main channel; @jpelgrim, @hauketoenjes could you give uses: dart-lang/setup-dart@7e4ec4f1811e09ce8f339b4d3044220ca799e6c6 a try and let me know if that works as expected?

hauketoenjes added a commit to hauketoenjes/ov_epaper that referenced this issue Oct 8, 2021
Issue dart-lang/setup-dart#35 has been resolved
@hauketoenjes
Copy link

I just tested it and it works. https://github.com/hauketoenjes/ov_epaper/runs/3838370359

(Don't mind the Duration that action ran, since it ran on a Raspberry Pi for testing purposes)

@mit-mit
Copy link
Member

mit-mit commented Oct 11, 2021

Thanks! Now available in dart-lang/setup-dart@v1.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants