GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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 #1072

New issue
Copy link
New issue
Copy link
Closed
Closed
Cannot restore linux cache with on windows with enableCrossOsArchive#1072
Copy link
Assignees
tiwarishub

Description

@maybeec
maybeec
opened on Jan 12, 2023
Issue body actions

Related 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:
image

Restore Log on Windows:
image

The cache can be found by gh cli:
image

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.

Activity

  1. github-actions
    assigned
    vsvipul
    on Jan 12, 2023
  2. bishal-pdMSFT commented on Jan 13, 2023

    @bishal-pdMSFT
    bishal-pdMSFT
    on Jan 13, 2023
    More actions

    @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

  3. maybeec commented on Jan 13, 2023

    @maybeec
    maybeec
    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.

  4. bishal-pdMSFT commented on Jan 13, 2023

    @bishal-pdMSFT
    bishal-pdMSFT
    on Jan 13, 2023
    More actions

    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.

  5. vsvipul
    assigned
    tiwarishub
    and unassigned
    vsvipul
    on Jan 13, 2023
  6. maybeec commented on Jan 14, 2023

    @maybeec
    maybeec
    on Jan 14, 2023
    ContributorAuthor
    More actions

    @bishal-pdMSFT, the save path vs. restore path you are refering to is not the same cache. It doesn't even have the same key.

    The logs shown above relate to build-step-saving-cache => test-step-restoring-cache, which shows the same cache key as well as the same cache path

  7. maybeec commented on Jan 24, 2023

    @maybeec
    maybeec
    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.

  8. maybeec
    closed this as completedon Jan 24, 2023
  9. bishal-pdMSFT commented on Jan 24, 2023

    @bishal-pdMSFT
    bishal-pdMSFT
    on Jan 24, 2023
    More actions

    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.

  10. maybeec
    added a commit that references this issue on Jan 27, 2023

    Added another hint to foresee actions#1072

    75b110b
  11. lvpx
    added a commit that references this issue on Jan 27, 2023

    Merge pull request #1089 from maybeec/patch-1

    8e3048d
  12. Dakshjain1
    added a commit that references this issue on Apr 19, 2024

    Added another hint to foresee actions#1072

    ce2f68e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @tiwarishub
    tiwarishub

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.