Skip to content

[cmake] special git patch args for Windows#21930

Merged
linev merged 1 commit intoroot-project:masterfrom
linev:win_git_patch
Apr 17, 2026
Merged

[cmake] special git patch args for Windows#21930
linev merged 1 commit intoroot-project:masterfrom
linev:win_git_patch

Conversation

@linev
Copy link
Copy Markdown
Member

@linev linev commented Apr 16, 2026

On Windows line ending is different and therefore patch file generated on Linux cannot be applied as is.
Add "--ignore-whitespace" arguments to git apply command - but only for Windows, on alma flags are failing.
Use ${GIT_EXECUTABLE} cmake variable to be more precise when invoking git

Resolves compilation on Windows with -Dbuiltin_gl2ps=ON, making similar changes in other builtins

Similar args already used in fitsio builtin

@linev
Copy link
Copy Markdown
Member Author

linev commented Apr 16, 2026

Looks like ninja does not like new args.
I will modify my PR to only use extra args on Windows

@linev linev force-pushed the win_git_patch branch 2 times, most recently from 01c55c5 to b58fe32 Compare April 16, 2026 10:34
Comment thread builtins/cfitsio/CMakeLists.txt
@linev linev force-pushed the win_git_patch branch 2 times, most recently from ba4a485 to 9035b9a Compare April 16, 2026 13:42
On Windows line ending is different and therefore patch file
generated on Linux cannot be applied as is.
Add "--ignore-whitespace" arguments to git apply command on Windows
DO not use ${GIT_EXECUTABLE} cmake variable - alma10 has problem with it
@linev linev force-pushed the win_git_patch branch 2 times, most recently from 9035b9a to bcb583c Compare April 16, 2026 14:02
@bellenot
Copy link
Copy Markdown
Member

I don't understand why this is needed at all, I never had such issue on my machines...

@linev
Copy link
Copy Markdown
Member Author

linev commented Apr 16, 2026

As we discuss - it is local settings of git. How it deals with difference in EOL on different platforms.

That is really strange - use of ${GIT_EXECUTABLE} patch leads to problems on several platforms.
Like alma10 with Ninja.
So currently I keep use of git patch, but one can try to understand why it is.

@github-actions
Copy link
Copy Markdown

Test Results

    22 files      22 suites   3d 3h 56m 14s ⏱️
 3 833 tests  3 832 ✅  1 💤 0 ❌
75 614 runs  75 596 ✅ 18 💤 0 ❌

Results for commit bcb583c.

@linev linev merged commit 8b615eb into root-project:master Apr 17, 2026
30 checks passed
@linev linev deleted the win_git_patch branch April 17, 2026 05:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants