Skip to content

Unix-literal "/" roots panic on Windows: four test fixtures, and writ's System layer TargetRoot #392

Open

Description

@David-Noble-at-work

On Windows, a Path built against a Unix-literal root "/" panics: filepath.Rel("/", "C:\...") cannot cross volumes, so fsroot.makePath's assert.Must fires. Found by the platform test matrix (#373) in the post-#377 remainder (57 failures, PR #389 leg).

Evidence

panic: fsroot.makePath: must: Rel: can't make C:\Users\RUNNER~1\...\decrypted.yaml relative to / (pkg/fsroot/root.go:699)
--- FAIL: TestReceipt_RestoreEncoded_JSONandYAML

Sites

Test fixtures (bucket 2) — fsroot.OpenWritableUnconfined("/") as a whole-filesystem root:

  • pkg/op/provider/encryption/receipt_test.go:25
  • pkg/op/provider/git/provider_test.go:23, :40, :191

These want a root that can address absolute temp paths; on Windows "/" is not that. Fix shape: anchor the fixture root at t.TempDir() (confining the test properly as a bonus), or define what unconfined means cross-platform and use that.

Production default (bucket 1, larger) — cmd/writ/writ/layer.go:28 sets the System layer's TargetRoot: "/". writ's System-layer deployment has no Windows semantics; this is a design question (what is "System" on Windows?), not a literal to patch. The layer tests (layer_test.go, snapshot_test.go:267) inherit the same literal.

Suggested split

Fix the four test fixtures mechanically; charter the writ System-layer Windows question separately — it is product design, and it gates writ-on-Windows rather than CI greenness (the scenario suite already passes on windows-latest because deployment targets Home, not System).


Epic: #430 · Feature: #431

Activity

  1. David-Noble-at-work commented on Aug 13, 2026

    @David-Noble-at-work
    ContributorAuthor

    Enumeration correction before the fix lands: the issue said four fixture sites; the uncapped sweep found ten — the original grep was head -8-capped. Full set, all now fixed on fix/unix-literal-roots: encryption/receipt_test.go (1), git/provider_test.go (3, via parameterized testActivation/newTestProvider), git/resource_input_test.go (2 — the Windows-shaped-path test now borrows the fixture root's own volume on Windows so the drive-colon shape survives without crossing volumes), git/resource_test.go (1, newRes anchors at the path's own directory), git/receipt_test.go (1), git/checkout_pull_observe_test.go (2, plus the two /tmp/* literal inputs). The writ System-layer TargetRoot: "/" design question remains this issue's open half, untouched.

  2. added
    taskImplementation work item
    bugSomething isn't working
    Severity:HighA supported path is broken with no workaround
    and removed
    taskImplementation work item
    on Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Epic:WindowsCampaignThe Windows campaign epicPriority:P1This cycleSeverity:HighA supported path is broken with no workaroundbugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions