Skip to content

cmake: Fix CMP0175 warning by adding POST_BUILD to TARGET form of add_custom_command() #5639

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

Merged
merged 1 commit into from
May 14, 2025

Conversation

echoix
Copy link
Member

@echoix echoix commented May 10, 2025

I tried to explore using a cmake build for generating documentation, but fails for addons. But when exploring, I found a simple fix to one of the warnings that are displayed since CMake 3.31. Starting from CMake 3.31, more rigourous argument checking is done, and it complains that with the TARGET form of add_custom_command(), the type of event must be specified, like POST_BUILD.

This PR adds POST_BUILD, the default assumed when it was missing.

See https://cmake.org/cmake/help/latest/policy/CMP0175.html

@echoix echoix requested a review from nilason May 10, 2025 22:22
@github-actions github-actions bot added translation Message translation related CMake labels May 10, 2025
@echoix echoix enabled auto-merge (squash) May 11, 2025 11:36
@echoix
Copy link
Member Author

echoix commented May 11, 2025

I thought the windows failure was only a fluke, as I saw on main and on my branch, even after reruns. So, it doesn't look like a transient thing.

@echoix
Copy link
Member Author

echoix commented May 12, 2025

Does someone have any idea on the windows failures since 3 days? It's completely blocking us, unless we lower our thresholds.

On multiple occasions, a passing commit before the constant failures, once rerun (more than once, on a couple days span) fail the same way. => it is not some code on our part.

I checked really hard, and couldn't find a cause. I diffed the CI logs of a passing job, and a failing rerun 4 days later.
I don't see any package differences in OSGeo4W (and no new commits in the repo, but he has the habit of pushing the changes days or weeks later :( ). No Python package changes no Python version changes.

The only difference is in the msys packages. The only one that is a minor version change is https://github.com/fmtlib/fmt that passed from 11.1 to 11.2. Other than that, it is mostly some recompiles that changed.

So, I really don't see what could be going on. Is it something like a DLL collision that needs OSGeo4W to recompile? It's weird, the error is in Python library code, mentioning that the file is empty. When doing a full read diffing the two logs (even with parallel output with different order), I didn't catch a different message in the compile log, that would point to an error when compiling.

@echoix
Copy link
Member Author

echoix commented May 13, 2025

I've attached to the runner by ssh (using tmate), before running the tests. The errors in gunittest seem to be legitimate, as the "--interface-description" call doesn't work for all binaries, but works for some.

Since I wasn't able to copy the text properly (it is using tmate), I had to take screenshots. I have more for my tries on enabling loader snaps (https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/show-loader-snaps, for example: gflags /i i.fft.exe +sls) and running with cdb.exe

r.tile works, i.fft doesn't (these were simple to type)

image
image
image

C:\OSGeo4W\opt>c:\OSGeo4W\opt\grass\grass85.bat --exec i.fft --interface-description                                    
WARNING: Concurrent mapset locking is not supported on Windows                                                                                                                                                                                  
C:\OSGeo4W\opt>c:\OSGeo4W\opt\grass\grass85.bat --exec r.surf.gauss --interface-description                             
WARNING: Concurrent mapset locking is not supported on Windows                                                                                                                                                                                  
C:\OSGeo4W\opt>c:\OSGeo4W\opt\grass\grass85.bat --exec i.pca --interface-description                                    
WARNING: Concurrent mapset locking is not supported on Windows                                                                                                                                                                                  
C:\OSGeo4W\opt>c:\OSGeo4W\opt\grass\grass85.bat --exec i.smap --interface-description                                   
WARNING: Concurrent mapset locking is not supported on Windows                                                                                                                                                                                  
C:\OSGeo4W\opt>c:\OSGeo4W\opt\grass\grass85.bat --exec v.lidar.correction --interface-description                       
WARNING: Concurrent mapset locking is not supported on Windows                                                                                                                                                                                  
C:\OSGeo4W\opt>c:\OSGeo4W\opt\grass\grass85.bat --exec r.gwflow --interface-description                                 
WARNING: Concurrent mapset locking is not supported on Windows                                                                                                                                                                                  
C:\OSGeo4W\opt>c:\OSGeo4W\opt\grass\grass85.bat --exec r.sim --interface-description                                    
WARNING: Concurrent mapset locking is not supported on Windows                                                          
'r.sim' is not recognized as an internal or external command,                                                           
operable program or batch file.                                                                                         
Press any key to continue . . .                                                                                                                                                                                                                 
C:\OSGeo4W\opt>c:\OSGeo4W\opt\grass\grass85.bat --exec r.sim.water --interface-description                              
WARNING: Concurrent mapset locking is not supported on Windows                                                          

C:\OSGeo4W\opt>   

image

Details

Capture d’écran 2025-05-12 193825
Capture d’écran 2025-05-12 193830
Capture d’écran 2025-05-12 193834
Capture d’écran 2025-05-12 193844
Capture d’écran 2025-05-12 193850
Capture d’écran 2025-05-12 193857
Capture d’écran 2025-05-12 193938
Capture d’écran 2025-05-12 194022
Capture d’écran 2025-05-12 194027
Capture d’écran 2025-05-12 192531
Capture d’écran 2025-05-12 192547
Capture d’écran 2025-05-12 192623
Capture d’écran 2025-05-12 192634
Capture d’écran 2025-05-12 192640
Capture d’écran 2025-05-12 192646
Capture d’écran 2025-05-12 192654
Capture d’écran 2025-05-12 192700
Capture d’écran 2025-05-12 193621
Capture d’écran 2025-05-12 193639
Capture d’écran 2025-05-12 193645
Capture d’écran 2025-05-12 193725
Capture d’écran 2025-05-12 193734
Capture d’écran 2025-05-12 193741
Capture d’écran 2025-05-12 193809
Capture d’écran 2025-05-12 193818

Capture d’écran 2025-05-12 194030
Capture d’écran 2025-05-12 194036
Capture d’écran 2025-05-12 194040
Capture d’écran 2025-05-12 194045
Capture d’écran 2025-05-12 194050
Capture d’écran 2025-05-12 194056
Capture d’écran 2025-05-12 194103
Capture d’écran 2025-05-12 194115
Capture d’écran 2025-05-12 194122
Capture d’écran 2025-05-12 194128
Capture d’écran 2025-05-12 194135
Capture d’écran 2025-05-12 194141
Capture d’écran 2025-05-12 194148
Capture d’écran 2025-05-12 195333
Capture d’écran 2025-05-12 195340
Capture d’écran 2025-05-12 195345

@echoix echoix merged commit 1613a87 into OSGeo:main May 14, 2025
24 of 26 checks passed
@echoix echoix deleted the cmake-locale-CMP0175-post_build branch May 14, 2025 15:58
@github-actions github-actions bot added this to the 8.5.0 milestone May 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CMake translation Message translation related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants