Skip to content

Renovate reads the Bun of packageManager once; toolbox installs that Bun - #15

Merged
firsttris merged 2 commits into
mainfrom
renovate-bun-group
Nov 4, 2026
Merged

firsttris merged 2 commits into
mainfrom
renovate-bun-group

Conversation

@firsttris

@firsttris firsttris commented Nov 4, 2026 •

Copy link
Copy Markdown
Owner

Renovate's bun manager already reads "packageManager": "bun@x.y.z" in app/package.json as the npm package bun (also in the subfolder: no unknown-engines skip in the run below). The extra regex manager read the same line a second time, so two dependencies edited it. This drops the regex manager; the Bun group matches bun already, so its grouping was right and stays so.

Test

A Renovate 44.211.0 lookup run (--platform=local --dry-run=lookup) on a copy of the Bun-related files with Bun pinned back to 1.3.0, checking the branch of every Bun update and that packageManager is read by one manager only (the check of firsttris/fernsicht#18 and firsttris/stellwerk#26, extended by the second point).

Before (origin/main):

bun app/package.json: bun 1.3.0 -> renovate/bun
regex app/package.json: bun 1.3.0 -> renovate/bun
FAIL: packageManager of app/package.json read by bun and regex
FAIL: 1 problem(s)
exit 1

After (this branch):

bun app/package.json: bun 1.3.0 -> renovate/bun
ok: every Bun update in renovate/bun, packageManager read once
exit 0

renovate-config-validator --strict (Renovate 44.211.0): Config validated successfully.

Toolbox and Debian setup install the Bun of packageManager

packaging/toolbox.sh and the Debian lines of docs/development.md installed the newest Bun (curl … | bash), not the one CI runs. They now read the version from "packageManager" in app/package.json with sed (no jq/node) and pass the release tag to the official installer (bash -s bun-v<version>; $1 is the tag in src/runtime/cli/install.sh of oven-sh/bun). The toolbox keeps a Bun that already has that version.

Test: runs toolbox.sh and the docs' Debian line from a copy, with stubs for toolbox, curl, bash and bun (nothing downloaded or installed), and checks the installer command line.

Before (origin/main):

FAIL no Bun yet: installs packageManager's (1.4.4): got [bash  <- curl -fsSL https://bun.sh/install], want [bash -s bun-v1.4.4 <- curl -fsSL https://bun.sh/install]
FAIL other Bun (1.2.9): installs 1.4.4: got [nothing], want [bash -s bun-v1.4.4 <- curl -fsSL https://bun.sh/install]
ok   Bun 1.4.4 there: nothing to do: (nothing)
FAIL packageManager without a space (bun@1.3.0): got [bash  <- curl -fsSL https://bun.sh/install], want [bash -s bun-v1.3.0 <- curl -fsSL https://bun.sh/install]
FAIL docs, Debian line (bun@1.3.0): got [bash  <- curl -fsSL https://bun.sh/install], want [bash -s bun-v1.3.0 <- curl -fsSL https://bun.sh/install]
exit 1

After:

ok   no Bun yet: installs packageManager's (1.4.4): bash -s bun-v1.4.4 <- curl -fsSL https://bun.sh/install
ok   other Bun (1.2.9): installs 1.4.4: bash -s bun-v1.4.4 <- curl -fsSL https://bun.sh/install
ok   Bun 1.4.4 there: nothing to do: (nothing)
ok   packageManager without a space (bun@1.3.0): bash -s bun-v1.3.0 <- curl -fsSL https://bun.sh/install
ok   docs, Debian line (bun@1.3.0): bash -s bun-v1.3.0 <- curl -fsSL https://bun.sh/install
exit 0
Test script
#!/usr/bin/env bash
# Test of the Bun install in packaging/toolbox.sh and the Debian line of docs/development.md. Runs
# them from a copy with stubs for toolbox, curl, bash and bun: nothing is downloaded or installed.
# Usage: bun-install-test.sh <repo> <git ref>
set -euo pipefail
W=$1; REF=$2; T=$(mktemp -d); trap 'rm -rf "$T"' EXIT; fail=0
check() { if [[ "$2" == "$3" ]]; then echo "ok   $1: ${2:-(nothing)}"; else echo "FAIL $1: got [${2:-nothing}], want [$3]"; fail=1; fi; }
mkdir -p "$T/repo" "$T/stub" "$T/home/.bun/bin"
git -C "$W" archive "$REF" packaging/toolbox.sh app/package.json docs/development.md | tar -x -C "$T/repo"
want=$(grep -o '"packageManager": "bun@[^"]*"' "$T/repo/app/package.json" | cut -d@ -f2 | tr -d '"')
# ~/.bun/bin is on PATH, as after the installer has set up .bashrc
# toolbox: runs only the Bun step (`toolbox run -c NAME bash -c CMD` with bun in CMD), with the stubs
cat > "$T/stub/toolbox" <<'S'
#!/bin/sh
[ "$1 $2 $4 $5" = "run -c bash -c" ] || exit 0
case "$6" in *bun*) exec sh -c "$6" ;; esac
S
printf '#!/bin/sh\necho "curl $*"\n' > "$T/stub/curl"
printf '#!/bin/sh\necho "bash $* <- $(cat)"\n' > "$T/stub/bash"
chmod +x "$T/stub/"*
run() { env -i PATH="$T/stub:$T/home/.bun/bin:/usr/bin:/bin" HOME="$T/home" "$@" 2>&1; }
toolbox_sh() { run /usr/bin/bash "$T/repo/packaging/toolbox.sh" | grep -E '^(bash|curl) ' || true; }  # only what installs
inst() { echo "bash -s bun-v$1 <- curl -fsSL https://bun.sh/install"; }
check "no Bun yet: installs packageManager's ($want)" "$(toolbox_sh)" "$(inst "$want")"
printf '#!/bin/sh\necho 1.2.9\n' > "$T/home/.bun/bin/bun"; chmod +x "$T/home/.bun/bin/bun"
check "other Bun (1.2.9): installs $want" "$(toolbox_sh)" "$(inst "$want")"
printf '#!/bin/sh\necho %s\n' "$want" > "$T/home/.bun/bin/bun"
check "Bun $want there: nothing to do" "$(toolbox_sh)" ""
rm "$T/home/.bun/bin/bun"
sed -i 's/"packageManager": "bun@[^"]*"/"packageManager":"bun@1.3.0"/' "$T/repo/app/package.json"
check "packageManager without a space (bun@1.3.0)" "$(toolbox_sh)" "$(inst 1.3.0)"
line=$(grep -m1 'bun.sh/install' "$T/repo/docs/development.md" | sed 's/^ *//; s/ && cargo install just$//' || true)
if [[ -n "$line" ]]; then
  check "docs, Debian line (bun@1.3.0)" "$(cd "$T/repo" && run sh -c "$line")" "$(inst 1.3.0)"
else echo "--   docs/development.md installs no Bun"; fi
exit $fail

https://claude.ai/code/session_01Y3rdfbWb1xDUdPRng7TX9Z


Generated by Claude Code

Renovate's bun manager already reads "packageManager": "bun@x.y.z" of app/package.json as
the npm package `bun`, so the regex manager for the same line extracted it a second time and both
edited it. Drop the regex manager; the Bun group matches `bun` already. As in
firsttris/fernsicht#18 and firsttris/stellwerk#26.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y3rdfbWb1xDUdPRng7TX9Z
packaging/toolbox.sh and the Debian lines of docs/development.md installed the newest Bun, so a
fresh toolbox could run another Bun than CI (setup-bun with bun-version-file) and the Renovate Bun
PR. Read the version from "packageManager" in app/package.json with sed and hand the official
installer its release tag (`bash -s bun-v<version>`, the $1 of src/runtime/cli/install.sh in
oven-sh/bun); the toolbox keeps a Bun that already has that version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y3rdfbWb1xDUdPRng7TX9Z
@firsttris
firsttris merged commit 3aa22e7 into main Nov 4, 2026
6 checks passed
@firsttris
firsttris deleted the renovate-bun-group branch November 4, 2026 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants