Skip to content

docs(install): document the web UI build dependencies - #1651

Open
Yi-111-a wants to merge 4 commits into
git-bug:trunkfrom
Yi-111-a:docs/build-from-source-deps
Open

Yi-111-a wants to merge 4 commits into
git-bug:trunkfrom
Yi-111-a:docs/build-from-source-deps

Conversation

@Yi-111-a

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

Copy link
Copy Markdown

Summary

INSTALLATION.md's Build from source section listed git, go and make
as the only dependencies, but the install target that the section tells you to
run pulls in the web UI first, and that needs Node.js and pnpm:

.PHONY: build-webui
build-webui:
	cd webui && pnpm install && pnpm run build

.PHONY: install
install: build-webui

So the documented steps fail on a minimal system at make install with pnpm
missing. This adds the two missing dependencies to the list, points at
.tool-versions for the pinned versions, and answers the second half of the
issue: building without the web UI is already possible, it just isn't written
down.

Changes

INSTALLATION.md and //:Makefile.

  • nodejs and pnpm added to the dependency list, marked as web-UI-only, with
    a pointer to the new section below. Also links .tool-versions (which pins
    golang, nodejs, pnpm and goreleaser) and the asdf install shortcut,
    matching how CONTRIBUTING.md points at the same file.
  • New nowebui target in //:Makefile that runs go generate +
    go build without the webui tag, so it needs no Node.js toolchain.
  • New "Build without the web UI" section under Build from source, plus its
    entry in the mdformat TOC. It documents make nowebui as the alternative to
    make install.

nowebui builds, it does not install

nowebui is go build, not go install, so it is consistent with the other
targets in the file:

target needs Node.js/pnpm tags result
build yes webui binary in the working tree
build/debug yes webui binary in the working tree
install yes webui binary in $(go env GOPATH)/bin
nowebui no none binary in the working tree

Only install writes to GOPATH/bin, which is what the surrounding
Build from source section already tells you to put on your PATH. The new
section therefore ends with a mv into that directory rather than claiming the
target did it for you.

Why building without the web UI works

The embedded assets sit behind a build tag, so the package compiles with an empty
asset set when the tag is absent:

// webui/assets.go
//go:build webui
//go:embed all:dist
var assets embed.FS
// webui/assets_stub.go
//go:build !webui
const Available = false

That behaviour is already documented in CONTRIBUTING.md; this makes
INSTALLATION.md agree with it instead of contradicting it, and gives it the
pointer from the issue.

Verification

make nowebui on a fresh clone with no node_modules and no pnpm install:

$ make nowebui
Generating documentation...
  - ManPage: ok
  - Markdown: ok
Generating completion files ...
  - ZSH: ok
  - PowerShell: ok
  - Bash: ok
  - Fish: ok
go build -ldflags "-X main.version="v0.11.0-44-g94e69a4-dirty"" .

$ ls git-bug
git-bug

$ git-bug version
git-bug v0.11.0-44-g94e69a4-dirty 94e69a419603/dirty go1.26.0 linux amd64

$ git-bug webui
Error: this binary was built without the web UI

The web UI is a separate frontend that has to be built with Node.js and
compiled into the binary. Binaries produced by "go build" or "go install" do
not include it.
...

Confirmed alongside the binary: nothing was written to $(go env GOPATH)/bin,
and mv git-bug "$(go env GOPATH)/bin" — the instruction the new section gives —
works.

One caveat is called out in the new section rather than left for users to trip
over: git bug version reports undefined for a binary built without the
Makefile, because getVersion() in //:version.go runs git describe output
through semver.IsValid after adding a v prefix, so only an exact release tag
produces a version string. Going through make nowebui keeps the -ldflags
stamping and reports v0.11.0-44-g94e69a4-dirty above, so this only affects
anyone who bypasses the Makefile.

Because go generate is part of the target, and the CI Check generated files
are up to date
step regenerates doc/man, doc/md and misc/completion:
those three paths are byte-identical after running go generate without the
webui tag, so dropping the tag does not churn committed generated output.

