Skip to content

Fix build.sh on macOS and move the Docker image to gcc-15 - #149

Merged
ecbadeaux merged 1 commit into
mainfrom
Build-Fixes
Nov 4, 2026
Merged

ecbadeaux merged 1 commit into
mainfrom
Build-Fixes

Conversation

@ecbadeaux

Copy link
Copy Markdown
Contributor

Summary

Fixes two ways the local build breaks. No C++ changes.

  • build.sh fails on macOS. It writes compiler.version=15.2 into the default Conan profile on every OS. On macOS that profile describes Apple clang, so conan install stops with ERROR: 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 detect already records the installed Apple clang version.
  • The Docker image fails to build when the checkout has a host venv/. The venv is copied into the image with its interpreter links still pointing at host paths (on macOS, Homebrew's Python), so setup-venv.sh fails with No such file or directory: '/home/ubuntu/spectator-cpp/venv/bin/python3'. The image no longer copies venv/ or any cmake-build* directory.

Changes

  • build.sh: sets compiler.cppstd=23 on every OS, as before, and compiler.version=15 on Linux only. Conan's profile detection records gcc 5 and later by major version, and build.sh exports CC=gcc-15 before detection, so 15 is what a fresh Linux profile already contains; the edit only corrects older profiles. On Linux the only change is 15.2 → 15. Both are valid for gcc, and build.sh builds 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.sh requires gcc-15. The image currently gets it only because ubuntu:latest is 26.04, whose build-essential defaults to gcc-15; on a 24.04 base, build.sh stops with gcc-15 is required but not found.
  • Dockerfiles/Ubuntu.Dockerfile.dockerignore: excludes cmake-build*/ and venv/, instead of only cmake-build/.
  • .gitignore: cmake-build-*/ replaces the separate debug and release entries, so every cmake-build-* directory stays untracked.

Testing

  • Linux: built the image from this branch (Ubuntu 26.04.1, gcc 15.2.0) and ran ./build.sh in it, with Conan's build jobs capped at 4 to fit an 8 GB Docker VM. The profile got compiler.version=15 and compiler.cppstd=23, every dependency built from source, and all 18 tests passed.
  • macOS (Apple clang 21): ./build.sh left the profile's compiler.version=21 alone, set compiler.cppstd=23, built every dependency from source, and all 18 tests passed.
  • Docker context: with a macOS venv/ in the checkout, main's image fails at setup-venv.sh (exit code 127). With a macOS venv/ and a cmake-build-release/ in the checkout, this branch's image builds, its venv uses the image's Python, conan runs, and the build directory isn't copied.
  • Conan 2.29: rejects compiler.version=15.2 for apple-clang, and accepts both 15 and 15.2 for gcc.

Note for macOS

If you've run build.sh from main, ~/.conan2/profiles/default already says compiler.version=15.2, and this change no longer touches that line. Run conan profile detect --force once to restore it; build.sh re-applies compiler.cppstd=23.

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.
@ecbadeaux
ecbadeaux merged commit e6e65a1 into main Nov 4, 2026
1 check passed
@ecbadeaux
ecbadeaux deleted the Build-Fixes branch November 4, 2026 21:51
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.

1 participant