From a351e62a171c477c0d58f01183a5ad479a655f0f Mon Sep 17 00:00:00 2001 From: rootiest Date: Mon, 18 May 2026 23:34:49 -0400 Subject: [PATCH] feat(fish-deps): add uv as managed dep; install before cargo and fish MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit uv is now listed first in the catalog (before cargo and fish) so it is installed automatically before the fish source build is attempted. Install uses the official curl script; update uses `uv self update`. Catalog order is now: uv → cargo → fish → … ensuring prerequisites are in place before any dependent install method runs. README updated: uv and cargo added to the Required table, warning callout and dependency management note reflect the automatic install flow. --- README.md | 6 ++++-- functions/_fish_deps_catalog.fish | 14 +++++++------- functions/_fish_deps_install.fish | 17 +++++++++++++++++ functions/_fish_deps_update.fish | 9 +++++++++ 4 files changed, 37 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index f08b1f4..bad8ea0 100644 --- a/README.md +++ b/README.md @@ -257,7 +257,7 @@ rm -f file.txt # Falls through to standard rm -f Install method priority: **git+cargo source build** (fish) → **cargo** (other Rust tools, gets latest crate) → **system PM** (paru/apt/brew/etc.) → **git clone** (fzf) → **curl installer** (starship, fisher) → **pipx** (Python tools). When multiple methods are available for a tool, you are prompted to choose. > [!NOTE] -> Upgrading Fish from source requires **cargo** and **[uv](https://docs.astral.sh/uv/)**. If either is missing, `fish-deps install`/`update` will fall back to the system package manager instead. +> Upgrading Fish from source requires **cargo** and **[uv](https://docs.astral.sh/uv/)**. Both are managed dependencies — `fish-deps install` will offer to install them before attempting the Fish build. If both are unavailable, `fish-deps update` falls back to the system package manager. ### Docker @@ -496,6 +496,8 @@ Named context shortcuts (e.g. `dcr`, `dck`) live in `~/.config/.user-dots/fish/l | Tool | Version | Purpose | |---|---|---| +| [uv](https://docs.astral.sh/uv/) | any | Python runner (needed to build Fish from source) | +| [Rust / cargo](https://www.rust-lang.org/tools/install) | any | Installs Rust-based tools; required to build Fish | | [Fish](https://fishshell.com/) | **≥ 4.0** | Shell | | [Fisher](https://github.com/jorgebucaran/fisher) | any | Plugin manager | | [Starship](https://starship.rs/) | any | Prompt | @@ -505,7 +507,7 @@ Named context shortcuts (e.g. `dcr`, `dck`) live in `~/.config/.user-dots/fish/l > [!WARNING] > Fish **4.0 or newer is required.** This config uses `test` syntax and other constructs that are incompatible with Fish 3.x. Older versions will produce errors on startup. -> If you are on an older Fish, run `fish-deps install` or `fish-deps update` — it will build and install the latest Fish from source using git + cargo (requires cargo and uv). +> Run `fish-deps install` or `fish-deps update` to upgrade — it will install `uv` and `cargo` automatically if missing, then build the latest Fish from source. ### Recommended diff --git a/functions/_fish_deps_catalog.fish b/functions/_fish_deps_catalog.fish index 85db830..3f4cea0 100644 --- a/functions/_fish_deps_catalog.fish +++ b/functions/_fish_deps_catalog.fish @@ -11,32 +11,32 @@ # _fdc_pm — system PM package name, or "" if not in repos # _fdc_special — special install key: rustup-installer | fisher-bootstrap | # fzf-update | paru-build | pipx | curl-installer | -# git-cargo-fish | "" (none) +# git-cargo-fish | curl-uv | "" (none) # -# cargo is listed second so it is installed before Rust tools that depend on it. +# uv and cargo are listed first so both are available before fish and other Rust tools. function _fish_deps_catalog set -g _fdc_bins \ - fish cargo fisher starship fzf zoxide direnv paru \ + uv cargo fish fisher starship fzf zoxide direnv paru \ wakatime tailscale \ eza lsd bat btop dust duf prettyping most rg lazygit lazydocker trash kitty wezterm set -g _fdc_tiers \ - req req req req req req req rec \ + req req req req req req req req rec \ int int \ rec rec rec rec rec rec rec rec rec rec rec rec rec rec set -g _fdc_cargo \ - "" "" "" starship "" zoxide "" "" \ + "" "" "" "" starship "" zoxide "" "" \ "" "" \ eza lsd bat "" du-dust "" "" "" ripgrep "" "" trashy "" "" set -g _fdc_pm \ - fish cargo "" starship fzf zoxide direnv "" \ + uv cargo fish "" starship fzf zoxide direnv "" \ wakatime tailscale \ eza lsd bat btop dust duf prettyping most ripgrep lazygit lazydocker trash kitty wezterm set -g _fdc_special \ - git-cargo-fish rustup-installer fisher-bootstrap curl-installer fzf-update "" "" paru-build \ + curl-uv rustup-installer git-cargo-fish fisher-bootstrap curl-installer fzf-update "" "" paru-build \ wakatime-binary "" \ "" "" "" "" "" "" "" "" "" "" curl-lazydocker "" "" "" end diff --git a/functions/_fish_deps_install.fish b/functions/_fish_deps_install.fish index ae46e00..618e74c 100644 --- a/functions/_fish_deps_install.fish +++ b/functions/_fish_deps_install.fish @@ -47,6 +47,9 @@ function _fish_deps_install # Preferred special methods — listed before system PM so they are the default switch $special + case curl-uv + set -a methods special-uv + set -a method_labels "curl installer (official script)" case git-cargo-fish if type -q cargo; and type -q uv set -a methods special-git-cargo-fish @@ -206,6 +209,20 @@ function _fish_deps_install and makepkg -si --noconfirm and popd rm -rf $_build_dir + case special-uv + curl -LsSf https://astral.sh/uv/install.sh | sh + # Add uv to PATH for the rest of this session + for _d in "$HOME/.local/bin" "$HOME/.cargo/bin" + if test -d "$_d" + fish_add_path "$_d" + break + end + end + if not type -q uv + set_color yellow + echo " uv not yet in PATH — restart your shell if subsequent installs fail." + set_color normal + end case special-git-cargo-fish set -l _tmpdir (mktemp -d) set -l _build_ok 0 diff --git a/functions/_fish_deps_update.fish b/functions/_fish_deps_update.fish index 1837f1a..ad8e39b 100644 --- a/functions/_fish_deps_update.fish +++ b/functions/_fish_deps_update.fish @@ -93,6 +93,15 @@ function _fish_deps_update continue end + # uv: use built-in self-updater + if test "$special" = curl-uv + echo "Updating $bin..." + uv self update + set updated_any 1 + set i (math $i + 1) + continue + end + # fish: prefer build from source via git + cargo; fall back to PM if test "$special" = git-cargo-fish if type -q cargo; and type -q uv