feat(windows): add Windows compatibility guards and build target - #398
Merged
Conversation
- Reject ImportStrategySYMLINK at config validation on Windows with a clear error pointing users to STRM instead - Guard all os.Symlink call sites (symlink_creator, library_sync, metadata/service, health_handlers) with runtime.GOOS == "windows" checks so the binary never panics or silently corrupts state - UpdateIDSymlink skips gracefully on Windows (internal optimization, not critical for correctness) - Add build-cli-windows Makefile target using MinGW-w64 cross-compilation with inline prerequisite comments (WinFsp, MinGW-w64) - Add Windows path examples to config.sample.yaml (drive letter Z:, directory mount C:\altmount, import_dir example) - Skip symlink-dependent tests on Windows via runtime.GOOS guard Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Uncomment the windows/amd64 matrix entry in the release workflow so that cross-compiled Windows .exe artifacts are produced on every tag via Zig (x86_64-windows-gnu). Also fix the ldflags that injected version info into non-existent main.* vars; they now correctly target github.com/javi11/altmount/internal/version.* so released binaries report the real version string instead of dev/unknown. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…uard health tests Add filepath.ToSlash() around filepath.Dir() calls in CreateDirectoriesForFiles and DetermineFileLocation so the slash-based CutPrefix checks work correctly on Windows after filepath.Clean() converts separators to backslashes. Add runtime.GOOS == "windows" t.Skip guards to health tests that rely on symlink-based workflows or hardcoded Unix paths (/mnt/test, /media/library/..., /nzbs/...), following the pattern already used in postprocessor tests. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
yoshitaka420
pushed a commit
to yoshitaka420/altmount
that referenced
this pull request
Jun 1, 2026
…silabs#398) * feat(windows): add Windows compatibility guards and build target - Reject ImportStrategySYMLINK at config validation on Windows with a clear error pointing users to STRM instead - Guard all os.Symlink call sites (symlink_creator, library_sync, metadata/service, health_handlers) with runtime.GOOS == "windows" checks so the binary never panics or silently corrupts state - UpdateIDSymlink skips gracefully on Windows (internal optimization, not critical for correctness) - Add build-cli-windows Makefile target using MinGW-w64 cross-compilation with inline prerequisite comments (WinFsp, MinGW-w64) - Add Windows path examples to config.sample.yaml (drive letter Z:, directory mount C:\altmount, import_dir example) - Skip symlink-dependent tests on Windows via runtime.GOOS guard
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
ImportStrategySYMLINKat config validation on Windows with a clear error pointing users toSTRMinsteados.Symlinkcall sites (symlink_creator,library_sync,metadata/service,health_handlers) withruntime.GOOS == "windows"checks so the binary never panics or silently corrupts state on WindowsUpdateIDSymlinkskips gracefully on Windows (internal optimization, not critical for correctness)build-cli-windowsMakefile target using MinGW-w64 cross-compilation with inline prerequisite comments (WinFsp, MinGW-w64)config.sample.yaml(Z:drive letter,C:\altmountdirectory mount,import_direxample)runtime.GOOSguardFiles changed
internal/config/manager.goSYMLINKstrategy on Windows at validation timeinternal/importer/postprocessor/symlink_creator.gocreateSingleSymlinkon Windowsinternal/health/library_sync.goupdateSymlinkForMountChangeon Windowsinternal/metadata/service.goUpdateIDSymlinkgracefully on Windowsinternal/api/health_handlers.go400fromhandleRegenerateSymlinkson WindowsMakefilebuild-cli-windowscross-compilation targetconfig.sample.yaml*_test.go(×2)Test plan
go build ./...succeeds (verified locally)go test ./internal/config/... ./internal/importer/... ./internal/metadata/... ./internal/health/...)make build-cli-windowson Linux (requiresgcc-mingw-w64-x86-64)import_strategy: SYMLINKis set on Windows🤖 Generated with Claude Code