Skip to content

Renovate: Bun of packageManager in the Bun group; toolbox installs that Bun - #21

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

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 Bun group matched only oven-sh/bun (the regex managers), so bun went into the monthly, self-merging renovate/minor-patch group without the Flatpak's Bun binaries, while the regex manager for the same line read it a second time. This drops that regex manager and adds bun to the Bun group; the Flatpak's Bun archives (oven-sh/bun, regex manager on the manifest) stay in it.

The oven-sh/bun lookups (github-releases) could not run here: Renovate wants a GitHub token for them and this session has no GitHub API access to oven-sh/bun (github-token-required below). Their group rule is unchanged (matchPackageNames still names oven-sh/bun).

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/minor-patch
regex app/package.json: oven-sh/bun 1.3.0 -> (no update: github-token-required)
regex flatpak/io.github.firsttris.pd200x-control.yml: oven-sh/bun 1.3.0 -> (no update: github-token-required)
FAIL: packageManager of app/package.json read by bun and regex
FAIL: 2 problem(s)
exit 1

After (this branch):

bun app/package.json: bun 1.3.0 -> renovate/bun
regex flatpak/io.github.firsttris.pd200x-control.yml: oven-sh/bun 1.3.0 -> (no update: github-token-required)
ok: every Bun update in renovate/bun, packageManager read once
exit 0

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

Toolbox installs the Bun of packageManager

packaging/toolbox.sh already passed the version to the installer, but skipped the install whenever any Bun was on PATH (an older Bun stayed), and with "packageManager":"bun@…" written without a space it built an empty tag (bun-v, i.e. the newest Bun). It now compares the installed version with packageManager, reads it with an optional space (still sed, no jq/node) and stops when none is found. $1 of the official installer is the release tag (src/runtime/cli/install.sh in oven-sh/bun). docs/development.md has no Bun install line to change.

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

Before (origin/main):

ok   no Bun yet: installs packageManager's (1.4.4): 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 -s bun-v <- curl -fsSL https://bun.sh/install], want [bash -s bun-v1.3.0 <- curl -fsSL https://bun.sh/install]
--   docs/development.md installs no Bun
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
--   docs/development.md installs no Bun
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

Generated by Claude Code

Renovate's bun manager already reads "packageManager": "bun@x.y.z" of app/package.json as
the npm package `bun`. The Bun group matched only oven-sh/bun (the regex managers), so `bun` went
into the monthly, self-merging minor-patch group without the Flatpak's Bun binaries, and the
regex manager for the same line edited it a second time. Drop that regex manager and add `bun` to
the group, 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
…here

packaging/toolbox.sh skipped the install whenever any Bun was on PATH, so a toolbox kept an older
Bun than CI (setup-bun with bun-version-file) and the Renovate Bun PR, and with "packageManager"
written without a space it handed the installer an empty tag (`bun-v`), i.e. the newest Bun.
Compare the installed version with packageManager, read it with an optional space and stop when
none is found. The installer's $1 is the release tag (src/runtime/cli/install.sh in oven-sh/bun).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y3rdfbWb1xDUdPRng7TX9Z
@firsttris
firsttris merged commit f8c94e3 into main Nov 4, 2026
4 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