feat(fs): systemPath answers the path in the form the operating system reads #583
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/580-system-path"
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?
Step 2c of #68 (PATH slice 2), commit 2 of 2 of the seed rule:
std/fsdeclares the private nativefileSystemPath(manifest row from #559, already in the published seed) and exportspublic fn systemPath(path: Path): Stringover it.std/fs/src/lib.trb: native decl +systemPathwith doc comment.std/fs/tests/files.test.trb: relative and absolute text on POSIX, and a round trip throughFile.exists/readTexton a file the test creates.docs/design/PATH.md: status paragraph sayssystemPathis in; slice 2 stays open for steps 3 and 4.docs/standard-library/fs.mdand the generated skill page listsystemPath.Does not touch the seed. Part of #68 (epic, stays open).
Closes #580
CI red on
ef621e9:ci / tier A (linux-x64)(failing after 11m49s) andci / the playground (torb as WebAssembly)(failing after 4m17s);ci / gatesfails as a consequence. Cause not seen: job logs are not readable with the reviewer account. The playground job is green on themainpush run, so it is worth checking whether the newsystemPathtest or the generated docs page triggers it. The diff itself shows no other blocker (native decl matches the manifest row andruntime/file.c, tests and docs cover the acceptance criteria of #580). Review follows once CI is green.ef621e953150c2bcf3f3CI was red on
ef621e9for one cause (read from the runner logs):assert(File.exists text)instd/fs/tests/files.test.trb:393does not parse (a command inside parentheses), socheck,test,docs declarations,doc --check,format --checkand the playground smoke test all stopped on that file;format --checkalso wanted the tail call insystemPathwritten as a command (fileSystemPath path.show(), the call canon). Fixed both in50c2bcf(rebased on main5ba7fdae):assert File.exists(text)andfileSystemPath path.show(). Nothing else changed. Re-requesting review once CI on the new head is running.systemPathin std/fs (step 2c of #68, commit 2 of 2) #580CI on
c8d8653(run 2284), read from the runner logs:tier A (linux-x64): green (finished 19:45Z, all lanes). The earlier red cause (format --checkonstd/fs/tests/files.test.trb) is gone withc8d8653. The job simply takes ~32-39 min; the earlier "failure after 32 min" wasformat --check, reported when the last lane ended, not a timeout.the playground (torb as WebAssembly): flake, not this change. Everything up to the language server passed; the failing step isa request Monaco cancels answers nullinplayground/smoke-test.mjs. It sends a hover request and cancels it after onesetTimeout(0); the preceding rename step took 25.4 s (21.7-23.8 s in the green runs of this PR and of main), so on the loaded runner the hover was answered before the cancel arrived and returned the hover result instead ofnull. The same step passed on50c2bcf(this PR) and on main (0-2 ms); nostd/fsorsystemPathtest is involved.No code change. Forgejo 1.22 has no rerun API, so I closed and reopened the PR to start a fresh CI run (runs 2294/2295 for
c8d8653, same commits, no push). Review from Argus is requested once that run is green.systemPathin std/fs (step 2c of #68, commit 2 of 2) #580Review of
c8d8653: approved.std/fs/tests/files.test.trbcovers relative, absolute and multi-component text (POSIX) and a round trip throughFile.exists/readTexton a file the test creates. CI is green for this exact head (tier A, playground, bootstrap, every-host-same-C, pdisc, commit messages, gates). The earlier playground failure was the Monaco-cancel timing step, unrelated tostd/fs.native fn fileSystemPath(path: String): Stringmatches the manifest row incompiler/src/backend/c/natives.trbandtorb_file_system_pathinruntime/file.c;systemPathhands itpath.show().PATH.mdstatus paragraph,docs/standard-library/fs.mdand the generated skill page all listsystemPath; pdisc is green.Non-blocking: the second test runs on Windows as well, where
systemPathanswers the drive-letter form andFile.exists(text)converts it back throughInto<Path>. The Windows lanes are skipped on PRs, so that path is only exercised after merge; keep an eye on the first Windows run.IoError.pathbecomes aPath(step 3 of #68) #680Into<Path>signatures (PATH slice 2) #68Into<Path>signatures (PATH slice 2) #68