CI

  • gofmt -l . clean (no Go source changed).
  • Generated-file freshness gate unaffected, as above.
  • make build-webui, the pnpm test suite and make secure are untouched.

Refs #1578

RetriggerConfidence Score: 5/5

The PR appears safe to merge; the remaining documentation error is non-blocking.

Findings

  1. P2 Wrong command in release warning ▶
Summary

The PR documents the web UI’s Node.js and pnpm build dependencies and adds a nowebui target and installation instructions.

  • The updated instructions address the three previously reported gaps: release-tag compatibility, creation of the Go binary directory, and asdf plugin setup.
  • The release-tag warning names the wrong command for the error it quotes.

Reviews (2) · Last reviewed commit: "docs(install): fix three gaps in the wit..."

@MichaelMure

Copy link
Copy Markdown
Contributor

Make sense overall but adding a make nowebui target would fix the version problem, and would simplify those extra explanations. Would you mind making those changes?

@Yi-111-a

Yi-111-a commented Oct 1, 2026

Copy link
Copy Markdown
Author

Thanks — added in 94e69a4.

  • New make nowebui target: go generate + go install -ldflags "$(LDFLAGS)" (same version stamping as make install, no webui tag / no Node.js or pnpm).
  • INSTALLATION.md now points at make nowebui instead of bare go install ., and drops the undefined version caveat.

Comment thread Makefile Outdated
.PHONY: nowebui
nowebui:
go generate
go install -ldflags "$(LDFLAGS)" .

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think a target named nowebui should install. If you look at the others, make or make all build the binary locally. make install does the same but also install. You would expect make nowebui to simply build locally.

I think that's fine to not install, and instruct the user to move the binary where needed, like in other parts of the INSTALLATION instructions.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done — you're right that nowebui shouldn't install. go build instead of go install, so the target now sits with the others:

target needs Node.js/pnpm tags result
build yes webui binary in the working tree
build/debug yes webui binary in the working tree
install yes webui binary in $(go env GOPATH)/bin
nowebui no none binary in the working tree

//:Makefile is now four lines apart in the same shape as build, differing only in dropping build-webui and the tag.

INSTALLATION.md no longer claims the target put the binary anywhere. It says it lands in the working directory like make build does, and ends with the move, using the Go binary directory the surrounding section already tells you to put on your PATH:

mv git-bug "$(go env GOPATH)/bin"

Ran it rather than assuming:

  • make nowebui exits 0 on a fresh clone, no node_modules, no pnpm install.
  • ./git-bug is present; $(go env GOPATH)/bin untouched (the binary there is from an earlier session, older mtime).
  • git-bug version → v0.11.0-44-g94e69a4-dirty, so the -ldflags stamping survives.
  • git-bug webui → Error: this binary was built without the web UI + the explanation.
  • mv git-bug "$(go env GOPATH)/bin" verified to work from a copy.

One thing I checked because the target runs go generate: CI's Check generated files are up to date step regenerates doc/man, doc/md and misc/completion. Those three paths are byte-identical after go generate without the webui tag, so dropping the tag doesn't churn committed output. gofmt -l . clean too, and no Go source changed.

I also corrected a claim in the previous body: it said the version reports undefined and framed the section around bare go install .. That was right for bypassing the Makefile but wrong for the target, which stamps the version — it now documents make nowebui and keeps the undefined caveat scoped to the bypass case.

Yi-111-a and others added 3 commits October 3, 2026 04:26
The 'Build from source' section listed only git, go and make, but the
'install' and 'build' targets in the Makefile run 'build-webui' first,
which needs Node.js and pnpm. On a minimal system the documented steps
fail at 'make install' with pnpm missing.

Also document how to build without the web UI, which is possible because
the embedded assets sit behind the 'webui' build tag: 'go install .' on
a fresh clone needs nothing beyond git and go, and 'git bug webui' on
that binary explains itself instead of serving a broken page. This is
already described in CONTRIBUTING.md; INSTALLATION.md now agrees with
it rather than contradicting it.

