Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ and verify your installation.
- [MacOS](#macos)
- [Windows](#windows)
- [Build from source](#build-from-source)
- [Build without the web UI](#build-without-the-web-ui)
- [Verify your installation](#verify-your-installation)

<!-- mdformat-toc end -->
Expand Down Expand Up @@ -210,6 +211,13 @@ dependencies:
- `git`
- `go`
- `make`
- `nodejs` and `pnpm`, for the web UI only; see
[below](#build-without-the-web-ui) if you don't need it

The exact versions used in development are pinned in `.tool-versions`, if you
use [`asdf`][asdf] then `asdf install` will install them for you. `asdf install`
only supplies the pinned versions for plugins you already registered, so run
the plugin registrations from [`CONTRIBUTING.md`][contrib] once beforehand.

Ensure that the `go` binary directory (`$GOPATH/bin`) is in your `PATH`. It is
recommended to set this within your shell configuration file(s), such as
Expand Down Expand Up @@ -325,6 +333,44 @@ This will build <code>git-bug</code> and place it in your Go binary directory.

</details>

### Build without the web UI<a name="build-without-the-web-ui"></a>

The `install` and `build` targets in `//:Makefile` compile the web UI first,
which is where the `nodejs` and `pnpm` dependencies come from. The web UI is
optional: the assets are embedded behind the `webui` build tag, so building
without that tag gives you a binary that works for everything except
`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!

target 'nowebui'`. Check out `trunk`, or another revision that carries the
target, and then run it from `//:Makefile` instead of `install`:

<details><summary>Build <strong>without the web UI</strong></summary>

<pre>
make nowebui
</pre>

Like <code>make build</code>, this leaves the binary in the working directory
rather than installing it, so move it wherever you want it on your
<code>PATH</code>, for example your Go binary directory. <code>make</code> does
not create that directory for you, so create it first on a fresh Go setup:

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

The binary is stamped with the same version as <code>make install</code>, but
lacks the embedded web UI. Running <code>git bug webui</code> on it prints an
explanatory message instead of serving a broken page.

</details>

If you'd rather keep the web UI but skip the Node.js toolchain, download a
[pre-compiled release binary](#download-a-pre-compiled-release-binary) instead.

## Verify your installation<a name="verify-your-installation"></a>

To verify that `git-bug` was installed correctly, you can run the following
Expand Down Expand Up @@ -359,6 +405,7 @@ ______________________________________________________________________
[arc/openbsd_amd64]: https://github.com/git-bug/git-bug/releases/download/v0.11.0/git-bug_0.11.0_openbsd_amd64.tar.gz
[arc/windows_amd64]: https://github.com/git-bug/git-bug/releases/download/v0.11.0/git-bug_0.11.0_windows_amd64.zip
[arc/windows_arm64]: https://github.com/git-bug/git-bug/releases/download/v0.11.0/git-bug_0.11.0_windows_arm64.zip
[asdf]: https://asdf-vm.com/guide/getting-started.html
[bin/darwin_amd64]: https://github.com/git-bug/git-bug/releases/latest/download/git-bug_darwin_amd64
[bin/darwin_arm64]: https://github.com/git-bug/git-bug/releases/latest/download/git-bug_darwin_arm64
[bin/freebsd_amd64]: https://github.com/git-bug/git-bug/releases/latest/download/git-bug_freebsd_amd64
Expand All @@ -372,6 +419,7 @@ ______________________________________________________________________
[bin/windows_amd64]: https://github.com/git-bug/git-bug/releases/latest/download/git-bug_windows_amd64.exe
[bin/windows_arm64]: https://github.com/git-bug/git-bug/releases/latest/download/git-bug_windows_arm64.exe
[brew.sh]: https://brew.sh
[contrib]: ./CONTRIBUTING.md
[cosign]: https://docs.sigstore.dev/cosign/system_config/installation/
[docs/home]: ./doc
[p/arch-repo]: https://archlinux.org/packages/extra/x86_64/git-bug/
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ install: build-webui
go generate
go install -tags webui -ldflags "$(LDFLAGS)" .

# build without the embedded web UI (no Node.js / pnpm needed)
.PHONY: nowebui
nowebui:
go generate
go build -ldflags "$(LDFLAGS)" .

.PHONY: secure
secure:
go tool govulncheck ./...
Expand Down