Skip to content

Retain and respect settings in tool upgrades - #5937

Merged
charliermarsh merged 2 commits into
mainfrom
charlie/index-receipt
Aug 9, 2024
Merged

charliermarsh merged 2 commits into
mainfrom
charlie/index-receipt

Conversation

@charliermarsh

Copy link
Copy Markdown
Member

Summary

We now persist the ResolverInstallerOptions when writing out a tool receipt. When upgrading, we grab the saved options, and merge with the command-line arguments and user-level filesystem settings (CLI > receipt > filesystem).

@charliermarsh
charliermarsh requested review from konstin and zanieb August 8, 2024 21:32
@charliermarsh charliermarsh added enhancement New feature or improvement to existing functionality preview Experimental behavior labels Aug 8, 2024
Comment thread crates/uv/tests/tool_install.rs Outdated

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I don't know, I guess? So the receipt represents the "most recent" settings.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

fwiw for the lockfile we only write non-default values

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think updating here makes sense.

Comment thread crates/uv/tests/tool_install.rs Outdated

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Hard to say what the right behavior is here. We could also consider discarding the tool whenever settings differ.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is really tough. It seems okay to change after some user feedback. I'm leaning towards consistent --upgrade / --reinstall semantics where it is required to change the versions. This matches uv pip install, yes?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Now that we have upgrade, I'm sort of open to making install more aggressive about replacing though.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That makes sense too.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

So we could make it replace whenever the settings or versions differ...

Comment thread crates/uv-settings/src/settings.rs Outdated

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We go through some effort to avoid adding --upgrade to tool receipts. Does that seem right? Otherwise, uv tool install black --upgrade saves upgrade in the receipt...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes that would be weird.

@charliermarsh
charliermarsh force-pushed the charlie/index-receipt branch from ac8b266 to 8dc4c57 Compare August 8, 2024 21:52
Comment thread crates/uv/tests/tool_install.rs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

fwiw for the lockfile we only write non-default values

@zanieb

zanieb commented Aug 9, 2024

Copy link
Copy Markdown
Member

I will review this morning.

@charliermarsh

Copy link
Copy Markdown
Member Author

Would most appreciate review of the correct / desired behaviors.

Comment thread crates/uv/tests/tool_install.rs Resolved
Comment thread crates/uv/tests/tool_install.rs Outdated
Comment on lines 2465 to 2470

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Aside: We should probably open an issue to define a macro for this, since it's non-trivial and repeated.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah good idea. I can do it.

@zanieb

zanieb commented Aug 9, 2024

Copy link
Copy Markdown
Member

Sorry got half way through this then had meetings and forgot — reading now.

@charliermarsh
charliermarsh force-pushed the charlie/index-receipt branch from e609011 to 492088e Compare August 9, 2024 18:02
@charliermarsh
charliermarsh enabled auto-merge (squash) August 9, 2024 18:03
@charliermarsh
charliermarsh force-pushed the charlie/index-receipt branch from 492088e to 4cf3560 Compare August 9, 2024 18:14
@charliermarsh
charliermarsh merged commit f89403f into main Aug 9, 2024
@charliermarsh
charliermarsh deleted the charlie/index-receipt branch August 9, 2024 18:21
@codspeed

codspeed Bot commented Aug 9, 2024

Copy link
Copy Markdown

CodSpeed Performance Report

Merging #5937 will degrade performances by 11.18%

Comparing charlie/index-receipt (4cf3560) with main (4df0fe9)

Summary

❌ 2 regressions
✅ 12 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark main charlie/index-receipt Change
❌ wheelname_tag_compatibility[flyte-long-incompatible] 1.4 µs 1.6 µs -11.15%
❌ wheelname_tag_compatibility[flyte-short-incompatible] 926.9 ns 1,043.6 ns -11.18%

zanieb pushed a commit that referenced this pull request Sep 14, 2026
The resolved `IndexLocations` type still implements Serde even though
configuration and tool receipts serialize their input options instead.
These derives were added alongside the resolved tool settings in
#5937; the parent settings derives were removed in
#7442. Remove the unused implementation without changing
configuration or receipt formats.

Co-authored-by: zaniebot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or improvement to existing functionality preview Experimental behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants