Repository navigation
Fix build.sh on macOS and move the Docker image to gcc-15 - #149
Merged
Merged
Conversation
build.sh wrote compiler.version=15.2 into the default Conan profile on
every platform. On macOS that is the Apple clang version, which Conan
rejects ("Invalid setting '15.2'"), so the build failed. It now sets the
C++ standard everywhere and the compiler version only on Linux, as the
major version 15, which matches any gcc 15 release.
The Ubuntu image installed gcc-13, but build.sh requires gcc-15 and
stops without it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes two ways the local build breaks. No C++ changes.
build.shfails on macOS. It writescompiler.version=15.2into the default Conan profile on every OS. On macOS that profile describes Apple clang, soconan installstops withERROR: Invalid setting '15.2' is not a valid 'settings.compiler.version' value.The script now sets the compiler version only on Linux. On macOS,conan profile detectalready records the installed Apple clang version.venv/. The venv is copied into the image with its interpreter links still pointing at host paths (on macOS, Homebrew's Python), sosetup-venv.shfails withNo such file or directory: '/home/ubuntu/spectator-cpp/venv/bin/python3'. The image no longer copiesvenv/or anycmake-build*directory.Changes
build.sh: setscompiler.cppstd=23on every OS, as before, andcompiler.version=15on Linux only. Conan's profile detection records gcc 5 and later by major version, andbuild.shexportsCC=gcc-15before detection, so15is what a fresh Linux profile already contains; the edit only corrects older profiles. On Linux the only change is15.2→15. Both are valid for gcc, andbuild.shbuilds every dependency from source either way, so CI is unaffected.Dockerfiles/Ubuntu.Dockerfile: installs gcc-15 and g++-15 instead of gcc-13 and g++-13, adding CI's toolchain PPA and the other packages CI installs (binutils-dev,libiberty-dev).build.shrequires gcc-15. The image currently gets it only becauseubuntu:latestis 26.04, whosebuild-essentialdefaults to gcc-15; on a 24.04 base,build.shstops withgcc-15 is required but not found.Dockerfiles/Ubuntu.Dockerfile.dockerignore: excludescmake-build*/andvenv/, instead of onlycmake-build/..gitignore:cmake-build-*/replaces the separate debug and release entries, so everycmake-build-*directory stays untracked.Testing
./build.shin it, with Conan's build jobs capped at 4 to fit an 8 GB Docker VM. The profile gotcompiler.version=15andcompiler.cppstd=23, every dependency built from source, and all 18 tests passed../build.shleft the profile'scompiler.version=21alone, setcompiler.cppstd=23, built every dependency from source, and all 18 tests passed.venv/in the checkout, main's image fails atsetup-venv.sh(exit code 127). With a macOSvenv/and acmake-build-release/in the checkout, this branch's image builds, its venv uses the image's Python,conanruns, and the build directory isn't copied.compiler.version=15.2for apple-clang, and accepts both15and15.2for gcc.Note for macOS
If you've run
build.shfrom main,~/.conan2/profiles/defaultalready sayscompiler.version=15.2, and this change no longer touches that line. Runconan profile detect --forceonce to restore it;build.shre-appliescompiler.cppstd=23.