uv: Regression in 0.4.23: data did not match any variant of untagged enum CacheInfoWire

My Github Actions CI started failing with this error:

error: Failed to build: `homeassistant-stubs @ file:///home/runner/work/homeassistant-stubs/homeassistant-stubs`
  Caused by: Failed to deserialize cache entry
  Caused by: data did not match any variant of untagged enum CacheInfoWire

I bisected it to 0.4.23 here: https://github.com/KapJI/homeassistant-stubs/pull/496

This is an example workflow, enable-cache: false, other settings for astral-sh/setup-uv are default, it’s using ubuntu-latest runner: https://github.com/KapJI/homeassistant-stubs/actions/runs/11418948703/job/31772992617

All these tools in pre-commit hook are running via uv run. In this workflow no caches were materialized but UV_CACHE_DIR was set by setup-uv.

  • I tried to remove all stored caches from the repo jsut in case with no result.
  • Also I tried using different cache-local-path, also with no result.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (10 by maintainers)

Commits related to this issue

Most upvoted comments

We should probably just change our cache versioning policy to make this less likely.

Thank you @mishamsk ❤️

The cache policy going forward is what you described in your first paragraph: if two versions have incompatible cache formats, they use different subfolders within the cache. So they shouldn’t error, but they may duplicate data.

But I just changed the policy (see the linked PR here), so it’s possible that you’re seeing breakages when sharing the cache between older uv versions.

ah, ok, that makes sense. you are just moving so fast, this PR is 4 days old, I haven’t realized that it did include the change you mentioned in a comment 😉

I’ll go ahead and update uv version on one of my projects then, was just debating if there is value to do that. Now I know there is. Thanks!