From 5fddfa704bd45b6a1f844c9ec39073ecf3f84625 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Balv=C3=ADn?= Date: Thu, 17 Sep 2026 20:33:18 +0200 Subject: [PATCH] build: declare the exact toolchain and the canonical recipes Assisted-by: GLM 5.3 Flash --- go.mod | 4 +--- justfile | 31 ++++++++++++++----------------- 2 files changed, 15 insertions(+), 20 deletions(-) diff --git a/go.mod b/go.mod index c93f43a..377d8d8 100644 --- a/go.mod +++ b/go.mod @@ -1,7 +1,5 @@ module sourcedock.dev/petrbalvin/gasm-devkit -go 1.27 - -toolchain go1.27.1 +go 1.27.1 require golang.org/x/arch v0.30.0 diff --git a/justfile b/justfile index da635ff..e5736d6 100644 --- a/justfile +++ b/justfile @@ -1,16 +1,15 @@ -# gasm-devkit: developer tooling for Go's Plan 9 assembler (GAsm). - +# gasm-devkit. +# +# Replace gasm-devkit here and the values in the variable block. Everything below the block +# is the standard set and is identical in every repository; see the `justfile` skill. binary := "gasm" package := "./cmd/gasm" -# What the test and bench recipes sweep. The whole suite runs, so the -# packages that need hardware and the CLI glue stay under the gates. -packages := "./..." - -# The coverage floor is computed over these product packages only, so the -# hardware-bound (debug) and the CLI glue (cmd/gasm) do not dilute the -# number. Keep this equal to the Coverage gate in .gitea/workflows/test.yml. -coverpkg := "./arch/...,./asm/...,./ast/...,./disasm/...,./format/...,./lexer/...,./lint/...,./lsp/...,./parser/...,./token/...,./verify/..." +# What the test and bench recipes sweep. Scope this to the logic packages when a thin +# cmd/ drags the coverage floor down, for example "./internal/... ./pkg/...". Never name +# a directory the project does not have: a pattern that matches nothing is a setup +# failure, not an empty run. +packages := "./arch/... ./asm/... ./ast/... ./disasm/... ./format/... ./lexer/... ./lint/... ./lsp/... ./parser/... ./token/... ./verify/..." bindir := env_var_or_default("BINDIR", env_var("HOME") / ".local" / "bin") @@ -24,10 +23,8 @@ build: # The test gate: the suite, no cache, the coverage floor. test: #!/usr/bin/env perl - my $coverpkg = q({{coverpkg}}); - system(q{go}, q{test}, q{-count=1}, q{-timeout}, q{30m}, - q{-coverprofile}, q{coverage.out}, q{-coverpkg}, $coverpkg, - qw({{packages}})) == 0 + system(q{go}, q{test}, q{-count=1}, q{-timeout}, q{10m}, + q{-coverprofile}, q{coverage.out}, qw({{packages}})) == 0 or die qq{the test suite failed\n}; open(my $c, q{-|}, q{go}, q{tool}, q{cover}, q{-func=coverage.out}) or die qq{cover: $!}; my $total; @@ -39,7 +36,7 @@ test: # The same suite under the race detector. The expensive one. race: - go test -race -count=1 -timeout 30m {{packages}} + go test -race -count=1 -timeout 10m {{packages}} # Fast scoped run for iterating. This is the one that runs after every edit. unit pkgs=packages run=".*": @@ -88,8 +85,8 @@ uninstall: rm -f "{{bindir}}/{{binary}}" # Run the program. The flag is there because `go run` does not stamp the build otherwise. -run *ARGS: - go run -buildvcs=true {{package}} {{ARGS}} +run: + go run -buildvcs=true {{package}} # Run with watch or hot reload, where the project has one. dev: