Skip to content

uv self update fails in MSYS2 environment #12686

Open

Description

@wilson

Summary

I installed uv using the standalone installation script.
This is Windows 10, MSYS2. uv 0.6.12 (e4e03833f 2025-04-02)

When running uv self update, I get:
warning: Self-update is only available for uv binaries installed via the standalone installation scripts.

% command -v uv
/c/Users/Wilson/.local/bin/uv

This is maybe a bug related to my strange platform? The standalone installer script has direct MSYS2 support, and that code looked correct to me, so I'm not sure where the exact root is.

Platform

Windows 10: MINGW64_NT-10.0-19045 3.6.0-529a0f09.x86_64 x86_64 Msys

Version

uv 0.6.12 (e4e0383 2025-04-02)

Python version

Python 3.13.2

Activity

  1. added
    bug
    on Apr 5, 2025
  2. eegli commented on May 29, 2025

    @eegli
    Contributor

    As mentioned in the linked issue above, axoupdater always tries to load the receipt from %LOCALAPPDATA%/uv/uv-receipt.json on Windows:

    let Ok(updater) = updater.load_receipt() else {

    The installation script https://astral.sh/uv/install.sh works for POSIX-compliant environments, including MSIS2 and even Git bash as a minimal subset of MSYS2. However, when running the installer scripts on Windows:

    Hence, installing via Powershell works as expected, via bash the receipt is in the "wrong" place.

    So can we simply move the receipt after installing via bash to where axoupdater expects it?

    mkdir -p $LOCALAPPDATA/uv && mv ~/.config/uv/uv-receipt.json $LOCALAPPDATA/uv/uv-receipt.json

    Running uv self update now complains with:

    The current executable is at C:\Users\xxx\.local\bin\uv.exe but the standalone installer was used to install uv to /c/Users/xxx/.local/bin. Are multiple copies of uv installed?

    Very interestingly, the receipts are equivalent except for the install_prefix value:

    • Powershell: "install_prefix": "C:\\Users\\xxx\\.local\\bin",
    • Bash: "install_prefix": "/c/Users/xxx/.local/bin",

    Which happens due to to path conversion. Setting the path in the receipt to a valid Windows path eventually works.

  3. changed the title [-]`uv self update` prints warning in MSYS2 environment[/-] [+]`uv self update` fails in MSYS2 environment[/+] on May 29, 2025
  4. zanieb commented on May 29, 2025

    @zanieb
    Member

    Thanks for the details!

    cc @Gankra

  5. eegli commented on May 29, 2025

    @eegli
    Contributor

    Enabling supporting POSIX-compliant environments is not a well-defined task. After all, should MSYS2 be considered POSIX just because it has some of the utilities?

    I generally agree with uv's opinion about configuration files - Windows is Windows, regardless of any software-defined compatibility layer on top of it, and any user/system level configuration should be read from %APPDATA% and %SYSTEMDRIVE% respectively.

    W.r.t to the installation itself, a straightforward way to support MSYS2/Git bash for uv self update would be to adjust the bash installer script to check the presence of MSYS and, if true:

    1. Move the receipt to %LOCALAPPDATA%,
    2. Perform path conversion for install_prefix

    This shouldn't break any existing settings and does not require adjusting the receipt lookup at all.

  6. Gankra commented on May 29, 2025

    @Gankra
    Contributor

    Wow incredible writeup!

  7. eegli commented on May 29, 2025

    @eegli
    Contributor

    Just realized that the installer script is autogenerated from cargo-dist. Should I raise it in the upstream repo?

    I believe this change could be made to the installer script yes:

    https://github.com/axodotdev/cargo-dist/blob/c8ba950c63f9c38c77782912ec6cdb6807bd0fbd/cargo-dist/templates/installer/installer.sh.j2#L53

    Yes, RECEIPT_HOME needs to be adjusted. Furthermore, AXO_INSTALL_PREFIX in

    https://github.com/axodotdev/cargo-dist/blob/c8ba950c63f9c38c77782912ec6cdb6807bd0fbd/cargo-dist/templates/installer/installer.sh.j2#L577

    needs to evaluate to a Windows path with escaped backslashes.

  8. zanieb commented on May 29, 2025

    @zanieb
    Member

    We're working off a fork of cargo-dist for now (the upstream is no longer maintained): https://github.com/astral-sh/cargo-dist

  9. axel-kah commented on Oct 2, 2025

    @axel-kah

    I always wondered why the update failed in my GitBash. I followed @eegli 's instructions and now I can update again 👍

    Would be great if this makes it into your cargo-dist fork.

  10. eegli commented on Nov 1, 2025

    @eegli
    Contributor

    @zanieb @Gankra since this has been open for a while, would you mind if I claim this issue and open a PR in the cargo-dist fork?

  11. eegli commented on Jun 10, 2026

    @eegli
    Contributor

    The issue is fixed in cargo-dist, all that's left to do is using v0.32+ for publishing uv: https://github.com/axodotdev/cargo-dist/releases/tag/v0.32.0

  12. wilson commented on Aug 24, 2026

    @wilson
    Author

    Very cool that there's progress on this, I look forward to re-testing it soon. Sorry for the silence after reporting it, life has been action-packed! MINGW is deprecated/gone in MSYS2 now, so that aspect will be different, but from the above, that doesn't sound like it is related to the root cause.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions