-
Notifications
You must be signed in to change notification settings - Fork 24
Native Windows support #102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Native Windows support #102
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds native Windows support throughout the codebase by introducing conditional compilation and Windows API calls, plus build workflow updates.
- Introduces Windows-specific process execution, file system, and path handling in shared.cpp, FS.cpp, Table.cpp, and Datetime.cpp
- Adjusts CMake flags for MSVC and updates GitHub Actions to include a Windows runner
- Adds Windows headers, macros, and typedefs in FS.h and CXXSniffer.cmake
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/shared.cpp | Added Windows implementation of execute() and compare() |
| src/format.cpp | Conditional include of <strings.h> on non-Windows |
| src/Table.cpp | Added Windows-specific isatty check and <io.h> |
| src/PEG.cpp | Switched from and to && for consistency |
| src/FS.h | Included <windows.h> and defined mode_t on Windows |
| src/FS.cpp | Implemented Windows file/dir operations and path logic |
| src/Datetime.cpp | Windows variant of timegm using _putenv_s |
| cmake/CXXSniffer.cmake | Set /W4 flags when using MSVC |
| .github/workflows/cmake.yml | Added windows-latest runner and platform checks |
Comments suppressed due to low confidence (2)
src/FS.cpp:191
- The new Windows branch in Path::realpath isn't currently covered by tests. Adding unit tests for this code path will ensure it behaves correctly on Windows and prevent regressions.
DWORD required_size = GetFullPathNameA(_data.c_str(), 0, nullptr, nullptr);
.github/workflows/cmake.yml:34
- [nitpick] The workflow steps duplicate similar shell logic for different platforms. Consider extracting the platform check into a reusable script or consolidating the commands to reduce duplication and improve clarity.
shell: bash
|
@lauft is this something you could take a look at? |
Co-authored-by: Copilot <[email protected]>
lauft
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's give it a try.
Although, making Taskwarrior/Timewarrior support Windows will be an extra effort...
|
That's in progress in GothenburgBitFactory/taskwarrior#3824! |
|
@lauft @djmitche I've done it here: mekwall/taskwarrior#1 I'll see if I get some time over this week to get a PR in to the taskwarrior repo. |
This pull request introduces support for native Windows by adding Windows-specific implementations and conditional compilation to various parts of the codebase. The changes ensure compatibility with Windows systems while maintaining functionality on other platforms.
Build System Updates:
windows-latest) to the GitHub Actions workflow in.github/workflows/cmake.yml. Updated CMake configuration, build, and test steps to handle Windows-specific paths and commands.Codebase Updates for Windows Compatibility:
cmake/CXXSniffer.cmaketo set appropriate compiler flags for Windows (/W4) versus other platforms (-Wall -Wextra).Datetime::timegminsrc/Datetime.cppto use_putenv_sand_tzsetfor setting the time zone on Windows. [1] [2]Filesystem (
FS.cpp) Enhancements:_mkdir,_unlink, andFlushFileBuffers. [1] [2]Path::realpath,Path::expand, andPath::globto handle Windows paths and environment variables likeUSERPROFILE. [1] [2] [3] [4]createandremove_directory. [1] [2] [3] [4] [5] [6] [7]Header File Updates:
src/FS.hto include Windows-specific headers and definemode_tfor compatibility.These changes collectively enable the codebase to function seamlessly on Windows platforms while preserving its behavior on Unix-like systems.