diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d021c2c..e56a585 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,31 +13,13 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Restore Conan Cache - id: conan-cache-restore - uses: actions/cache/restore@v4 - with: - path: | - /home/runner/.conan2 - /home/runner/work/spectator-cpp/spectator-cpp/cmake-build - key: ${{ runner.os }}-conan - - name: Install System Dependencies run: | sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test - sudo apt-get update && sudo apt-get install -y binutils-dev g++-13 libiberty-dev + sudo apt-get update && sudo apt-get install -y binutils-dev g++-15 libiberty-dev - name: Build run: | ./setup-venv.sh source venv/bin/activate - ./build.sh - - - name: Save Conan Cache - id: conan-cache-save - uses: actions/cache/save@v4 - with: - path: | - /home/runner/.conan2 - /home/runner/work/spectator-cpp/spectator-cpp/cmake-build - key: ${{ steps.conan-cache-restore.outputs.cache-primary-key }} \ No newline at end of file + ./build.sh \ No newline at end of file diff --git a/build.sh b/build.sh index d8564f5..17f22ba 100755 --- a/build.sh +++ b/build.sh @@ -14,6 +14,7 @@ if [[ -z "$BUILD_TYPE" ]]; then fi BLUE="\033[0;34m" +RED="\033[0;31m" NC="\033[0m" if [[ "$1" == "clean" ]]; then @@ -26,11 +27,16 @@ if [[ "$1" == "clean" ]]; then fi if [[ "$OSTYPE" == "linux-gnu"* ]]; then - source /etc/os-release - if [[ "$NAME" == "Ubuntu" ]]; then - if [[ -z "$CC" ]]; then export CC=gcc-13; fi - if [[ -z "$CXX" ]]; then export CXX=g++-13; fi + if ! command -v gcc-15 &> /dev/null; then + echo -e "${RED}ERROR: gcc-15 is required but not found${NC}" + exit 1 fi + if ! command -v g++-15 &> /dev/null; then + echo -e "${RED}ERROR: g++-15 is required but not found${NC}" + exit 1 + fi + export CC=gcc-15 + export CXX=g++-15 fi echo -e "${BLUE}==== env configuration ====${NC}" @@ -44,6 +50,14 @@ if [[ ! -f "$HOME/.conan2/profiles/default" ]]; then conan profile detect fi +## Modify the default profile to set the compiler version and C++ standard +DEFAULT_PROFILE="$HOME/.conan2/profiles/default" +sed -i.bak -E \ + -e 's/^compiler\.version=.*/compiler.version=15.2/' \ + -e 's/^compiler\.cppstd=.*/compiler.cppstd=23/' \ + "$DEFAULT_PROFILE" +rm -f "$DEFAULT_PROFILE.bak" + if [[ ! -d $BUILD_DIR ]]; then echo -e "${BLUE}==== install required dependencies ====${NC}" conan install . --output-folder="$BUILD_DIR" --build="*" --settings=build_type="$BUILD_TYPE" diff --git a/conanfile.py b/conanfile.py index a6604bd..98b22dc 100644 --- a/conanfile.py +++ b/conanfile.py @@ -3,9 +3,18 @@ class SpectatorCppConan(ConanFile): settings = "os", "compiler", "build_type", "arch" requires = ( - "spdlog/1.15.0", - "gtest/1.14.0", - "boost/1.83.0", + "spdlog/1.17.0", + "gtest/1.17.0", + "boost/1.90.0", ) + # Boost.Cobalt is disabled because b2 builds an extra boost_cobalt_io_ssl library + # whenever it can find OpenSSL, but the boost/1.90.0 recipe does not list that library, + # so package_info() aborts with "built, but were not used in any boost module". The + # failure depends on whether OpenSSL headers happen to be visible on the build machine, + # which is why it broke CI but not local Linux builds. We do not use Cobalt, and + # disabling it stops b2 from building cobalt/cobalt_io/cobalt_io_ssl at all. + default_options = { + "boost/*:without_cobalt": True, + } tool_requires = () generators = "CMakeDeps", "CMakeToolchain" diff --git a/libs/writer/writer_types/CMakeLists.txt b/libs/writer/writer_types/CMakeLists.txt index 058b58b..035bf31 100644 --- a/libs/writer/writer_types/CMakeLists.txt +++ b/libs/writer/writer_types/CMakeLists.txt @@ -15,7 +15,6 @@ target_link_libraries(spectator-writer-types PUBLIC spectator-logger Boost::boost - Boost::system ) set(TEST_SOURCES diff --git a/libs/writer/writer_types/src/udp_writer.cpp b/libs/writer/writer_types/src/udp_writer.cpp index 3d395fd..a420899 100644 --- a/libs/writer/writer_types/src/udp_writer.cpp +++ b/libs/writer/writer_types/src/udp_writer.cpp @@ -35,7 +35,7 @@ bool UDPWriter::CreateSocket() try return false; } - m_endpoint = boost::asio::ip::udp::endpoint(boost::asio::ip::address::from_string(m_host), m_port); + m_endpoint = boost::asio::ip::udp::endpoint(boost::asio::ip::make_address(m_host), m_port); m_socketEstablished = true; Logger::info("UDPWriter: Socket created for {}:{}", m_host, m_port); return true; diff --git a/libs/writer/writer_types/test_utils/udp_server/CMakeLists.txt b/libs/writer/writer_types/test_utils/udp_server/CMakeLists.txt index 9f8c88c..7958e88 100644 --- a/libs/writer/writer_types/test_utils/udp_server/CMakeLists.txt +++ b/libs/writer/writer_types/test_utils/udp_server/CMakeLists.txt @@ -12,7 +12,7 @@ target_compile_definitions(udp_server_lib ) target_link_libraries(udp_server_lib PUBLIC - Boost::system + Boost::boost pthread ) @@ -27,5 +27,5 @@ target_include_directories(udp_server target_link_libraries(udp_server PUBLIC - Boost::system + Boost::boost ) \ No newline at end of file diff --git a/libs/writer/writer_types/test_utils/udp_server/udp_server.cpp b/libs/writer/writer_types/test_utils/udp_server/udp_server.cpp index fb6f12b..0c12c04 100644 --- a/libs/writer/writer_types/test_utils/udp_server/udp_server.cpp +++ b/libs/writer/writer_types/test_utils/udp_server/udp_server.cpp @@ -46,7 +46,7 @@ try boost::asio::io_context io_context; // Create an IPv4 socket bound to localhost (127.0.0.1) and port 1234 - const boost::asio::ip::udp::endpoint endpoint(boost::asio::ip::address::from_string("127.0.0.1"), port); + const boost::asio::ip::udp::endpoint endpoint(boost::asio::ip::make_address("127.0.0.1"), port); boost::asio::ip::udp::socket socket(io_context, boost::asio::ip::udp::v4()); try diff --git a/libs/writer/writer_types/test_utils/uds_server/CMakeLists.txt b/libs/writer/writer_types/test_utils/uds_server/CMakeLists.txt index 2a0a618..83762e5 100644 --- a/libs/writer/writer_types/test_utils/uds_server/CMakeLists.txt +++ b/libs/writer/writer_types/test_utils/uds_server/CMakeLists.txt @@ -12,7 +12,7 @@ target_compile_definitions(uds_server_lib ) target_link_libraries(uds_server_lib PUBLIC - Boost::system + Boost::boost pthread ) @@ -27,5 +27,5 @@ target_include_directories(uds_server target_link_libraries(uds_server PUBLIC - Boost::system + Boost::boost ) diff --git a/requirements.txt b/requirements.txt index eba6e90..fd26e8d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -conan==2.17.1 \ No newline at end of file +conan==2.29.0 diff --git a/spectator/CMakeLists.txt b/spectator/CMakeLists.txt index af8cfde..9b82857 100644 --- a/spectator/CMakeLists.txt +++ b/spectator/CMakeLists.txt @@ -30,7 +30,6 @@ target_link_libraries(spectator-registry PUBLIC spdlog::spdlog Boost::boost - Boost::system ) add_executable(registry-test test_registry.cpp) target_link_libraries(registry-test PRIVATE