Add Windows support infrastructure with cross-platform abstractions #1811
+1,421
−74
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.
This PR implements comprehensive Windows support infrastructure for azure-storage-fuse while maintaining full backward compatibility with existing Linux functionality.
Overview
The implementation addresses the core requirements mentioned in the issue:
Key Changes
1. Cross-Platform Logging System
sys_logger.go(with!windowsbuild tag)winlog_logger.go(withwindowsbuild tag)2. Filesystem Statistics Abstraction
syscall.Statfs_twith cross-platformFilesystemStatsyscall.Statfsviafsstat_unix.goGetDiskFreeSpaceExAPI viafsstat_windows.gofile_cache,block_cache, interface definitions)3. Dynamic Library Loading
dlopen/dlcloseviadynlib_unix.goLoadLibrary/FreeLibraryviadynlib_windows.go4. WinFsp Integration Framework
libfuse_winfsp_handler.go5. Platform-Specific Utilities
util_unix.go)util_windows.go)Technical Implementation
Build Tags Strategy
Cross-Platform Interface Example
Testing & Validation
go build -o blobfuse2succeedsDocumentation
Backward Compatibility
100% backward compatible - all existing Linux functionality preserved:
Current Status
This PR provides the infrastructure foundation for Windows support. Additional components (memory mapping, extended attributes, etc.) will need similar treatment for full Windows compilation, but the framework and patterns are now established.
Future Work
Addressing #1810.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
blobfuse2.z13.web.core.windows.net/home/REDACTED/work/azure-storage-fuse/azure-storage-fuse/blobfuse2 /home/REDACTED/mountdir --config-file /home/REDACTED/work/azure-storage-fuse/azure-storage-fuse/common/config.yaml(dns block)esm.ubuntu.com/usr/lib/apt/methods/https(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.