Skip to content

uv: Stop forcing UV_* env vars on update#8322

Closed
l46983284-cpu wants to merge 2 commits into
ScoopInstaller:masterfrom
l46983284-cpu:fix/uv-no-overwrite-env-8116
Closed

uv: Stop forcing UV_* env vars on update#8322
l46983284-cpu wants to merge 2 commits into
ScoopInstaller:masterfrom
l46983284-cpu:fix/uv-no-overwrite-env-8116

Conversation

@l46983284-cpu

Copy link
Copy Markdown
Contributor

Prerequisites

  • Use conventional PR title: <manifest-name[@version]|chore>: <general summary of the pull request>
  • I have read the Contributing Guide

Summary

uv currently uses env_set for UV_CACHE_DIR / UV_PYTHON_* / UV_TOOL_*, so every Scoop update overwrites user-chosen locations (issue #8116). That breaks multi-drive layouts and existing tool/cache paths.

This PR:

  • removes the forced env_set block (users keep their existing UV_* values)
  • adds persist for cache / python / tools so Scoop-managed data still survives updates if used
  • keeps PATH installer/uninstaller hooks for the shims dirs
  • documents optional self-managed UV_* in notes

Closes #8116

Test plan

  • uv.json parses as JSON
  • Windows: install/update uv no longer rewrites pre-set UV_CACHE_DIR
  • PATH shims dirs still added when present

Scoop env_set overwrote user UV_CACHE_DIR / UV_PYTHON_* / UV_TOOL_* on
every update (ScoopInstaller#8116). Drop env_set so existing user locations stay put,
keep PATH installer hooks, and persist cache/python/tools folders.

Closes ScoopInstaller#8116

Signed-off-by: Alex Chen <l46983284@gmail.com>
Address Stage A nit: sibling manifests put bin ahead of persist.

Signed-off-by: Alex Chen <l46983284@gmail.com>
@l46983284-cpu

Copy link
Copy Markdown
Contributor Author

/verify

@github-actions

Copy link
Copy Markdown
Contributor

All changes look good.

Wait for review from human collaborators.

uv

  • Lint
  • Description
  • License
  • Hashes
  • Checkver
  • Autoupdate
  • Autoupdate Hash Extraction

Check the full log for details.

@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The uv Scoop manifest no longer forces UV_* environment variables. It now documents manual configuration, persists cache, python, and tools, and retains the existing uv, uvx, and uvw executable bindings.

Changes

UV persistence configuration

Layer / File(s) Summary
Update manifest persistence behavior
bucket/uv.json
Manifest notes now describe manual UV_* configuration, persisted subpaths, and conditional PATH shims. The env_set block is replaced with persist entries for cache, python, and tools, while the existing executable bindings remain unchanged.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The manifest changes match #8116 by removing forced env vars and preserving user-managed cache/tool locations.
Out of Scope Changes check ✅ Passed The PR only changes the uv manifest notes and persistence behavior, with no obvious unrelated additions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title is concise, specific, and accurately summarizes the main change to the uv manifest.
Description check ✅ Passed The PR description includes the required summary, issue link, prerequisites, and test plan.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@z-Fng z-Fng changed the title uv: stop forcing UV_* env vars on update uv: Stop forcing UV_* env vars on update Jul 19, 2026
@z-Fng z-Fng closed this Jul 19, 2026
@z-Fng

z-Fng commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

As discussed in #7653 (comment), setting these environment variables is the expected behavior. Rather than reverting the previous changes, a better approach would be implementing the logic to avoid overriding existing UV_* environment variables (#8053 (comment)) within Scoop-Core.

@l46983284-cpu

Copy link
Copy Markdown
Contributor Author

Thanks, that makes sense — I was treating #8116 as a manifest-level fix for the #7653 env_set block, but I understand now that those UV_* defaults are intentional Scoop-managed behavior and the right fix is set-if-unset logic in Scoop-Core.

I'm happy to work on that approach (only set UV_* values when the user hasn't already defined them), as discussed in #8053. I can open a Core issue or PR for it if that's useful — otherwise I'll leave Main alone and won't reopen a wipe-style change here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: uv update overwrites env vars

2 participants