Skip to content

ci: add Linux, macOS and Windows build checks - #360

Open
Blackhart wants to merge 46 commits into
AcademySoftwareFoundation:developfrom
Blackhart:ci/build-checks
Open

Blackhart wants to merge 46 commits into
AcademySoftwareFoundation:developfrom
Blackhart:ci/build-checks

Conversation

@Blackhart

@Blackhart Blackhart commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Linked issues

No issues (Technical improvement)

Summarize your change.

This PR adds a GitHub Actions workflow that builds xSTUDIO on three platforms:

  • Linux (Ubuntu 24.04 and Rocky 9, inside Docker)
  • macOS (Apple Silicon)
  • Windows (64-bit)

On each platform the job installs dependencies, then builds the project.
Unit tests are left out of CI for now (BUILD_TESTING=OFF): several tests still fail or time out (especially on Windows, and some on Linux). We can re-add a ctest step once those suites are cleaned up.
The PR also includes a few CMake and source fixes needed to compile with newer GCC on the Linux images and windows.

How Each OS Builds (and What Gets Cached)

Linux (Ubuntu 24.04 and Rocky Linux 9)

Linux builds run inside Docker containers based on Ubuntu 24.04 or Rocky Linux 9:

  1. Toolchain image: Each distribution has its own base image, containing the compiler, CMake, Ninja, and Qt. These images are stored in GitHub Container Registry (GHCR) and are rebuilt only when the Dockerfile or pinned toolchain/Qt versions change. A content-hash tag ensures that unchanged configurations reuse the existing image.
  2. Dependencies: Inside the container, vcpkg installs the third-party libraries. The resulting binary packages are cached as NuGet packages on GitHub Packages. Ubuntu and Rocky Linux use separate triplets to ensure ABI compatibility and prevent cache collisions.
  3. xSTUDIO: The application is built inside the same container, using the previously installed dependencies. Compilation is accelerated by sccache, which caches compiler outputs to avoid rebuilding unchanged source files.

macOS (Apple Silicon)

The macOS build runs on the GitHub Actions runner (macos-latest).

  1. Toolchain: Xcode/Clang, CMake, and Ninja are provided by the runner and Homebrew.
  2. Qt: Qt is downloaded using aqt and stored in the GitHub Actions cache, allowing subsequent runs to skip the download when the Qt version remains unchanged.
  3. Dependencies: Third-party libraries are installed using vcpkg. The resulting binary packages are cached as NuGet packages on GitHub Packages.
  4. xSTUDIO: The application is built on the host, with sccache accelerating compilation by reusing cached compiler outputs

Windows (x64, Visual Studio 2022)

The Windows build runs on the GitHub Actions runner (windows-2022).

  1. Toolchain: Visual Studio 2022 provides the MSVC compiler, while Ninja is used as the build system.
  2. Qt: Qt is downloaded using aqt and stored in the GitHub Actions cache, allowing subsequent runs to skip the download when the Qt version remains unchanged.
  3. Dependencies: Third-party libraries are installed using vcpkg. The resulting binary packages are cached as NuGet packages on GitHub Packages.
  4. xSTUDIO: The application is built on the host, with sccache accelerating compilation by reusing cached compiler outputs.

What the Organization Needs to Know

  1. GitHub Actions permissions: Enable GitHub Actions for the repository and ensure that the workflows are allowed to run the required actions and reusable workflows.
  2. Package publishing permissions: Allow GitHub Actions to publish packages using GITHUB_TOKEN:
    1. Linux: Push Docker toolchain images to GHCR and publish NuGet packages to GitHub Packages.
    2. macOS and Windows: Publish NuGet packages to the same GitHub Packages feed.
  3. Cost and storage: Standard GitHub-hosted runners use the organization's plan. No additional runner charges are expected as long as usage stays within the plan's allowances. The relevant storage allowances are:
    • Actions cache: 10 GB per repository by default, shared by Qt (macOS/Windows) and sccache.
    • GitHub Packages: Storage and bandwidth allowances depend on the organization's GitHub plan. GHCR container image storage and bandwidth are currently free.

Describe the reason for the change.

xSTUDIO targets Linux, macOS, and Windows. Compiling each pull request on those platforms before merge makes it easier to catch platform-specific build issues early, rather than discovering them later in the release cycle.

Describe what you have tested and on which operating system.

Verified via the new GitHub Actions workflow (build check, BUILD_TESTING=OFF):

  • Linux: Ubuntu 24.04 and Rocky 9, built in Docker on ubuntu-latest
  • macOS: Apple Silicon on macos-latest
  • Windows: Windows Server 2022 + VS 2022 (windows-2022)

Add a list of changes, and note any that might need special attention during the review.

Alongside the CI work, this PR includes a few patches so the build can complete on each platform, plus a couple of runtime fixes.

Two of the fixes are Python-related (tested on Linux; review welcome on impact for macOS / Windows and whether this is the right approach):

  • python/CMakeLists.txt (install layout): on non-Windows, pip install --prefix=… could put the pure-Python package under dist-packages (typical on Debian/Ubuntu) instead of lib/pythonX.Y/site-packages, where the rest of the build expects it. The step now copies the package into that site-packages location. Windows is unchanged and still uses pip install. Worth confirming this copy approach is acceptable on macOS too (same non-Windows branch).
  • src/embedded_python/src/embedded_python.cpp (runtime, non-Windows): on Debian/Ubuntu, libpython often lives under /usr/lib/<triplet>/. Walking two parents from that path produced an invalid PYTHONHOME, and the embedded interpreter could fail at startup (module 'sys' has no attribute 'stdout'). The code now sets PYTHONHOME only when the library sits directly under lib / lib64, keeps the existing macOS app-bundle (Contents/Frameworks) path, and honours XSTUDIO_PYTHONHOME (as Windows already did). Windows uses a separate code path and is untouched aside from that shared idea of an override env var on Unix.

