fix: Windows cross-platform compatibility#31
Open
bilersan wants to merge 1 commit intoActiveMemory:mainfrom
Open
fix: Windows cross-platform compatibility#31bilersan wants to merge 1 commit intoActiveMemory:mainfrom
bilersan wants to merge 1 commit intoActiveMemory:mainfrom
Conversation
Runtime fixes: - validation/path.go: case-insensitive boundary checks on Windows (VS Code lowercases drive letters, EvalSymlinks uppercases) - memory/discover.go: platform-independent project slugs with filepath.ToSlash and Windows drive prefix stripping - recall/parser/path.go: use forward slashes consistently for session path operations (not platform separator) - journal/core/generate.go: normalize source links and nav paths to forward slashes - site/cmd/feed/run.go: use config.NewlineLF and config.ExtMarkdown constants; use Println for cross-platform line endings Test fixes: - Set USERPROFILE alongside HOME in 50+ test functions across 10 files (os.UserHomeDir reads USERPROFILE on Windows) - Set APPDATA in recall tests (XDG fallback reads APPDATA on Windows) - recall/core/format_test.go: replace t.Setenv TZ with setLocalUTC helper (TZ env var does not affect time.Local on Windows) - cli_test.go: append .exe suffix on Windows for test binary - serve_test.go: use os.TempDir, .bat fake binaries, platform PATH separator - pad_test.go: skip file permission test on Windows; use filepath.Separator in path assertions - crypto_test.go: skip Unix permission check on Windows - journal/core/generate_test.go: use t.TempDir with filepath.ToSlash instead of hardcoded Unix paths Signed-off-by: ersan bilik <ersanbilik@gmail.com>
This was referenced Mar 7, 2026
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
Fixes #30 — Windows cross-platform compatibility.
This PR makes ctx build and test cleanly on Windows by addressing 5 runtime issues and fixing 50+ test failures across 13 test files.
Merge Order
Runtime Changes (5 files)
validation/path.gomemory/discover.gofilepathrecall/parser/path.gojournal/core/generate.gosite/cmd/feed/run.goconfig.NewlineLF/config.ExtMarkdownTest Changes (13 files)
USERPROFILEenv var — Set alongsideHOMEin 50+ test functions across 10 files (os.UserHomeDirreadsUSERPROFILEon Windows)APPDATAenv var — Set in recall tests (XDG fallback readsAPPDATAon Windows)setLocalUTChelper — Replacest.Setenv("TZ", "UTC")which has no effect on Windows.exeon Windows for test binary lookup;on Windows vs:on Unix.batfake binaries — Windows equivalent of#!/bin/shscripts in test setupos.TempDir()— Instead of hardcoded/tmp/t.TempDir()+filepath.ToSlash— Instead of hardcoded/home/user/...pathsTesting
go build ./...— cleango test ./...— all pass except pre-existingdeps/corefailures (file handle cleanup issue unrelated to this PR)