Skip to content

Makefile: allow building without the web UI via WEBUI=0 - #1675

Open
Yi-111-a wants to merge 2 commits into
git-bug:trunkfrom
Yi-111-a:build-without-webui
Open

Yi-111-a wants to merge 2 commits into
git-bug:trunkfrom
Yi-111-a:build-without-webui

Conversation

@Yi-111-a

@Yi-111-a Yi-111-a commented Oct 9, 2026 •

Copy link
Copy Markdown

Closes #1578.

What was broken

//:INSTALLATION.md listed only git, go and make as build dependencies,
but //:Makefile made build, install and build/debug depend on
build-webui, which runs pnpm install && pnpm run build. On a minimal system
the documented set is therefore not sufficient, and the docs offered no way to
build without the frontend toolchain.

The no-web-ui code path already exists — //webui:assets_stub.go provides
Available = false under the !webui build tag, and git-bug webui reports a
helpful error naming make build/make install — it just wasn't reachable
from the Makefile.

What this fix does

  • Adds a WEBUI variable to //:Makefile (default 1, so default behaviour is
    byte-identical). WEBUI=0 drops the webui build tag and removes the
    build-webui prerequisite from build, install and build/debug.
  • Documents pnpm as a dependency of the default build, and adds a Building
    without the web UI
    section covering the opt-out.

Testing

  • make -n build, make -n install, make -n build/debug and make -n with
    no variable are unchanged from trunk.
  • make -n build WEBUI=0 (and the same for the other targets) emits exactly
    go generate plus the tagless go build/go install, with no pnpm step.
  • Built and ran the result: go build -ldflags "..." -o /tmp/gitbug-nofb .
    compiles clean with no web UI, git-bug version reports normally, and
    git-bug webui fails with the intended "this binary was built without the web
    UI" message.
  • go build ./..., go vet ./webui/... ./commands/..., and
    go test ./webui/... ./commands/... all pass.

Note

This changes no Go code — the !webui build tag path was already compiled and
tested on trunk, since go build/go install omit the tag by default.

//.goreleaser.yaml builds the frontend and passes the webui tag itself, so
releases are unaffected.

RetriggerConfidence Score: 5/5

The PR appears safe to merge; the previous default-target issue is fixed.

Summary

The PR adds WEBUI=0 to skip the frontend toolchain when building or installing.

  • Default builds still include the web UI.
  • INSTALLATION.md documents Node.js, pnpm, and the opt-out.
  • The latest change fixes the previous default-target issue.

Reviews (2) · Last reviewed commit: "Makefile: assign WEBUI_DEP= so 'all' sta..." · Reviewed by Greptile

The build, install and build/debug targets unconditionally depend on
build-webui, so building from source needs a Node.js/pnpm toolchain even
when the web UI is not wanted. The no-webui code path already exists
(webui/assets_stub.go, and 'git-bug webui' reports a helpful error), so
make it reachable.

Default behaviour is unchanged; WEBUI=0 skips build-webui and drops the
webui build tag.

//:INSTALLATION.md: document the pnpm requirement and the opt-out.
Comment thread Makefile Outdated
Declaring it as an empty target put WEBUI_DEP ahead of 'all', so
`make WEBUI=0` exited with 'Nothing to be done' without building.
@Yi-111-a

Yi-111-a commented Oct 9, 2026

Copy link
Copy Markdown
Author

Good catch — that's a real P1, and it's now fixed in c59515a.

Reproduced before the fix:

WEBUI_DEP: declares an empty target rather than clearing the variable, and sitting above all: it became the default goal, so make WEBUI=0 exited without building anything. Changed to WEBUI_DEP=, after which:

Also confirmed a real go build (no webui tag) still produces a binary whose git-bug webui prints the 'built without the web UI' message.

@Yi-111-a

Yi-111-a commented Oct 9, 2026

Copy link
Copy Markdown
Author

The pasted console blocks got eaten by shell quoting on my end — here they are again:

Reproduced before the fix:

$ make -n WEBUI=0
make: Nothing to be done for 'WEBUI_DEP'.

After WEBUI_DEP=:

$ make -n WEBUI=0
go generate
go build  -ldflags "-X main.version=..." .

$ make -n install
cd webui && pnpm install && pnpm run build
go generate
go install -tags webui -ldflags "-X main.version=..." .

This branch has not been deployed

No deployments
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.

The Build From Source documentation is out of date

2 participants