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

Fix the cache broken by the ociref changes #37

Merged
merged 1 commit into from
Mar 25, 2024

Conversation

tianon
Copy link
Member

@tianon tianon commented Mar 25, 2024

This was broken by #32 😇

One part of the code was storing keys in our sync.Map as a string and the other as a Reference so they never matched. 😭

If sync.Map had been written in the brave new world of Go generics, we'd have a compilation error to help us catch this. 🤦

We could get clever with something like a --network=none container that forces builds to use the cache, but it's a bit complex to set up correctly (so instead I think we should wait for the eventual sync/v2 upstream Go package or fork/write/switch to a separate "generic" / type-safe sync.Map package in the future).

See also golang/go#47657, golang/go#48287

image

😇

One part of the code was storing keys in our `sync.Map` as a `string` and the other as a `Reference` so they never matched. 😭

If `sync.Map` had been written in the brave new world of Go generics, we'd have a compilation error to help us catch this. 🤦

We *could* get clever with something like a `--network=none` container that forces `builds` to use the cache, but it's a bit complex to set up correctly (so instead I think we should wait for the eventual `sync/v2` upstream Go package or fork/write/switch to a separate "generic" / type-safe `sync.Map` package in the future).
@tianon tianon requested a review from yosifkit as a code owner March 25, 2024 23:26
@yosifkit yosifkit merged commit 078126a into docker-library:main Mar 25, 2024
1 check passed
@yosifkit yosifkit deleted the fix-cache branch March 25, 2024 23:29
@tianon
Copy link
Member Author

tianon commented Mar 25, 2024

image

😂

@tianon
Copy link
Member Author

tianon commented Mar 25, 2024

Even better (more fair "most of the runs" comparison):

image

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