First and foremost congrats and thank you for maintaining this action.
Version
latest release (version 2.13.0)
Description
When specifying a dependency override in pubspec.yaml to a git ref, calls to flutter pub get and similar fail in the windows runner with the message:
Git error. Command: `git clone --mirror https://github.com/<repo>.git /c/Users/runneradmin/.pub-cache\git\cache\<repo>-<ref>`
stdout:
stderr: fatal: destination path '/c/Users/runneradmin/.pub-cache\git\cache\<repo>-<ref>' already exists and is not an empty directory.
exit code: 128
I can reproduce with cache either empty (implying false) or true.
Adding this job before using the action fixes the issue.
- name: Export pub environment variable on Windows
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
echo "PUB_CACHE=$LOCALAPPDATA\\Pub\\Cache" >> $GITHUB_ENV
fi
shell: bash
I believe the problem is that https://github.com/subosito/flutter-action/pull/265 changes the caching to be two parts: one for the flutter and one for pub cache. However, the default directory for PUB_CACHE is set to $HOME/.pub-cache in all the runners, instead of only macOS and Ubuntu, and then the AppData version in Windows.
On a somewhat related note, I find that supplying a pub-cache-path argument produces a warning
As I understand it from looking at setup.sh, the logic for this parameter seems to be incomplete.
Solution
The solution is to set the value of $GITHUB_ENV's PUB_CACHE to %LOCALAPPDATA%\Pub\Cache if it's empty and the os is Windows. Or use pub-cache-path if it's supplied then export it to $GITHUB_ENV as normal.
First and foremost congrats and thank you for maintaining this action.
Version
latest release (version 2.13.0)
Description
When specifying a dependency override in
pubspec.yaml
to a git ref, calls toflutter pub get
and similar fail in the windows runner with the message:I can reproduce with
cache
either empty (implying false) or true.Adding this job before using the action fixes the issue.
I believe the problem is that https://github.com/subosito/flutter-action/pull/265 changes the caching to be two parts: one for the flutter and one for pub cache. However, the default directory for
PUB_CACHE
is set to$HOME/.pub-cache
in all the runners, instead of only macOS and Ubuntu, and then the AppData version in Windows.On a somewhat related note, I find that supplying a
pub-cache-path
argument produces a warningAs I understand it from looking at
setup.sh
, the logic for this parameter seems to be incomplete.Solution
The solution is to set the value of
$GITHUB_ENV
'sPUB_CACHE
to%LOCALAPPDATA%\Pub\Cache
if it's empty and the os is Windows. Or usepub-cache-path
if it's supplied then export it to $GITHUB_ENV as normal.Other
Other reports of this issue: