bumpdeps

command
v1.104.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2026 License: BSD-3-Clause Imports: 25 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

The bumpdeps program updates dependencies in go.mod (and, on request, the Go toolchain), tidies up afterwards, and writes a commit message describing what changed. With no arguments it bumps every direct dependency to its latest version.

It is also the brain of the bumpdep and gokrazy-bump GitHub workflows (.github/workflows/bumpdep.yml and gokrazy-bump.yml), which run it with -github and turn its outputs into a pull request.

Each argument selects something to bump. Arguments may also be comma-separated, which is how the workflow passes them through.

  • "path@version" bumps (or adds) exactly that module at that version. The version is anything go get accepts: a tag, "latest", a branch name, or a commit hash. Only "latest" goes through the safety checks below; other versions are handed to go get as is.
  • "go" updates the Go toolchain by running ./pull-toolchain.sh.
  • "wireguard-go" and "gvisor" are aliases for the modules of the same name; see aliases.
  • An exact module path already in go.mod selects that module.
  • Anything else is a case-insensitive substring of module paths: "bumpdeps kernel" considers both gokrazy kernel modules. Indirect dependencies only match with -indirect; name them exactly to bump one on its own.
  • A module path that isn't in go.mod and matches nothing is added at its latest version.

Versions come from the Go module proxy, asked concurrently. A few modules follow a branch rather than tagged releases; see specialBranches. Their head is found with git ls-remote so a just-pushed commit is picked up even if the proxy hasn't seen it yet, and the proxy then supplies the pseudo-version for that commit. Everything selected is bumped with a single "go get", followed by "make tidy" and "make updatedeps" unless -tidy=false.

The program refuses to downgrade anything. A downgrade means something went wrong (a retracted release, a stray tag) and wants a human's rollback commit, not an unattended bump.

The --exclude-newer-than-days flag is a cooldown, as described at https://nesbitt.io/2026/03/04/package-managers-need-to-cool-down.html: releases younger than that many days are ignored and the newest release old enough is used instead, so a compromised upstream has to go unnoticed for that long before we pick it up. Go's proxy only knows commit times, not upload times, so the age is measured from the commit the version points at. Branch-tracked modules have no older release to fall back to, so they're held until their head is old enough.

Indirect dependencies are only updated as far as the direct ones pull them, unless -indirect is set or they're named explicitly. Bumping them individually to @latest tends to break the build, since their importers haven't necessarily caught up. (github.com/gobwas/glob v1.0.0 removed packages that github.com/goreleaser/fileglob still imports, for instance.)

Modules with a replace directive are left alone, as are modules the proxy doesn't know about (such as private modules) and modules whose latest release declares a different module path (renamed projects).

Running

From the repo root:

./tool/go run ./misc/bumpdeps                      # all direct deps
./tool/go run ./misc/bumpdeps gvisor wireguard-go  # just those two
./tool/go run ./misc/bumpdeps -issue https://github.com/tailscale/tailscale/issues/123 go

The last form prints a commit message with an "Updates #123" line.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL