Repository navigation
Fix control socket paths with special characters - #1328
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
sylvesterkaczmarek
left a comment
There was a problem hiding this comment.
Using the decoded URL.path at the filesystem boundary is the right fix here. The control socket logic operates on POSIX paths, so percent-encoding from URL presentation should never reach chdir, unlink, or socket-path handling.
The regression is good because it combines characters that force URL encoding with the Unix-socket path-length constraint and a stale socket entry. One small strengthening would be to assert in the fixture that the encoded URL representation actually differs from .path, so the test remains explicitly tied to this regression if Foundation URL behavior changes.
There was a problem hiding this comment.
Since .path is deprecated, should we just use the .path(percentEncoded: false) instead?
There's also removeItem(at:) that directly takes a URL.
ef8eaf4 to
d798a89
Compare
Fixed, thanks @edi-oai |
URL.path()percent-encodes VM directory names and, on older macOS releases, can return only the relative part of a URL with a base. These behaviors can prevent stale control-socket cleanup or directory changes; in Tart 2.36.0, the resulting bind error aborts VM startup.Remove stale sockets with
FileManager.removeItem(at:)and use.absoluteURL.path(percentEncoded: false)for directory changes inrun,exec, and agent IP lookup. Add one regression test for a stale socket in a long path containing spaces,%,#, and Unicode.Fixes #1319. See also #1224 and swiftlang/swift-foundation#1011 for the older relative-URL behavior.
Validation
TART_HOMEand the VM name. Host Virtualization shutdown errors and VM limits prevented completing the remaining runtime checks.