You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
writ never detects the Linux distribution: detectDistro closes /etc/os-release before reading it, so no .Debian or .Ubuntu directory deploys anywhere #959
cmd/writ/writ/segment/detect.go, detectDistro: iox.Close(&err, file) runs directly — not deferred — between os.Open and bufio.NewScanner(file), so the scan reads a closed file (read /etc/os-release: file already closed) and the function returns "". The DISTRO segment is always empty; segmentMap drops it; no directory with a distribution suffix has matched on any Linux host since the line landed in 57a9fd2 (#288, 2026-07-24).
Found 2026-09-26 by an independent verification of a deploy on DANOBLE-UD24-1 (Ubuntu 26.04): /etc/os-release carries ID=ubuntu, and every writ graph in ~/.local/state/devlore/index.ndjson back to 2026-09-18 records segments {ARCH: arm64, OS: Linux} with no DISTRO. A replica of the function that copies iox.Close verbatim prints the closed-file error and returns "". segment_test.go builds DISTRO values by hand and never calls detectDistro, which is why nothing caught it.
So Home/common.Debian (personal's Upgrade-Debian, #224) deploys nowhere, Debian included, and #860/#944's reasoning about which distribution suffix matches was never exercised. The fix: defer iox.Close(&err, file) with err in scope; a test that calls detectDistro against an os-release fixture. The selector grammar itself is #944's.
A test pins this bug (found 2026-09-28).cmd/writ/writ/adopt/adopt_integration_test.go:341-343 asserts that ValidatePlatform("Ubuntu") is refused as "a word the layer tree never matches". It runs in the normal unit suite, with no build tag. It passes on Ubuntu, and on every Linux CI leg (all Ubuntu: .github/workflows/ci.yaml:162-163, :213-214), only because DISTRO is empty. The fix for detect.go:130 makes it fail there, so the fix corrects that test in the same commit. Also, TestDetectSegments never checks DISTRO on Linux (cmd/writ/writ/segment/segment_test.go:214-231), which is how the regression from 57a9fd20 passed. Details are on #944.
Activity
David-Noble-at-work commentedon Sep 28, 2026
A test pins this bug (found 2026-09-28).
cmd/writ/writ/adopt/adopt_integration_test.go:341-343asserts thatValidatePlatform("Ubuntu")is refused as "a word the layer tree never matches". It runs in the normal unit suite, with no build tag. It passes on Ubuntu, and on every Linux CI leg (all Ubuntu:.github/workflows/ci.yaml:162-163,:213-214), only because DISTRO is empty. The fix fordetect.go:130makes it fail there, so the fix corrects that test in the same commit. Also,TestDetectSegmentsnever checks DISTRO on Linux (cmd/writ/writ/segment/segment_test.go:214-231), which is how the regression from57a9fd20passed. Details are on #944.feat(selector): one selector API for writ and lore; directory names f…