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

Consider CARGO_TARGET_DIR env variable #173

Open
phil-opp opened this issue Oct 25, 2023 · 1 comment
Open

Consider CARGO_TARGET_DIR env variable #173

phil-opp opened this issue Oct 25, 2023 · 1 comment

Comments

@phil-opp
Copy link

The CARGO_TARGET_DIR env variable can be set to override the directory where cargo should place the compilation artifacts (i.e. the target folder).

Setting this env variable can be useful on CI to work around disk space limitations. For example, the GitHub actions Windows CI runners have more disk space available on C: than D:, so you can move the target folder to the C: drive to avoid disk space errors on larger projects.

Unfortunately, the rust-cache action does not consider the CARGO_TARGET_DIR env variable and continues to cache a local target directory, which is now empty.

@phil-opp
Copy link
Author

The workaround is quite simple fortunately:

      - uses: Swatinem/rust-cache@v2
        with:
          cache-directories: ${{ env.CARGO_TARGET_DIR }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant