diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e3d9221..107beb4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,6 +25,6 @@ jobs: - name: cross-build if: runner.os == 'Linux' run: | - for t in linux/arm64 darwin/arm64 windows/amd64 freebsd/amd64; do + for t in linux/arm64 linux/386 darwin/arm64 windows/amd64 freebsd/amd64; do GOOS=${t%/*} GOARCH=${t#*/} CGO_ENABLED=0 go build -o /dev/null ./cmd/mapsize done diff --git a/internal/scan/scan.go b/internal/scan/scan.go index ba640b4..fd5330a 100644 --- a/internal/scan/scan.go +++ b/internal/scan/scan.go @@ -11,6 +11,7 @@ import ( "context" "errors" "fmt" + "log/slog" "os" "path/filepath" "runtime" @@ -358,6 +359,7 @@ func (c *controller) apply(r *result, cancelled bool) bool { dn.Flags |= inventory.FlagIncomplete t.Stats.Unscanned++ default: + slog.Debug("read directory failed", "path", j.path, "err", r.err) dn.Flags |= inventory.FlagError | inventory.FlagIncomplete t.Stats.AddError(inventory.ErrorRecord{Node: dir, Kind: inventory.Classify(r.err), Msg: errMsg(r.err)}) d.Errors++ diff --git a/internal/tui/color256.go b/internal/tui/color256.go index e4e9c41..a7f46de 100644 --- a/internal/tui/color256.go +++ b/internal/tui/color256.go @@ -1,6 +1,9 @@ package tui -import "sync" +import ( + "math" + "sync" +) // The stock 256-colour conversion maps dark, slightly tinted colours to // saturated cube entries (olive, navy), which wrecks the subtle shading the @@ -24,7 +27,7 @@ func quant256(c Color) uint8 { return v.(uint8) } r, g, b := int(c>>16&0xff), int(c>>8&0xff), int(c&0xff) - best, bestD := 16, 1<<62 + best, bestD := 16, math.MaxInt for i := 0; i < 216; i++ { cr, cg, cb := cubeLevels[i/36], cubeLevels[i/6%6], cubeLevels[i%6] if d := redmean(r, g, b, cr, cg, cb); d < bestD { diff --git a/internal/tui/model.go b/internal/tui/model.go index df930db..aa5756e 100644 --- a/internal/tui/model.go +++ b/internal/tui/model.go @@ -10,6 +10,7 @@ package tui import ( "context" "fmt" + "log/slog" "os" "path/filepath" "strings" @@ -324,6 +325,8 @@ func (m *Model) scanFinished() tea.Cmd { errs := st.TotalErrors() el := st.Elapsed() t.RUnlock() + slog.Info("scan finished", "files", files, "dirs", st.Dirs, "bytes", total, "errors", errs, + "cancelled", st.Cancelled, "elapsed", el) var cmds []tea.Cmd rate := float64(files+st.Dirs) / max(el.Seconds(), 0.001) msg := fmt.Sprintf("✓ Scan complete %s · %s files · %s dirs · %s · %s/s",