Skip to content

Failed to collect flutter cache #44

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

Closed
damian-molinski opened this issue Feb 27, 2023 · 3 comments
Closed

Failed to collect flutter cache #44

damian-molinski opened this issue Feb 27, 2023 · 3 comments

Comments

@damian-molinski
Copy link

Issue description

Recently i started to notice warning in my workflow when using Flutter Build step

+------------------------------------------------------------------------------+

| (9) Flutter Build                                                            |
+------------------------------------------------------------------------------+
| id: flutter-build                                                            |
| version: 0.15.1                                                              |
| collection: https://github.com/bitrise-io/bitrise-steplib.git                |
| toolkit: go                                                                  |
| time: 2023-02-27T12:47:05Z                                                   |
+------------------------------------------------------------------------------+

Error (non fatal) says

Collecting cache
Failed to collect flutter cache, error: package resolution file (/Users/vagrant/git/.packages) not found, error: stat /Users/vagrant/git/.packages: no such file or directory

From what i was able to understand how this step works [ i'm very bad with go, sorry :( ] its failes at this line https://github.com/bitrise-steplib/bitrise-step-flutter-build/blob/master/cache.go#L215.

It's trying to find .packages directory but it does not exists (not even on my local machine.

https://dart.dev/tools/pub/cmd/pub-get#package-resolution says that .dart_tool/ is the place to look for package_config.json

and
https://dart.dev/tools/pub/cmd/pub-get#the-system-package-cache that .pub-cache is at root dir unless env var(PUB_CACHE) is set (https://dart.dev/tools/pub/environment-variables).

.dart_tools/

damianmolinski@Damians-MBP ~ % ls -l Work/[project_name]/.dart_tool 
total 144
drwxr-xr-x   5 damianmolinski  staff    160 Feb 27 07:54 build
drwxr-xr-x   4 damianmolinski  staff    128 Feb 14 08:25 build_resolvers
drwxr-xr-x  15 damianmolinski  staff    480 Feb 27 12:02 flutter_build
drwxr-xr-x   5 damianmolinski  staff    160 Feb 15 13:26 flutter_gen
-rw-r--r--   1 damianmolinski  staff  31762 Feb 27 13:21 package_config.json
-rw-r--r--   1 damianmolinski  staff  35572 Feb 27 13:21 package_config_subset
drwxr-xr-x   5 damianmolinski  staff    160 Feb 27 13:21 pub
-rw-r--r--   1 damianmolinski  staff      5 Feb 27 13:21 version

.pub-cache/

damianmolinski@Damians-MBP ~ % ls -l .pub-cache                     
total 8
-rw-r--r--  1 damianmolinski  staff  370 Feb 23 13:16 README.md
drwxr-xr-x  2 damianmolinski  staff   64 Feb 23 13:16 _temp
drwxr-xr-x  5 damianmolinski  staff  160 Mar 17  2022 bin
drwxr-xr-x  5 damianmolinski  staff  160 Feb 15 08:24 git
drwxr-xr-x  5 damianmolinski  staff  160 Feb 24  2022 global_packages
drwxr-xr-x  4 damianmolinski  staff  128 Jan 18 07:54 hosted
drwxr-xr-x  3 damianmolinski  staff   96 Jan 18 07:57 hosted-hashes
drwxr-xr-x  3 damianmolinski  staff   96 Dec 29 10:54 log

Again step does not fail but it would be nice to speed up build time a bit with cache. If this is just warning sorry for bothering.

@abdulhaq-e
Copy link

I don't think it's just a warning. The push-cache step isn't recognizing any cache related to Flutter packages.

@godrei
Copy link
Contributor

godrei commented May 8, 2023

Hi @damian-molinski and @abdulhaq-e ,
we merged a PR to fix this issue and released a new version (0.16.0) with the changes.
Could you please check if the issue still exists?

@damian-molinski
Copy link
Author

damian-molinski commented May 15, 2023

Looks good to me 👍

@bitrise-steplib bitrise-steplib locked and limited conversation to collaborators May 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants