uv/crates
samypr100 23b8fc9d18
Add a Windows manifest to uv binaries (#16894)
## Summary

Currently we do not include a Windows manifest on the uv binary for
windows builds. This can cause problems such as the one in
https://github.com/astral-sh/uv/issues/16877 which can limit what uv can
do for some Windows operations (e.g. symlinks) that can have
restrictions imposed by the OS unbeknownst to us and make it none
obvious to isolate the issue.

Given we already do this for the `uv-trampoline`, we should also do it
for uv. In the case of uv, I opted for explicit entries in the manifest
rather than using the defaults embed_manifest crate provides which are
not appropriate in all general cases.

The manifest now includes declarations for:
* Explicit "system" codepage declaration to retain backwards compat with
previous uv releases. We should move to utf-8 codepage in the future to
align with `uv-trampoline`, but it's arguably a breaking change in rare
cases. We shouldn't have issues with using utf-8 as we don't really rely
on *A calls to begin with.
* Explicit Windows 10+ support to ensure the executables are not treated
as a legacy, preventing application compatibility layers being wrongly
applied to it all the way back to NT 6.0 (Windows Vista). Note, other
Windows compatibility entries do not imply support, rather they imply
awareness as a preventive measure.
* Long Path support to avoid Windows operations assuming
[MAX_PATH](https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation)
applies. This still requires the system to have long paths enabled via
``HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem@LongPathsEnabled``
dword being set to ``1`` (see
[ref](https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation#registry-setting-to-enable-long-paths)).
* Standard invoker execution levels for CLI applications to disable UAC
virtualization after including the manifest.

The resulting manifest is the following

```xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" 
    xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" manifestVersion="1.0">
    <assemblyIdentity name="uv" type="win32" version="0.9.13.0"></assemblyIdentity>
    <asmv3:trustInfo>
        <asmv3:security>
            <asmv3:requestedPrivileges>
                <asmv3:requestedExecutionLevel level="asInvoker" uiAccess="false"></asmv3:requestedExecutionLevel>
            </asmv3:requestedPrivileges>
        </asmv3:security>
    </asmv3:trustInfo>
    <asmv3:application>
        <asmv3:windowsSettings>
            <longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
        </asmv3:windowsSettings>
    </asmv3:application>
    <ms_compatibility:compatibility xmlns:ms_compatibility="urn:schemas-microsoft-com:compatibility.v1" 
        xmlns="urn:schemas-microsoft-com:compatibility.v1">
        <ms_compatibility:application xmlns:ms_compatibility="urn:schemas-microsoft-com:compatibility.v1">
            <ms_compatibility:supportedOS xmlns:ms_compatibility="urn:schemas-microsoft-com:compatibility.v1" Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"></ms_compatibility:supportedOS>
            <ms_compatibility:supportedOS xmlns:ms_compatibility="urn:schemas-microsoft-com:compatibility.v1" Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"></ms_compatibility:supportedOS>
            <ms_compatibility:supportedOS xmlns:ms_compatibility="urn:schemas-microsoft-com:compatibility.v1" Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"></ms_compatibility:supportedOS>
            <ms_compatibility:supportedOS xmlns:ms_compatibility="urn:schemas-microsoft-com:compatibility.v1" Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"></ms_compatibility:supportedOS>
        </ms_compatibility:application>
    </ms_compatibility:compatibility>
</assembly>
```

For reference, here's `cargo`'s manifest from 1.91

```xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" 
    xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
    <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
        <security>
            <requestedPrivileges>
                <requestedExecutionLevel level="asInvoker" uiAccess="false"></requestedExecutionLevel>
            </requestedPrivileges>
        </security>
    </trustInfo>
    <asmv3:application>
        <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings" 
            xmlns:ws2="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
            <ws2:longPathAware>true</ws2:longPathAware>
            <activeCodePage>UTF-8</activeCodePage>
        </asmv3:windowsSettings>
    </asmv3:application>
    <ms_compatibility:compatibility xmlns:ms_compatibility="urn:schemas-microsoft-com:compatibility.v1" 
        xmlns="urn:schemas-microsoft-com:compatibility.v1">
        <ms_compatibility:application xmlns:ms_compatibility="urn:schemas-microsoft-com:compatibility.v1">
            <ms_compatibility:supportedOS xmlns:ms_compatibility="urn:schemas-microsoft-com:compatibility.v1" Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"></ms_compatibility:supportedOS>
            <ms_compatibility:supportedOS xmlns:ms_compatibility="urn:schemas-microsoft-com:compatibility.v1" Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"></ms_compatibility:supportedOS>
            <ms_compatibility:supportedOS xmlns:ms_compatibility="urn:schemas-microsoft-com:compatibility.v1" Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"></ms_compatibility:supportedOS>
            <ms_compatibility:supportedOS xmlns:ms_compatibility="urn:schemas-microsoft-com:compatibility.v1" Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"></ms_compatibility:supportedOS>
        </ms_compatibility:application>
    </ms_compatibility:compatibility>
</assembly>
```

Closes #16877

## Test Plan

Before changes on Windows 11 25H2 (without
SeCreateSymbolicLinkPrivilege)

```console
$ uv init
$ uv add jupyterlab-widgets==3.0.16 --link-mode=symlink
...
Resolved 2 packages in [TIME]
error: Failed to install: jupyterlab_widgets-3.0.16-py3-none-any.whl (jupyterlab-widgets==3.0.16)
  Caused by: failed to symlink file from [CACHE_DIR]\archive-v0\aQcqEjLJAkVwuSzohqymc\jupyterlab_widgets-3.0.16.data\data\share\jupyter\labextensions\@jupyter-widgets\jupyterlab-manager\static\packages_base_lib_index_js-webpack_sharing_consume_default_jquery_jquery.5dd13f8e980fa3c50bfe.js to [ROOT]\.venv\Lib\site-packages\jupyterlab_widgets-3.0.16.data\data\share\jupyter\labextensions\@jupyter-widgets\jupyterlab-manager\static\packages_base_lib_index_js-webpack_sharing_consume_default_jquery_jquery.5dd13f8e980fa3c50bfe.js: A required privilege is not held by the client. (os error 1314)
```

Before changes on Windows 11 25H2 (with SeCreateSymbolicLinkPrivilege)

```console
$ uv init
$ uv add jupyterlab-widgets==3.0.16 --link-mode=symlink
...
Resolved 2 packages in [TIME]
error: Failed to install: jupyterlab_widgets-3.0.16-py3-none-any.whl (jupyterlab-widgets==3.0.16)
  Caused by: failed to symlink file from [CACHE_DIR]\archive-v0\aQcqEjLJAkVwuSzohqymc\jupyterlab_widgets-3.0.16.data\data\share\jupyter\labextensions\@jupyter-widgets\jupyterlab-manager\static\packages_base_lib_index_js-webpack_sharing_consume_default_jquery_jquery.5dd13f8e980fa3c50bfe.js to [ROOT]\.venv\Lib\site-packages\jupyterlab_widgets-3.0.16.data\data\share\jupyter\labextensions\@jupyter-widgets\jupyterlab-manager\static\packages_base_lib_index_js-webpack_sharing_consume_default_jquery_jquery.5dd13f8e980fa3c50bfe.js: The parameter is incorrect. (os error 87)
```

After changes on Windows 11 25H2 (with or without
SeCreateSymbolicLinkPrivilege)

```console
$ uv init
$ uv add jupyterlab-widgets==3.0.16 --link-mode=symlink
...
Resolved 2 packages in [TIME]
Installed 1 package in [TIME]
 + jupyterlab-widgets==3.0.16
```
2025-12-01 14:02:35 -06:00
..
uv Add a Windows manifest to uv binaries (#16894) 2025-12-01 14:02:35 -06:00
uv-auth Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-bench Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-bin-install Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-build Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-build-backend Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-build-frontend Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-cache Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-cache-info Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-cache-key Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-cli Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-client Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-configuration Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-console Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-dev Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-dirs Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-dispatch Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-distribution Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-distribution-filename Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-distribution-types Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-extract Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-flags Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-fs Use 0o666 permissions for flock files instead of 0o777 (#16845) 2025-12-01 12:09:43 -06:00
uv-git Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-git-types Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-globfilter Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-install-wheel Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-installer Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-keyring Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-logging Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-macros Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-metadata Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-normalize Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-once-map Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-options-metadata Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-pep440 Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-pep508 Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-performance-memory-allocator Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-platform Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-platform-tags Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-preview Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-publish Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-pypi-types Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-python Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-redacted Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-requirements Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-requirements-txt Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-resolver Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-scripts Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-settings Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-shell Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-small-str Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-state Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-static Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-tool Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-torch Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-trampoline Use `.rcdata` to store trampoline type + path to python binary (#15068) 2025-11-09 08:12:40 -06:00
uv-trampoline-builder Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-types Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-version Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-virtualenv Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-warnings Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
uv-workspace Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
README.md Link to Dependency specifiers instead of PEP 508 (#8411) 2024-10-21 14:43:38 -04:00

README.md

Crates

uv-bench

Functionality for benchmarking uv.

uv-cache-key

Generic functionality for caching paths, URLs, and other resources across platforms.

uv-distribution-filename

Parse built distribution (wheel) and source distribution (sdist) filenames to extract structured metadata.

uv-distribution-types

Abstractions for representing built distributions (wheels) and source distributions (sdists), and the sources from which they can be downloaded.

uv-install-wheel-rs

Install built distributions (wheels) into a virtual environment.

uv-once-map

A waitmap-like concurrent hash map for executing tasks exactly once.

uv-pep440-rs

Utilities for interacting with Python version numbers and specifiers.

uv-pep508-rs

Utilities for parsing and evaluating dependency specifiers, previously known as PEP 508.

uv-platform-tags

Functionality for parsing and inferring Python platform tags as per PEP 425.

uv-cli

Command-line interface for the uv package manager.

uv-build-frontend

A PEP 517-compatible build frontend for uv.

uv-cache

Functionality for caching Python packages and associated metadata.

uv-client

Client for interacting with PyPI-compatible HTTP APIs.

uv-dev

Development utilities for uv.

uv-dispatch

A centralized struct for resolving and building source distributions in isolated environments. Implements the traits defined in uv-types.

uv-distribution

Client for interacting with built distributions (wheels) and source distributions (sdists). Capable of fetching metadata, distribution contents, etc.

uv-extract

Utilities for extracting files from archives.

uv-fs

Utilities for interacting with the filesystem.

uv-git

Functionality for interacting with Git repositories.

uv-installer

Functionality for installing Python packages into a virtual environment.

uv-python

Functionality for detecting and leveraging the current Python interpreter.

uv-normalize

Normalize package and extra names as per Python specifications.

uv-requirements

Utilities for reading package requirements from pyproject.toml and requirements.txt files.

uv-resolver

Functionality for resolving Python packages and their dependencies.

uv-shell

Utilities for detecting and manipulating shell environments.

uv-types

Shared traits for uv, to avoid circular dependencies.

uv-pypi-types

General-purpose type definitions for types used in PyPI-compatible APIs.

uv-virtualenv

A venv replacement to create virtual environments in Rust.

uv-warnings

User-facing warnings for uv.

uv-workspace

Workspace abstractions for uv.

uv-requirements-txt

Functionality for parsing requirements.txt files.