Skip to content

Fix Qlot cache restore with Qlot >= 1.8 (dangling symlinks in .qlot) - #42

Merged
svetlyak40wt merged 3 commits into
40ants:masterfrom
deril:fix/qlot-cache-dangling-symlinks
Oct 22, 2026
Merged

svetlyak40wt merged 3 commits into
40ants:masterfrom
deril:fix/qlot-cache-dangling-symlinks

Conversation

@deril

@deril deril commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Only affects Qlot 1.8.0 or later, i.e. jobs that set qlot-version: latest or a 1.8.x version. The default qlot-version (0.11.5) keeps sources inside .qlot/ and isn't affected.

With cache: true and Qlot >= 1.8.0, every run that hits the Qlot cache fails on the first quickload:

Can't create directory .../.qlot/dists/quicklisp/software/prove-20200218-git,
  a file with the same name already exists.

The cache-miss run that saved the cache passes, so it looks flaky.

Cause: Qlot 1.8 moves sources into ~/.cache/qlot/ and leaves symlinks in .qlot/dists/*/software/ (src/cache.lisp, save-release-to-cache). We cache .qlot/ but not ~/.cache/qlot/, so the restored links are dangling.

Fix:

  • add ~/.cache/qlot/ to the Qlot cache paths, next to ~/.cache/common-lisp/. Like that entry, it covers the default Unix location only: on Windows (UIOP puts the cache under xdg-data-home) or with QLOT_CACHE_DIRECTORY set, Qlot uses another directory.
  • bump cache-suffix to v10, so broken caches already saved aren't reused.
  • drop a stray path: | line from the default cache paths.

Testing: this repo's PR runs use the default qlot-version, so they won't reproduce the bug. I ran a throwaway workflow in my fork (Qlot 1.8.4, sbcl-bin, qlfile with ql alexandria): https://github.com/deril/setup-lisp/actions/runs/39813733122

  • attempt 1: cache miss, fresh install, passed on Ubuntu
  • attempt 2: restored the v10 Qlot cache (the case that failed before), skipped qlot install, and (ql:quickload :alexandria) loaded through the restored symlinks, passed on Ubuntu

The macOS job failed in both attempts inside qlot install (The alien function "ASN1_STRING_data" is undefined, an OpenSSL binding issue on the runner) before any caching, so it says nothing about this change. Windows isn't tested.

deril added 2 commits October 20, 2026 12:02
Qlot 1.8 keeps sources in ~/.cache/qlot/ and symlinks them into .qlot/.
Only .qlot/ is cached, so a cache hit restored dangling symlinks and the
first quickload failed. Set QLOT_NO_CACHE=1 so Qlot copies sources into
.qlot/, and bump the cache suffix to drop already broken caches.
@svetlyak40wt

Copy link
Copy Markdown
Member

Hi, thanks for the contribution.

I'd prefer to add ~/.cache/qlot/ or a $XDG_CACHE_HOME/qlot to the cache paths, because otherwise we will have to download packages on each action invocation even if qlfile.lock was not changed.

Also drop the stray 'path: |' line from the qlot-cache-paths default.
@deril

deril commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

Thanks, done: the action now caches ~/.cache/qlot/ together with .qlot/ and no longer sets QLOT_NO_CACHE.

For the record, the previous version didn't re-download on a cache hit either: .qlot/ was cached and both install steps are skipped on a hit. But keeping Qlot's default shared-cache behaviour is nicer.

Like the existing ~/.cache/common-lisp/ entry, this covers the default Unix location only; on Windows (UIOP puts the cache under xdg-data-home) or with QLOT_CACHE_DIRECTORY set, Qlot uses another directory.

I also removed a stray path: | line from the default cache paths.

Tested with Qlot 1.8.4 on ubuntu-latest: a cold run, then a warm run that restored the cache, skipped qlot install and loaded a qlfile dependency through the restored symlinks.

@svetlyak40wt

Copy link
Copy Markdown
Member

Hmm, CI tests started to output this error:

Unhandled MISSING-DEPENDENCY in thread #<SB-THREAD:THREAD tid=2892 "main thread" RUNNING {1200CF0083}>: Component "40ants-asdf-system" not found, required by NIL

I believe this is not caused by your changes. I'll try to fix these error before merging the PR.

@svetlyak40wt
svetlyak40wt merged commit 467ad4f into 40ants:master Oct 22, 2026
3 of 19 checks passed
@svetlyak40wt

Copy link
Copy Markdown
Member

Merged as part of #43

@svetlyak40wt

Copy link
Copy Markdown
Member

By the way, I've moved v4 tag to the latest commit, now this fix has an effect.

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