Skip to content
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

Fails to cache on macos-13 #18

Closed
flaviojs opened this issue May 2, 2024 · 8 comments
Closed

Fails to cache on macos-13 #18

flaviojs opened this issue May 2, 2024 · 8 comments
Assignees

Comments

@flaviojs
Copy link

flaviojs commented May 2, 2024

The post step of this github action fails on macos-13 with:

Error: Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.

No idea what command line is being tried, it is printed in the other 2 successful cases but not in this case.

Workflow (clipped):

# ...
jobs:
  build-linux:
    name: Linux
    runs-on: ubuntu-latest
    steps:
    # ...
    - name: Install dependencies (rust)
      uses: moonrepo/setup-rust@v1
      with:
        targets: x86_64-unknown-linux-gnu
        components: clippy,rustfmt
    # ...

  build-macos:
    name: MacOS
    runs-on: macos-13 # macos-latest/macos-14 has an ARM cpu (Apple M1) but we want an AMD64 cpu
    steps:
    # ...
    - name: Install dependencies (rust)
      uses: moonrepo/setup-rust@v1
      with:
        targets: x86_64-apple-darwin
        components: clippy,rustfmt
    # ...

  build-cygwin:
    name: Cygwin
    runs-on: windows-latest
    steps:
    # ...
    - name: Install dependencies (rust)
      uses: moonrepo/setup-rust@v1
      with:
        targets: x86_64-pc-windows-gnu
        components: clippy,rustfmt
    # ...
@flaviojs
Copy link
Author

flaviojs commented May 2, 2024

The successful cases have a tar command line where this one fails.
The macos-13 runner has tar available with version:

bsdtar 3.5.3 - libarchive 3.5.3 zlib/1.2.11 liblzma/5.0.5 bz2lib/1.0.8

@milesj
Copy link
Contributor

milesj commented May 2, 2024

If you run it in GHA with debug mode on, do the logs reveal anything?

@milesj milesj self-assigned this May 2, 2024
@flaviojs
Copy link
Author

flaviojs commented May 3, 2024

Nope, I got the same information.
Probably this action and its dependencies do not log/trace the path(s) before the error is triggered.

@flaviojs
Copy link
Author

flaviojs commented May 3, 2024

I got a list of all the files in the runner and the two paths that can be cached do not exist.
Doing mkdir ~/.cargo/registry silences the error, so at least one cache path needs to exist to avoid the error.

I'm at the start of a conversion from C to rust.
The crate does not exist in the repo yet, so ~/.cargo/registry is only created when needed?
The crate will not be in the repo root, so (github_workspace)/target/debug will not exist.
A way to set the crate/workspace dir (or dirs) would be helpful for non-root use cases, but that is out of scope for this issue.

@milesj
Copy link
Contributor

milesj commented May 3, 2024

This should maybe do it: #19

I'm not 100% sure how GH handles loading cache with paths that were skipped.

@milesj
Copy link
Contributor

milesj commented May 3, 2024

Ok I tagged those changes, retry the pipeline and see if it works.

@flaviojs
Copy link
Author

flaviojs commented May 3, 2024

It works, thanks. 👍

@milesj
Copy link
Contributor

milesj commented May 3, 2024

Sweet, thanks for reporting.

@milesj milesj closed this as completed May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants