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

[2.x] Report error if output file of a cached task is not in the output directory #7539

Merged
merged 4 commits into from Apr 29, 2024

Conversation

adpi2
Copy link
Member

@adpi2 adpi2 commented Apr 17, 2024

In the ActionCache, we check that all output files are in the output directory. If they are not, we still run the task, but we print an error message saying that the task could not be cached. Also the cache summary details the number of errors.

sbt:root> compile
[success] elapsed time: 0 s, cache 0%, 1 onsite task
sbt:root> set root / target := baseDirectory.value / "custom-target"
...
sbt:root> compile
[error] Cannot cache task because its output files are outside the output directory: 
[error]   - ${BASE}/custom-target/zinc/inc_compile_3.zip
[error]   - ${BASE}/custom-target/sbt2-test_3-0.1.0-SNAPSHOT-noresources.jar
[success] elapsed time: 0 s, cache 0%, 1 error
sbt:root>

@adpi2 adpi2 force-pushed the sbt2-check-cached-file branch 3 times, most recently from bf5c53d to 16888d2 Compare April 22, 2024 14:44
@adpi2 adpi2 marked this pull request as ready for review April 23, 2024 07:58
@adpi2 adpi2 requested a review from eed3si9n April 23, 2024 07:58
Report a cache error if the output file of a task is not cacheable
@adpi2
Copy link
Member Author

adpi2 commented Apr 25, 2024

I am not sure why but Java Adopt 8 does not seem to be available on the latest MacOS runner anymore:

Run actions/setup-java@v3
Installed distributions
  Trying to resolve the latest version from remote
  Error: Could not find satisfied version for SemVer '8'. 
  Available versions: 21.0.3+9.0.LTS, 21.0.2+13.0.LTS, 21.0.1+12.0.LTS, 21.0.0+35.0.LTS, 20.0.2+9, 20.0.1+9, 20.0.0+36, 19.0.2+7, 19.0.1+10, 19.0.0+36, 18.0.2+101, 18.0.2+9, 18.0.1+10, 18.0.0+36, 17.0.11+9, 17.0.10+7, 17.0.9+9, 17.0.8+101, 17.0.8+7, 17.0.7+7, 17.0.6+10, 17.0.5+8, 17.0.4+101, 17.0.4+8, 17.0.3+7, 17.0.2+8, 17.0.1+12, 17.0.0+35, 11.0.23+9, 11.0.[22](https://github.com/sbt/sbt/actions/runs/8813675838/job/24239977527?pr=7539#step:6:23)+7.1, 11.0.22+7, 11.0.21+9, 11.0.20+101, 11.0.20+8, 11.0.19+7, 11.0.18+10, 11.0.17+8, 11.0.16+101, 11.0.16+8, 11.0.15+10

@adpi2 adpi2 requested a review from eed3si9n April 25, 2024 11:23
@eed3si9n
Copy link
Member

I guess as long as one of the tests use JDK 8 to make sure we can build, the others can use JDK 17 or whatever?

@adpi2
Copy link
Member Author

adpi2 commented Apr 29, 2024

So it seems the latest MacOS runner bumped from macos-12 to macos-14-arm64 which is why Java 8 and Python 3.7 are not available anymore.

I tried bumping to Java 11 and Python 3.12 but the job failed. I rolled back to macos-12 instead.

@adpi2
Copy link
Member Author

adpi2 commented Apr 29, 2024

It's ready to review

Copy link
Member

@eed3si9n eed3si9n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@adpi2 adpi2 merged commit 01d009d into sbt:develop Apr 29, 2024
9 checks passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants