GeezerVison is showing github.com — Cannot restore linux cache with on windows with enableCrossOsArchive · Issue #1072 · actions/cache
Cannot restore linux cache with on windows with enableCrossOsArchive #1072DescriptionRelated to #984, I am facing an issue with caches created on linux and trying to restore them on windows. Please see the used workflow definition and as part of that the devonfw-actions/java-maven-setup@main version used at runtime.
Saving Log on Linux:

Restore Log on Windows:

The cache can be found by gh cli:

I would be happy for any helpful ideas forward. For sure the workaround is to rebuild everything on windows as well and cache it separately by putting the OS name into the cache key. Nonetheless, it's not sustainable to run the build all the time twice and even would lead to the fact, that eventually I will not be able to test artifacts built on linux on a different OS. Activitybishal-pdMSFT commented on Jan 13, 2023 @maybeec you are using different cache keys for linux and windows. That is causing the cache lookup to not find the right cache. You should remove ${{ matrix.os }} or similar such things which will create OS specific keys from your workflow - e.g. here maybeec commented on Jan 13, 2023 ContributorAuthor More actions @bishal-pdMSFT you are totally right, seems that I had the wrong build under observation :/
I already fixed that, but seems that night was too late to make a proper issue report :/
I updated the initial post. Sry for the inconveniences. bishal-pdMSFT commented on Jan 13, 2023 As mentioned in the logs, cache lookup fails to find a cache with same version. Since we are creating cross-os compatible archive in this case, the other factor is the paths being used for creating and restoring cache. See more about the cache matching logic here.
In this particular case, the save path is this but restore path is this. Please try with same path. maybeec commented on Jan 14, 2023 ContributorAuthor More actions maybeec commented on Jan 24, 2023 ContributorAuthor More actions Ok eventually got it to work. The summary and findings of my solution and insights gained:
If you want to use enableCrossOsArchive, you can just cache anything which is placed within the workspace folder as you cannot use relative paths like ../. In addition, there is early parameter evaluation for actions. So if you pass something like ${{ github.workspace }}/.m2/repository as cache path, it will result in an absolute path, which will not match across OS in any case.
I therefore consider cache to work properly. It was basically my issue of getting a proper solution for maven cache and the insight to not cache anything outside of the workspace. bishal-pdMSFT commented on Jan 24, 2023 Sorry, this issue flew under my radar. But good to see you able ti unblock yourself.
Yes the ${{ github.*}} gets evaluated and it may result in different absolute paths. I think it would be a good point to add to the doc here.
I am curious about your observation on ../. This should have worked if the path outside workspace remains same for different OS.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|