axodotdev / axodotdev/axoupdater

Switching from a `cargo-home` to `flat` layout breaks updates

Open
#210 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
31
Forks
13
PR merge metrics
No merged PRs in 30d

Description

In uv 0.4.30, we used the default install path resulting in the following receipt:

```json
{
"binaries": [
"uv",
"uvx"
],
"binary_aliases": {},
"cdylibs": [],
"cstaticlibs": [],
"install_layout": "cargo-home",
"install_prefix": "/Users/zb/.cargo",
"modify_path": true,
"provider": {
"source": "cargo-dist",
"version": "0.23.0"
},
"source": {
"app_name": "uv",
"name": "uv",
"owner": "astral-sh",
"release_type": "github"
},
"version": "0.4.30"
}
```

In uv 0.5.0, we switched to a `flat` layout by specifying target install paths. However, this results in unexpected update behavior. `uv self update` places the executables in `~/.cargo` instead of `~/.cargo/bin`. The previous version's executables are not removed. The receipt contains the new version so subsequent update attempts fail.

This appears to be caused by not loading the `install_layout` from the receipt at https://github.com/axodotdev/axoupdater/blob/d45201fcba097307272e1dc09be78471fe6efbc1/axoupdater/src/receipt.rs#L69-L71

The layout is not passed to the installer and it is hard-coded to `flat`: https://gist.github.com/zanieb/9dca39f62651087794bbb31fa377d72a#file-uv-installer-sh-L1018-L1020

The update results in the receipt:

```json
{
"binaries": [
"uv",
"uvx"
],
"binary_aliases": {},
"cdylibs": [],
"cstaticlibs": [],
"install_layout": "flat",
"install_prefix": "/Users/zb/.cargo",
"modify_path": true,
"provider": {
"source": "cargo-dist",
"version": "0.25.1"
},
"source": {
"app_name": "uv",
"name": "uv",
"owner": "astral-sh",
"release_type": "github"
},
"version": "0.5.0"
}
```

This may be related to https://github.com/axodotdev/axoupdater/issues/113

Contributor guide

Open the contributing guide

Research direction

Start by tracing receipt loading in axoupdater/src/receipt.rs around lines 69-71 and the installer invocation shown around lines 1018-1020 of the linked script. Reproduce an update from the cargo-home layout to the flat layout, then verify that the selected layout is honored, old executables are removed, and the resulting receipt matches the installation.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, shell
Domain
cli, release, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.