Repository navigation
fix: core/go passes on Windows; Windows CI job (fixes #29) - #30
Merged
Merged
Conversation
…Windows takes / too; Windows-aware tests Fixes #29. On Windows PathBase split only on a backslash, so PathBase("/format.go") was "/format.go": that broke hasListedExt's dot check and the LSP SPOR owner lookup (and its alloc gate). Like CleanPath, both now hand the native case to filepath, which splits on both. The isExecutable/Find tests now name the fixture .exe on Windows (no execute bit there), and Find's test stops on a failed Result instead of panicking. Co-Authored-By: Virgil <virgil@lethean.io>
First native Windows run found 31 failures behind a panic. Real fixes:
- PathBase/PathDir hand the native case to filepath (both separators on
Windows); PathBase("/format.go") was "/format.go" there, breaking the
extension check and the LSP SPOR owner lookup.
- PathIsAbs: a leading backslash is rooted on Windows (Path writes "/tmp"
back as "\\tmp" there, which PathIsAbs then called relative).
- GeneratePack: asset names relativised and slash-converted; trimming a
"/" prefix never matched a Windows path, so the full C:\\... path was
embedded as the name.
- Unsetenv("") is a no-op on every OS (Windows rejected it).
Test-only: slash-form comparisons, platform file modes, Windows handles,
TMP/USERPROFILE, closed streams, an Extract target no OS can create (the
old one was creatable on C:), .exe fixtures where an exec bit was assumed.
Co-Authored-By: Virgil <virgil@lethean.io>
Contributor
|
Caution Review failedThe pull request is closed. Walkthrough
Severity of issue fixed: Medium
Warning Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
… too The protected-path check compared against "/" and $HOME. Windows usually has no HOME, and its roots are drive roots, so neither the user's home nor C:\\ was protected there. isProtectedPath asks the OS for the home as well, treats any root (its own parent) as protected, and ignores case on Windows. Also: Chdir/Getwd tests resolve 8.3 short names (Windows CI's RUNNER~1). Co-Authored-By: Virgil <virgil@lethean.io>
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.
Fixes #29. The suite now passes natively on Windows 11 (
go test ./..., 0 failures, from 31 behind a panic) and awindows-latestCI job keeps it that way.Behaviour fixes
PathBase/PathDir: on the native separator they now usefilepath(asCleanPathalready does), which on Windows splits on/as well as\. Before,PathBase("/format.go")was/format.gothere.PathIsAbs: a leading backslash is rooted on Windows.GeneratePack: asset names are relative slash paths on every OS (it embedded the fullC:\...path).Unsetenv(""): a no-op everywhere (Windows rejected it).Test-only: slash-form comparisons, platform file modes, Windows std handles,
TMP/USERPROFILE, closed streams before cleanup, an Extract target no OS can create,.exefixtures where an execute bit was assumed.🤖 Generated with Claude Code
Co-Authored-By: Virgil virgil@lethean.io
Summary by CodeRabbit
New Features
Bug Fixes