-
Notifications
You must be signed in to change notification settings - Fork 0
Native Windows support #1
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
base: develop
Are you sure you want to change the base?
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
This PR adds comprehensive Windows support by updating CI workflows, build configurations, and source code to use conditional compilation and Windows APIs.
- Introduced Windows-specific GitHub Actions workflows and a new
clippy-windowsjob. - Enhanced CMake and
build.rsto link against Windows runtimes and libraries. - Wrapped POSIX-only calls in
#ifdef _WIN32, added Windows implementations for UUIDs, console sizing, and environment lookups.
Reviewed Changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/util.h | Added #ifdef _WIN32 around UUID includes |
| src/util.cpp | Windows uuid() implementation and header guards |
| src/taskchampion-cpp/build.rs | Windows MSVC runtime flags in Debug profile |
| src/taskchampion-cpp/CMakeLists.txt | Formatting fix for corrosion_import_crate |
| src/recur.h | Conditional includes for windows.h and <io.h> |
| src/recur.cpp | Added <algorithm> and #undef max on Windows |
| src/main.cpp | Wrapped signal(SIGPIPE) and run() call in guards |
| src/commands/CmdPurge.cpp | Replaced and with && |
| src/commands/CmdImport.cpp | Replaced not/and with !/&& |
| src/commands/CmdEdit.cpp | Swapped <unistd.h> for <direct.h> on Windows |
| src/commands/CmdContext.cpp | Replaced or with ` |
| src/commands/CmdBurndown.cpp | Added #undef max guard |
| src/Task.cpp | Multiple #undef max injections |
| src/Lexer.cpp | Replaced and with && |
| src/Hooks.cpp | Guarded POSIX includes under #ifndef _WIN32 |
| src/DOM.cpp | Replaced and with && |
| src/Context.cpp | Windows console size, color detection, home dir |
| cmake/CXXSniffer.cmake | Extended C++17 check to include WIN32 |
| CMakeLists.txt | Windows crypto libs, UUID handling, and Rpcrt4 |
| .github/workflows/windows-tests.yml | New Windows build/test workflow |
| .github/workflows/checks.yml | Added clippy-windows job |
Comments suppressed due to low confidence (2)
.github/workflows/windows-tests.yml:49
- [nitpick] On Windows runners, use backslashes or PowerShell syntax (
.\build\Debug\task.exe) to avoid path resolution issues in PowerShell/CMD.
./build/Debug/task.exe --version
.github/workflows/checks.yml:59
- [nitpick] This workflow uses the
masterref for the Rust toolchain action, whereas others pin tostableor a version. Consider unifying to a specific version for reproducibility.
- uses: dtolnay/rust-toolchain@master
Signed-off-by: Marcus Ekwall <marcus.ekwall@gmail.com>
This pull request introduces support for native Windows, including updates to workflows, build configurations, and source code adjustments. Additionally, it includes minor refactoring to improve code readability and consistency.
Native Windows Compatibility Enhancements:
clippy-windowsjob to.github/workflows/checks.ymlfor running Clippy checks on Windows environments..github/workflows/windows-tests.yml, to run Windows-specific tests, build processes, and Clippy checks. This includes setting up dependencies like CMake and Visual Studio Build Tools.CMakeLists.txtto handle Windows-specific dependencies and configurations, such as usingRpcrt4for UUID handling and setting appropriate libraries likebcryptandcrypt32. [1] [2]src/Context.cppto include Windows-specific implementations for environment variables, terminal width/height detection, and color support. [1] [2] [3] [4] [5] [6] [7]src/Hooks.cpp,src/commands/CmdEdit.cpp) to exclude Unix-specific headers and replace them with Windows equivalents where necessary. [1] [2]and,or,not) with standard equivalents (&&,||,!) as they aren't recognized by MSVC when using Windows headers. [1] [2] [3] [4] [5] [6]maxmacro in multiple files to prevent conflicts withstd::max. [1] [2] [3] [4]