-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Regression in 0.4.23: data did not match any variant of untagged enum CacheInfoWire #8367
Comments
Thanks for the bisect! |
Are you somehow sharing a cache across multiple uv versions? |
Like somehow writing to the cache from |
I think that's very likely what's happening. Your [[package]]
name = "uv"
version = "0.4.15" So the outer |
I think you need to either use 0.4.15 in your project (to match home-assistant), or use different cache directories between your top-level |
Alternatively we could decide to change our policy (written up here) so that versions like 0.4.15 are expected to be able to read cache data from 0.4.23. |
(I'm not opposed to changing the policy, it just means more frequent cache version bumps.) |
Wow, that's a good catch! I don't know how it got into Edit: I found it's a dependency of |
Basically the issue here is that some downstream dependency may add different version of I wonder if |
I actually just ran into this while working on typeshed. Typeshed has |
We should probably just change our cache versioning policy to make this less likely. |
…#8386) ## Summary Going forward, we're going to provide better versioning guarantees around using the same cache across multiple uv versions, so this PR updates the docs to reflect that. It also bumps the `sdists-` version to fix the inconvenience demonstrated in astral-sh#8367. Closes astral-sh#8367.
@charliermarsh I may be reading the policy wrong, but it kinda implies that if two version have incompatible cache formats, then they will use different subfolders within the root cache folder to avoid errors. Which is what I'd expect. I am not concerned about extra gigabytes of duplicate data sitting around as long as it helps uv "just work". But now it seems that either I am reading the text wrong, or. the reality is different. I have pretty much the same case as @AlexWaygood - the most recent version of uv installed and used globally (e.g. for quick scripts), but locked older versions in many a project. The latter randomly fail to uv sync. I imagine adding forward compatibility may be really hard. Wonder if you could just treat the UV_CACHE as root folder, but really place cache under versioned subfolders, maybe versioned to a specific uv version to keep it really simple and stupid. Whatever is the case, the amount of reduced testing/ci/frustration time that uv already brought definitely worth these minor inconveniences. So no complains really! Absolutely lovely stuff you are all making! |
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! |
My Github Actions CI started failing with this error:
I bisected it to 0.4.23 here: KapJI/homeassistant-stubs#496
This is an example workflow,
enable-cache: false
, other settings forastral-sh/setup-uv
are default, it's usingubuntu-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 butUV_CACHE_DIR
was set bysetup-uv
.cache-local-path
, also with no result.The text was updated successfully, but these errors were encountered: