Skip to content
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

Fix Rapidjosn CMake patching for windows #1181

Merged
merged 3 commits into from
Feb 2, 2024
Merged

Conversation

ptheywood
Copy link
Member

@ptheywood ptheywood commented Feb 2, 2024

  • Add re-configuration to CI to check for fetch content apply bugs
  • fix rapidjson CMake patch command for windows

Closes #1180

@ptheywood
Copy link
Member Author

Unable to get PATCH_COMMAND to behave on windows.

Instead calling execute_process to manually check if the patch is applicable, and only apply it if it is. Seems to work.

First configuration output will now include:

-- Found Jitify: C:/Users/ptheywood/code/flamegpu/FLAMEGPU2/build/_deps/jitify-src (found version "0.9")
-- Patching RapidJSON
-- Patching RapidJSON - done
-- RapidJSON found. Headers: C:/Users/ptheywood/code/flamegpu/FLAMEGPU2/build/_deps/rapidjson-src/include
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)

Second output (i.e. when the patch can't be applied so isn't attempted)

-- CUDA Architectures: 50-real;60-real;70-real;80-real;90-real;90-virtual
-- RapidJSON found. Headers: C:/Users/ptheywood/code/flamegpu/FLAMEGPU2/build/_deps/rapidjson-src/include
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)

This does mean that if the patch becomes stale it will silently not be applied, but that will only occur if the rapidjson hash is changed and the relevant lines are changed too. The patch is only fixing a cmake deprecation notice, and there are PRs upstream to fix that (but they've been open for a while and rapidJSON have also broken their find_package logic anyway, so larger changes will beneeded if we bump the hash any further).

If there were a race on disk, where between the patch being checked and the patch being applied on disk, the output would instead be as follows, but it would not prevent cmake from progressing.

-- Patching RapidJSON - patching failed

Need to check this still behaves on linux prior to marking as ready.

@ptheywood
Copy link
Member Author

ptheywood commented Feb 2, 2024

Linux configure, reconfigure and build are all behaving, so this is good to go subject to CI passing.

Will want a squash merge

@ptheywood ptheywood marked this pull request as ready for review February 2, 2024 14:05
@ptheywood ptheywood requested review from Robadob and mondus February 2, 2024 14:05
Copy link
Member

@Robadob Robadob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trusting that the rapidjson changes work, because CI passes.
Rest looks sensible.

@ptheywood ptheywood merged commit 6dd19b1 into master Feb 2, 2024
20 checks passed
@ptheywood ptheywood deleted the windows-reconfigure branch February 2, 2024 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CMake FetchContent patch apply error on reconfigure on Windows
2 participants