Makefile RawHistoryFolder

1.PHONY: build test vet race mocks mocks-check spv-check fakes-check arch check perf-check bin tty logs pkg install
2
3# 0 runs until quit; set e.g. TTY_TIMEOUT=60s for a safety net.
4TTY_TIMEOUT ?= 0
5comma := ,
6# Go runtime profiles for tty runs; set PPROF= to disable.
7PPROF ?= localhost:6060
8RUNS := $(or $(XDG_STATE_HOME),$(HOME)/.local/state)/neferwl/runs/drm
9
10# Build a fresh binary with the git revision embedded.
11bin:
12	CGO_ENABLED=0 go build -o bin/neferwl ./cmd/neferwl
13
14# Run on the current TTY. Quit: Ctrl+Alt+Backspace (or the quit bind).
15# TTY_DEBUG adds narrow categories, e.g. TTY_DEBUG=drm-flip.
16tty: bin
17	./bin/neferwl --backend=drm --debug=all$(if $(TTY_DEBUG),$(comma)$(TTY_DEBUG)) --timeout=$(TTY_TIMEOUT) $(if $(PPROF),--pprof=$(PPROF)); \
18	echo "exit $$? - log: $(RUNS)/latest.log"
19
20# Summarise the last run: lifecycle, warnings and errors.
21logs:
22	@jq -r 'select(.level != "debug") | "\(.time) \(.level) [\(.component)] \(.message) \(del(.time,.level,.component,.message) | tostring)"' $(RUNS)/latest.log
23build:
24	CGO_ENABLED=0 go build ./...
25test:
26	CGO_ENABLED=0 go test ./...
27vet:
28	CGO_ENABLED=0 go vet ./...
29race:
30	# cgo is enabled only for the race test binary.
31	CGO_ENABLED=1 go test -race ./...
32MOCKS := internal/mocks ':(glob)internal/**/*_mock_test.go'
33# Regenerate from scratch so mocks of removed interfaces disappear too.
34mocks:
35	rm -rf internal/mocks
36	find internal -name '*_mock_test.go' -delete
37	$(HOME)/go/bin/mockery
38# Generated mocks must be committed and up to date.
39mocks-check: mocks
40	git diff --exit-code -- $(MOCKS)
41	@test -z "$$(git ls-files --others --exclude-standard -- $(MOCKS))"
42# Committed SPIR-V must match the GLSL shaders (needs glslc).
43spv-check:
44	go generate ./internal/adapters/vulkan
45	git diff --exit-code -- 'internal/adapters/vulkan/shaders/*.spv'
46# Test doubles come from Mockery only: no handwritten fake/stub/spy types.
47# Matches `type fakeX`, `\ttype RendererStub[T any]` and `spyX struct` in `type (` blocks.
48# grep exit 1 (no match) passes; 0 (match) and 2 (error) fail.
49FAKES := ^\s*type\s+\w*(fake|stub|spy|dummy|mock)\w*|^\s*\w*(fake|stub|spy|dummy|mock)\w*(\[[^]]*\])?\s+(struct|interface)\b
50fakes-check:
51	@rc=0; grep -rniE '$(FAKES)' --include='*_test.go' --exclude='*_mock_test.go' internal cmd || rc=$$?; \
52	[ $$rc -eq 1 ] || { [ $$rc -eq 0 ] && echo 'handwritten test double: add an interface and a Mockery entry (see AGENTS.md)' >&2; exit 1; }
53arch:
54	$(HOME)/go/bin/hexcheck -hexcheck.config .hexcheck.yaml -hexcheck.root . ./...
55# Fast, mandatory guards for tiled content publications and SHM copies.
56perf-check:
57	CGO_ENABLED=0 go test ./internal/app ./internal/adapters/drm ./internal/adapters/vulkan ./internal/adapters/wayland -run '^(TestOutputRoutingAllocations|TestReportSeenAllocations|TestFrameLifecycleTransitionsAllocations|TestFullscreenShownAllocations|TestFrameDecisionAllocations|TestShownBySnapshotAllocations|TestDueFramesAllocations|TestRenderSteadyStateAllocations|TestSceneWalkUnchangedTiledSHM|TestTiledCommitPublishAllocations|TestCapturedCommitApplyAllocations|TestCapturedViewportApplyAllocations|TestEffectiveInputEmptyTreeAllocations|TestHeadlessTiledSHMCallbackAndCopyBudget)$$' -count=1
58check: vet test arch fakes-check perf-check
59
60# Arch package of the committed HEAD (packaging/arch/PKGBUILD). Go modules
61# come from the module proxy in prepare(); the build itself runs offline.
62# pacman-ordered version: 0.0.0.r<commits>.g<hash>; a tag replaces 0.0.0.
63pkg: SHELL := bash
64pkg: .SHELLFLAGS := -eo pipefail -c
65pkg:
66	@test -z "$$(git status --porcelain)" || echo "warning: uncommitted changes are not packaged" >&2
67	v=$$(t=$$(git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//; s/-/_/g'); \
68		echo "$${t:-0.0.0}.r$$(git rev-list --count HEAD).g$$(git rev-parse --short HEAD)"); \
69	d=$$(mktemp -d /tmp/neferwl-pkg.XXXXXX); trap 'rm -rf "$$d"' EXIT; \
70	git archive --prefix=neferwl-$$v/ -o "$$d/neferwl-$$v.tar.gz" HEAD; \
71	cp packaging/arch/PKGBUILD packaging/neferwl.install "$$d/"; \
72	cd "$$d" && sed -i "s/^pkgver=.*/pkgver=$$v/; s/^sha256sums=.*/sha256sums=('$$(sha256sum *.tar.gz | cut -d' ' -f1)')/" PKGBUILD; \
73	makepkg -f --noconfirm; mkdir -p $(CURDIR)/dist; rm -f $(CURDIR)/dist/neferwl-*.pkg.tar.zst; mv *.pkg.tar.zst $(CURDIR)/dist/
74	@ls dist/*.pkg.tar.zst
75
76# Build the package, then install it with pacman (asks for sudo).
77install: pkg
78	sudo pacman -U dist/neferwl-*.pkg.tar.zst

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 23

Tags 10

↑↓ moveenter openesc close