Refs git-bug#1578
The install docs previously pointed at bare `go install .`, which skips
the Makefile's git-describe ldflags and leaves `git bug version` as
undefined. A dedicated nowebui target keeps the same stamping as
`make install` without pulling in Node.js/pnpm, so INSTALLATION.md can
drop the version caveat.
Following MichaelMure's review on git-bug#1651: a target named `nowebui` should
behave like `build`, which leaves the binary in the working tree, and
only `install` should install. `nowebui` now runs `go build` instead of
`go install`, so it lines up with `build` and `build/debug` and differs
from them only in dropping `build-webui` and the `webui` tag.

INSTALLATION.md now says so, and tells the reader to move the binary onto
their PATH (the Go binary directory the surrounding section already
describes) rather than claiming it is placed there for them.

Verified: `make nowebui` exits 0 and leaves ./git-bug; nothing is written
to $(go env GOPATH)/bin; the version stamp is unchanged
(v0.11.0-44-g94e69a4-dirty); `git bug webui` still prints the
no-web-UI message. `go generate` without the tag leaves doc/man, doc/md
and misc/completion byte-identical, so the generated-files CI gate is
unaffected. `gofmt -l .` is clean and no Go source changed.
@Yi-111-a
Yi-111-a force-pushed the docs/build-from-source-deps branch from 94e69a4 to a27570e Compare October 2, 2026 20:26
Comment thread INSTALLATION.md Outdated
Comment thread INSTALLATION.md Outdated
Comment thread INSTALLATION.md Outdated
- `nowebui` is newer than every release tag, so tell readers to check out a
  revision that carries it instead of leaving `make` to fail with
  "No rule to make target 'nowebui'" on v0.11.0 and older.
- Create the Go binary directory before moving the binary. Without it,
  `mv git-bug "$(go env GOPATH)/bin"` renames the binary to a *file* named
  `bin` and exits 0, so the command never lands on PATH.
- `asdf install` only supplies versions for already-registered plugins, so
  point at the registrations in CONTRIBUTING.md.
@Yi-111-a

Yi-111-a commented Oct 3, 2026

Copy link
Copy Markdown
Author

Follow-up on a4bc2a7. MichaelMure: nowebui now builds rather than installs, per your note.

Three review comments landed on a27570e after my last reply, so they are folded in here:

  1. nowebui is missing on release tags. Correct, and worse than the comment says: it is absent from every tag. v0.11.0 is the newest release, and git show v0.11.0:Makefile | grep nowebui is empty, so the section now says to check out trunk or another revision that carries the target instead of leaving make to fail with No rule to make target 'nowebui'.

  2. Missing Go binary directory. Reproduced rather than assumed, with the target directory deliberately absent:

    $ mv git-bug <missing-dir>/bin     # old form
    mv exit=0
    git-bug still here? no
    f <missing-dir>/bin                # a *file* named bin
    

    It exits 0 with no warning, so the binary silently never reaches PATH. The snippet now creates the directory first:

    mkdir -p "$(go env GOPATH)/bin"
    mv git-bug "$(go env GOPATH)/bin/"
    

    Same run with mkdir -p in place puts the binary at <dir>/bin/git-bug.

  3. asdf install needs the plugins registered first. The sentence overstated what the shortcut does on its own. It now points at the plugin registrations in CONTRIBUTING.md, via a new [contrib] reference link in the same style as the other definitions in the file.

Still docs-only, no Go source changed.

Comment thread INSTALLATION.md
`git bug webui`, and needs nothing beyond `git`, `go` and `make`.

The `nowebui` target is newer than every release tag, so none of them have it:
checking out `v0.11.0` or older and running `make` fails with `No rule to make

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Wrong command in release warning On v0.11.0 or an older tag, bare make runs the default web-UI build. The quoted No rule to make target 'nowebui' error occurs with make nowebui instead. Naming the wrong command could confuse readers trying to understand why the web-UI-free build is unavailable on a release tag.

Suggested change
checking out `v0.11.0` or older and running `make` fails with `No rule to make
checking out `v0.11.0` or older and running `make nowebui` fails with `No rule to make

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

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.

2 participants