Repository navigation
Conversation
The token server builds as tokenserver.exe on Windows, and start.mjs looks for it there. Reading a local file no longer follows a symlink on Windows, which has no O_NOFOLLOW: openNoFollow checks that the file opened is the one lstat saw, and that the path wasn't replaced by another file or a symlink. Tests that need chmod to block access skip where it can't. Tests that need FIFOs, POSIX modes, or renaming a folder with an open file skip on Windows. Each says why. Path checks use the platform's separator.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Before
On Windows 11, 15 unit tests and 2 Go tests failed, and
npm run build:tokenserverwroteout/tokenserverwith no.exe, which Windows won't run.After
tokenserver.exeon Windows (go build -o ../out/), andstart.mjslooks for that name.openNoFollow. Windows has noO_NOFOLLOW, so reading went through symlinks there.openNoFollowrefuses a symlink, and after opening checks that the path is still the same file and not a symlink.chmodto block access skip where it can't (Windows, or as root), found by a probe intest/fsSupport.ts. Tests that need FIFOs, POSIX file modes, or renaming a folder whose sync database is open skip on Windows. Each skip gives its reason./paths use the platform's separator, in TypeScript and Go.One test, "waits for running transfers and skips queued ones when an action throws", still fails now and then on Windows. It fails on
maintoo. Windows file times change only about every 15 ms, so a same-size edit right after a sync can look unchanged. That's a sync bug to fix separately, so this PR leaves the test alone.Test plan
npm test, 298 passed. Lint, format, typecheck, andgo testpass.go vet, andgo testpass. Unit tests: 284 passed and 14 skipped in two of three runs. The third failed only the test above.openNoFollowtests fail when their checks are removed: on macOS for each, and on Windows for the symlink swap.