Skip to content

Conversation

@samypr100
Copy link
Collaborator

@samypr100 samypr100 commented Apr 7, 2025

Summary

This is a POC quick fix as proposed in #12618 (comment)

This adds a UV_CRC_MODE env var that allows enforce or lax to be set or default to none which does nothing.

Avoided reworking out the interfaces as that led to a larger change across uv-extract and uv-metadata, but longer term that's probably a better solution.

Looking at the dependency graph, uv-distribution-filename was sort-off the best place for CRC Mode, but I'd be happy to move it.

Test Plan

Updated existing crc test.

@charliermarsh charliermarsh requested review from Gankra and zanieb April 7, 2025 13:57
@charliermarsh
Copy link
Member

LGTM.

@samypr100 samypr100 marked this pull request as ready for review April 7, 2025 14:49
@charliermarsh
Copy link
Member

We should probably make this a global setting so it shows up in settings, etc. But I know that's more work, can be a TODO.

Comment on lines +8 to +10
Enforce,
/// Warn on CRC mismatch, but continue.
Lax,
Copy link
Member

Choose a reason for hiding this comment

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

I'm curious why not "Error" and "Warn" here which feel more canonical to me?

Copy link
Member

Choose a reason for hiding this comment

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

(which would also be "Ignore" instead of "None", I think)

Copy link
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'd then want a different name? UV_CRC_CHECK = error | warn | ignore? I feel less strongly about that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Happy to do the change once I'm back to personal laptop

@Gankra
Copy link
Contributor

Gankra commented Apr 7, 2025

I'm gonna put up a PR for an alternative approach.

zanieb pushed a commit that referenced this pull request Apr 7, 2025
@Gankra
Copy link
Contributor

Gankra commented Apr 7, 2025

I'm going to close this in favour of #12722, but if that fix proves insufficient this is a more robust hammer we should revisit.

@Gankra Gankra closed this Apr 7, 2025
@zanieb
Copy link
Member

zanieb commented Apr 7, 2025

Thanks for hoping on this anyway Sam.

@samypr100 samypr100 deleted the crc_mode branch April 7, 2025 19:06
zanieb pushed a commit that referenced this pull request Apr 7, 2025
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.

4 participants