fs: systemPath in std/fs (step 2c of #68, commit 2 of 2) #580
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Step 2c of #68 (PATH slice 2): commit 2 of 2 of the seed rule for
systemPath. Commit 1 (#559,torb_file_system_pathand the manifest rowfileSystemPath) is onmainas4b3045d, and the newest published seed (4b3045d31334, head ofseeds.txt) contains it, so astdsource may declare and call the native now.Source
public fn systemPath(path: Path): String, "the path as the operating system of this machine reads it: for a foreign function and for a child process".Goal
std/fsexportssystemPath(path: Path): Stringover the nativefileSystemPath. It answers the path text in the form this machine's operating system reads (POSIX: the/text unchanged; Windows: the drive-letter form the runtime hands to the wide-char calls), and cannot fail.Acceptance criteria
std/fs/src/lib.trbdeclares the privatenative fn fileSystemPath(path: String): String(name and signature as the manifest row incompiler/src/backend/c/natives.trb) andpublic fn systemPath(path: Path): Stringover it, with a doc comment per the declaration rules (what it answers, when to use it: foreign functions and child processes, not for display or for aPathround trip).std/fs/tests/files.test.trb:systemPathof a relative path, an absolute path and a path with a trailing component answers the expected text on the CI platform; a test that the answer round-trips throughFile.existson a path the test created.docs/design/PATH.md: the status paragraph near the top sayssystemPathis in (the "runtime half is in" sentence is replaced); slice 2 stays open for steps 3 and 4.docs/changes regenerated intoskills/(thefsreference page listssystemPath);tools/check-commits.shclean;sh tools/gates.sh agreen in forge CI.Design record point
PATH.md section 6 (
systemPath) and the slice table row 2 (docs/design/PATH.md, "The boundary").Seed
Does not touch the seed: it is commit 2 of 2 and only calls the native that the published seed
4b3045d31334already contains. No syntax change, no new native, no driver flag, no name the compiler looks up by string (fileSystemPathis looked up by the manifest row that already exists). One PR, one Conventional Commit (feat(fs): systemPath answers the path in the form the operating system reads); if the docs regeneration is cleaner on its own, a seconddocs(fs)commit.Dependencies
4b3045d) and the published seed4b3045d31334.IoError.pathasPath) and 4 (list,absolutePath), which follow one after the other.Part of #68 (epic; do not close it).
Into<Path>signatures (PATH slice 2) #68Into<Path>signatures (PATH slice 2) #68Into<Path>signatures (PATH slice 2) #68[loop:torbscript] claim implement by session:loop-torbscript-20261029-0858 until 2026-10-29T18:57:00Z
[loop:torbscript] release implement: lease expired 2026-10-29T18:57Z while PR #583 is red on
50c2bcf(tier A failing after 32m39s)[loop:torbscript] claim implement by session:loop-torbscript-20261029-0858 until 2026-10-30T01:00:00Z
[loop:torbscript] release implement: fix worker timed out after pushing
c8d8653(format canon for the Path.from binding in the systemPath test); CI onc8d8653still runs, the playground job is already red (failing after 4m36s), so a fix worker reads its log next tick[loop:torbscript] claim implement by session:loop-torbscript-20261029-0858 until 2026-10-30T01:30:00Z
[loop:torbscript] release implement: CI on
c8d8653read from the runner logs. Tier A (linux-x64) finished green; the only red job wasthe playground (torb as WebAssembly), a timing flake inplayground/smoke-test.mjs(cancel test), not caused by this change. PR #583 was reopened to start a fresh CI run (no code change, no push). Next: waiting (CI running, then the merge gate's review). Details: #583IoError.pathbecomes aPath(step 3 of #68) #680Into<Path>signatures (PATH slice 2) #68