Skip to content

Conversation

samumbach
Copy link
Contributor

As of CMake 4.0, backward compatibility with versions of CMake older than 3.5 is removed.

This change is inspired/informed by similar changes in other projects:

@maxsharabayko maxsharabayko added this to the v1.6.0 milestone May 13, 2025
@maxsharabayko maxsharabayko added Type: Maintenance Work required to maintain or clean up the code [build] Area: Changes in build files labels May 13, 2025
@yaruno
Copy link
Contributor

yaruno commented May 14, 2025

Thank you for raising this. Just bumped into this issue after updating OSX and cmake to 4.x . I'm using a node js wrapper https://github.com/Eyevinn/node-srt that utilizes this library and was wondering why the srt library kept on failing to compile.

@yaruno
Copy link
Contributor

yaruno commented May 14, 2025

MacOS build seems to be failing due to incompatible version of C++. Might need a version bump to 17 (-DUSE_CXX_STD=17) or downgrade of googletest.

@ethouris
Copy link
Collaborator

This C++17 is a requiremet from Google Test. I don't know what happened, but CI builds should use Google Test with the version that is defined in this cmake build.

@yaruno
Copy link
Contributor

yaruno commented May 14, 2025

Also following test seems to be failing: not sure if it's flakyness or has there been some breaking changes ?

[ RUN ] ReuseAddr.Wildcard
[T/S] serverSocket: creating listener socket
[T/S] Bind @994411727 to: 0.0.0.0:5000 (IPv4)
[T/S] ... result 0 (expected to succeed)
[T/S] serverSocket: creating binder socket
[T/S] Bind @994411726 to: 172.17.0.2:5000 (IPv4)
07:52:48.038527/old*E:SRT.sm: bind: Address: 172.17.0.2:5000 conflicts with existing IPv4 wildcard binding: 0.0.0.0:5000
[T/S] ... result -1 (expected to fail)
[T/S] Binding should fail: Operation not supported: Another socket is bound to that port and is not reusable for requested settings
[T/S] Listener/binder sock @994411727 added to server_pollid
[T/C] Setting up client socket
[T/S] Wait 10s on E87 for acceptance on @994411727 ...
[T/C] Connecting to: 127.0.0.1:5000 (IPv4)
[T/S] Accepted from: 127.0.0.1:50775
[T/S] Wait for data reception...
[T/C] Waiting for connection readiness...
[T/C] Client exit
[T/S] closing client socket
[T/S] closing sockets: ACP:@994411724...
/github/workspace/test/test_main.cpp:207: Failure
Expected: (close_error) != (SRT_EINVSOCK), actual: 5004 vs 5004

@yaruno
Copy link
Contributor

yaruno commented May 14, 2025

This C++17 is a requiremet from Google Test. I don't know what happened, but CI builds should use Google Test with the version that is defined in this cmake build.

It looks like the brew formula https://formulae.brew.sh/api/formula/googletest.json installs google test version 1.17.0 and the 1.17.x version seems to have compile target for c++ 17 https://github.com/google/googletest/blob/52eb8108c5bdec04579160ae17225d66034bd723/googletest/cmake/internal_utils.cmake#L198 where as 1.16.x had for c++ 14 https://github.com/google/googletest/blob/6910c9d9165801d8827d628cb72eb7ea9dd538c5/googletest/cmake/internal_utils.cmake#L198 .

Update:

Aha, it's there on the first page https://github.com/google/googletest?tab=readme-ov-file#release-1170 .

"Release 1.17.0 is now available.

The 1.17.x branch [requires at least C++17]((https://opensource.google/documentation/policies/cplusplus-support#c_language_standard)."

@yaruno
Copy link
Contributor

yaruno commented May 14, 2025

Might need to add something along the lines of:

brew tap homebrew/core --force

brew extract --version=1.16.0 googletest $USER/oldstuff

brew install $USER/oldstuff/googletest@1.16.0

to the github workfile to roll back older version of google test..

Something like this #3170

@ethouris
Copy link
Collaborator

The best approach is if GTest is not installed in the system, but downloaded by the build script in the version as specified there.

Not sure what happened, but some properties of the side software used have been likely changed behind our back. Some fixes are already prepared also for the non-working CI, but it was not intended to be added to 1.5.5 release.

@ethouris ethouris modified the milestones: v1.6.0, v1.5.5 May 15, 2025
@ethouris
Copy link
Collaborator

Note also that some of the tests have a tendency to have random fails; this results mainly from things happening depending on some slight time differences. Fixes for these problems are underway, but they will be added only to 1.6.0.

@cl-ment cl-ment changed the title Update for compatibility with CMake 4.x [build] Update for compatibility with CMake 4.x May 19, 2025
@cl-ment cl-ment merged commit 0def1b1 into Haivision:master May 19, 2025
6 of 11 checks passed
@samumbach samumbach deleted the cmake-4-compatibility branch May 19, 2025 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[build] Area: Changes in build files Type: Maintenance Work required to maintain or clean up the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compatibility with CMake < 3.5 will be removed from a future version of CMake.
5 participants