Skip to content

Validate installed sbt on disk; split cache restore/save#111

Open
arashi01 wants to merge 1 commit into
sbt:mainfrom
arashi01:validate-sbt-cache
Open

Validate installed sbt on disk; split cache restore/save#111
arashi01 wants to merge 1 commit into
sbt:mainfrom
arashi01:validate-sbt-cache

Conversation

@arashi01

@arashi01 arashi01 commented Jul 19, 2026

Copy link
Copy Markdown

Problem

Windows CI intermittently fails at Setup PATH:

Cache restored from key: Windows-sbt-2.0.2-1.1.25
...
Run cd "$SBT_TOOLPATH"
ls: cannot access 'sbt/bin/sbt': No such file or directory
Error: Process completed with exit code 2.

The distribution cache reported a hit, so Download and Install (gated on cache-dir.outputs.cache-hit) was skipped - but the restored blob had no sbt/bin/sbt. Deleting the cache only unblocks temporarily; the poisoned blob comes back; needing a manual purge via gh to unblock/fix the build.

Changes

  • Gate the install on the sbt binary on disk, not cache-hit: Download and Install self-checks sbt/bin/sbt and re-downloads on a miss or a corrupt restore.
  • Assert sbt/bin/sbt after unzip so a partial extraction fails at the install, not at Setup PATH.
  • Split the distribution actions/cache into restore + save; save runs only after a verified install, so an incomplete $SBT_TOOLPATH is never cached and the auto post-job save that created the issue is gone.
  • Bump SBT_CACHE_KEY_VERSION 1.1.251.1.26

Disk cache, Linux signature verification, and the non-Windows paths are unchanged.

@eed3si9n

Copy link
Copy Markdown
Member

Do you know where the bug is coming from? Is unzip somehow failing on Windows?

Comment thread action.yml
Comment on lines +94 to +95
# Never cache or PATH a partial extraction.
test -f "$SBT_TOOLPATH/sbt/bin/sbt"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I wonder if we can minimize this PR to this line only.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm trying this here - #112

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.

2 participants