Fix Windows cache path validation after Rollup migration - #355
Conversation
## Summary - update all `Swatinem/rust-cache` references to the commit from Swatinem/rust-cache#355 - retain the previously pinned cdylib/rlib caching fixes - validate the Windows cache path fix in r-polars, which uses Cargo paths on `C:` and a workspace target on `D:` ## Context The previous rust-cache commit fails during the Windows post step with: ```text Error: Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved. ``` Swatinem/rust-cache#355 reproduces the failure and fixes the Rollup bundle to share the ESM-compatible `@actions/glob` dependency with the GitHub cache provider. Its save/restore integration tests pass on Linux, macOS, and Windows.
Swatinem
left a comment
There was a problem hiding this comment.
lgtm, though I’m still quite confused why the different versions would behave differently depending on how they are being imported/bundled?
do you know why that is?
|
I think the issue was not that the same version behaved differently depending on how it was imported or bundled, but that a different version of |
Swatinem
left a comment
There was a problem hiding this comment.
instead of fixing this in the bundling step, how about using an npm override, so we end up with only one version in the lockfile as well, or rather 2, as I see that warpcache is depending on an even older version there.
Something like https://github.com/Swatinem/rollup-plugin-dts/blob/1fb93d05d64aacb020613751a14ef3a3fb9926fd/package.json#L76-L80
21b9407 to
9eff1ef
Compare
Swatinem
left a comment
There was a problem hiding this comment.
looks good, maybe it needs one final rebase, as I was also committing and rebuilding things in the meantime.
9eff1ef to
22a41db
Compare
Summary
@actions/globfor the GitHub cache provider during Rollup bundlingRoot cause
@actions/cache@6.0.1depends on@actions/glob@0.6.1, while rust-cache directly depends on@actions/glob@0.7.0. After the Rollup migration, both versions were bundled separately. The older copy uses a CommonJS default import forminimatch; its bundled path matcher returns no matches for existing Windows cache paths. This makessaveCache()report:The existing CI did not detect this because its cache keys were already populated, so post steps exited at
Cache up-to-date.without exercisingsaveCache().The Rollup resolver now maps only the
@actions/cacheimport of@actions/globto the direct ESM-compatible 0.7.0 dependency. The warpbuild provider retains its own dependency.Verification
Before the fix, the new Windows workflow reproduced the path validation error in run 28695048315. After the fix, run 28695186191:
full match: trueThe regression workflow now covers save and exact restore on all three operating systems.
Test plan