Unit tests are not run in CI yet (BUILD_TESTING=OFF). Some dependencies used do not match what the docs recommend (for example, some tests needs FFmpeg 8+), and some tests still fail or time out on Windows and/or Linux.

This PR also does not publish release binaries. Before CI ships installers or archives, we should agree how to handle FFmpeg: some builds/codecs are GPL, and that choice needs a clear project decision.

xSTUDIO had no automated way to verify that the tree still builds on
current Linux distros. This adds a Docker-based compile gate so every
push proves Ubuntu 24.04 and Rocky 9 still configure and link cleanly.

Infrastructure:
- ci/linux/: Docker deps+compile recipes
- .github/workflows/build-compile.yml: run on every push
- GHCR push of deps images: reuse Qt/ffmpeg/etc across runs
- .dockerignore: keep the repo-root build context small

Build / toolchain patches:
- CMakeLists.txt + *CMakeLists (utility, global_store, …): link
  stdc++fs only on GCC/Clang < 9. Modern libstdc++ already has
  std::filesystem
- python/CMakeLists.txt: copy the pure-Python package instead of
  pip --prefix. Debian/Ubuntu pip lands in dist-packages, not the
  site-packages path install() expects, and can wipe the pybind .so
- embedded_python.cpp: fix LINUX PYTHONHOME. two-parent walk from
  multiarch libpython yields /usr/lib, which is not a valid prefix
  and breaks CPython ("sys has no attribute stdout")
- openimageio_metadata.cpp / openimageio.cpp: include fmt/ostream.h
  (and half.h) before OIIO. fmt 8 + C++20 errors on
  fallback_formatter<std::string>
- colour_pipeline.hpp: using make_pre_draw_gpu_hook. GCC 13
  -Woverloaded-virtual hides the base overload
- helper_ui.hpp: using JSONTreeModel::index. Same overloaded-virtual
  issue for QModelIndex overloads
- marker.hpp / playhead_actor.cpp: drop std::move on Uuid::generate(). Moving from a prvalue is wrong and tripped newer compilers
- conform_manager_actor.cpp: std::advance instead of std::next(it, n). List iterators are not random-access
- ffmpeg.cpp / media_metadata_hud.cpp: give Imath defaults an explicit
  zero value.
- ffmpeg_encode.py: raw-string regex \# is not a valid escape in
  modern Python regex literals

Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
The .github path was gitignored, so build-compile.yml never entered the
tree or remote. Stop ignoring .github and add the push-triggered
Ubuntu/Rocky compile workflow.

Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
Drop just, drive Linux deps via build-push-action with a registry
buildcache, rename compile→build, and split macOS into scripts/build-deps
and build-xstudio like Linux.

Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
Rename 00-build-tools/10-build-xstudio to build-tools/build-xstudio,
and remove the stray ci/linux/build-*.sh helpers that were not used by CI.

Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
Enable BUILD_TESTING in CI, add run-tests scripts (skip python_tests),
and let build.yml own parallelism instead of script-side defaults.

Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
…find

Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
…d-virtual

Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
Cache object files via Actions Cache keyed by ref (and Linux deps tag);
compile Linux with docker run + sccache volume, and install automake on macOS for vcpkg python3.

Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
Unquoted PowerShell & and split quoted run broke workflow parsing.

Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
CMake rejects INTERFACE includes under CMAKE_SOURCE_DIR when Qt lives in .ci-cache/.

Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
Match macOS/Windows so hit rates show even when the build fails.

Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
Root-owned cache files blocked actions/cache from saving the archive.

Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
Rename ambiguous loop variable; embed debug info so sccache can cache MSVC objects.

Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
Stats are already printed by the dedicated workflow step.

Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
Host --show-stats starts a fresh daemon; dump container stats to a file for the workflow step.

Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
windows-latest ships VS 2026 / MSVC 14.51, which breaks Qt 6.5.3.

Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
@Blackhart
Blackhart force-pushed the ci/build-checks branch 4 times, most recently from 3503978 to ee633d6 Compare October 30, 2026 11:11
Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
Reuse the same image when deps recipes are unchanged, instead of
last-write-wins mutable distro tags.

Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
…s images

Use a cached toolchain image on GHCR, install ports via the shared NuGet
feed, and keep distro-specific triplets for Ubuntu and Rocky.

Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
Allow git on host-mounted vcpkg inside the container, and remove
yasm from the Rocky toolchain image (not in the distro repos).

Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
vcpkg needs Mono to use the GitHub Packages binary cache on Linux;
drop curl on Rocky where curl-minimal is already installed.

Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
…n/Ubuntu

Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
…installers

Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
@Blackhart
Blackhart force-pushed the ci/build-checks branch 2 times, most recently from b117356 to 07651b0 Compare October 30, 2026 15:55
Signed-off-by: Thomas Manceau <manceau.thomas19@gmail.com>
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