-
Notifications
You must be signed in to change notification settings - Fork 528
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
go build is re-building everyting with enabled cache #357
Comments
Hello @ernado , thanks for your input, we are starting to investigate the issue |
Hello @ernado I tried to reproduce the problem in the simplified environment and the build shows it works as expected Moreover the logs of you build shows the both caches (packages and intermediate build results) are restored as well: packages and build cache The reason the packages are rebuilt can be caused some reasons not related to the action: changing compiler options, target platform, switching branches. I am not sure how does docker steps from your workflow impact the build but advise to add the command Does this answer helps? |
Thank you for response! I'll try to quickly create a simplified environment and check myself. |
I can confirm that in simplified environment it works: |
@dsame this was not a bug, but a race between multiple workflows. I have a job This resulted in the situation I've described in issue. To fix this, I propose to add configurable cache prefixes, like that: #358. I've also describe a workaround. |
Hey @dsame, I’m ok with closing this issue, thank you! |
Description:
Having cache enabled, I see that output of
go build -v
contains every package, including ones from standard library, even with enabled cache (I've restarted particular successful job to ensure that cache is available).Package cache is working as expected, no re-downloads are in logs.
Also I've inspected logs to be 100% sure that
go-build
cache is attempted to be restored.Is there a possibility that build cache is extracted under wrong path?
Action version:
Platform:
Runner type:
Tools version:
go1.20.x
Repro steps:
I've also set up cache manually for another repo:
This worked well, go build was ~1s: https://github.com/gotd/testbot/actions/runs/4520023665/jobs/7960859969
Expected behavior:
Go compiler can use build cache to speed up compilation.
Actual behavior:
Go compiler is building every package, build cache is not used.
The text was updated successfully, but these errors were encountered: