mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-11-07 01:53:24 +09:00
- a new build-guard job configures both Linux lines on one runner (configure only, disaggregation branches) and outputs identical, different or unknown with its runner image and compiler; it is continue-on-error at job level, so it never fails the run, and it takes MOBILEGL_CI_DISAGGREGATED from build-linux's branch expression, so a drifted branch list gives different - build_fingerprint.py guard: one shared FetchContent directory (normalised as @DEPS@) so only the first configure fetches, a failed configure, or one killed with its process group after 10 minutes, retried once, and unknown for a configure that failed twice, any error or too little evidence; different is a warning annotation and unknown a notice, each with its first reasons; the toolchain is recorded, not compared; self-test cases for both sides thin, no libMobileGL.so link, a hung configure, the retry after a failure and after a timeout, the annotations, the shared directory and every verdict - build-linux-split builds nothing only on identical, and the consumers take build-linux's artifacts only then; different and unknown keep both builds, the full split matrix, A/B and the split unit run, and no consumer can red on a disagreement - build-linux drops its probe and runs the link ratchet on every disaggregation build as link-ratchet-primary; integration-split reds on it when it takes that build and prints both jobs' image and compiler - build-linux exports its build type, and the split consumers refuse to reuse a build-linux that is not Release (split_reuse_build_type.sh, self-test in pipe-gates): a debug-logging re-run of failed jobs keeps the guard's Release verdict - configure_build.sh passes extra arguments through to cmake
78 lines
3.1 KiB
Bash
78 lines
3.1 KiB
Bash
#!/bin/bash
|
|
# MobileGL - scripts/ci/configure_build.sh
|
|
# Copyright (c) 2025-2026 MobileGL-Dev
|
|
# Licensed under the GNU Lesser General Public License v3.0:
|
|
# https://www.gnu.org/licenses/gpl-3.0.txt
|
|
# https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
# SPDX-License-Identifier: LGPL-3.0-only
|
|
# End of Source File Header
|
|
|
|
# The configure lines of the two Linux library builds, in one place, so build-linux and
|
|
# build-linux-split run exactly these and build_fingerprint.py can configure either one as a probe.
|
|
# primary build-linux's: CI_BUILD_TYPE (default Release), MOBILEGL_CI_DISAGGREGATED (ON or OFF,
|
|
# required) for the transport, the benchmarks, compile_commands.json.
|
|
# split build-linux-split's: Release, the transport and its in-process arm always on.
|
|
# Both default to Release at the INFO log level, like the shipped build. INFO is load-bearing: the
|
|
# library logs the resolved transport at INFO, and run_trace_case.cmake and the split lanes read
|
|
# that line back as proof the transport resolved in the process under test.
|
|
#
|
|
# usage: configure_build.sh <primary|split> <build dir> [extra cmake arguments...]
|
|
# with MOBILEGL_CI_CC, MOBILEGL_CI_CXX and VK_ICD_FILENAMES from setup-test-runner. The builds pass
|
|
# no extra arguments; build_fingerprint.py's guard passes its shared FetchContent directory.
|
|
set -euo pipefail
|
|
|
|
variant="${1:?usage: configure_build.sh <primary|split> <build dir>}"
|
|
build_dir="${2:?usage: configure_build.sh <primary|split> <build dir>}"
|
|
shift 2
|
|
|
|
common=(
|
|
-S . -B "${build_dir}" -G Ninja
|
|
-DCMAKE_C_COMPILER="${MOBILEGL_CI_CC}"
|
|
-DCMAKE_CXX_COMPILER="${MOBILEGL_CI_CXX}"
|
|
-DCMAKE_C_COMPILER_LAUNCHER=ccache
|
|
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
|
|
)
|
|
|
|
case "${variant}" in
|
|
primary)
|
|
disaggregated="${MOBILEGL_CI_DISAGGREGATED:?the primary build needs MOBILEGL_CI_DISAGGREGATED (ON or OFF)}"
|
|
flags=(
|
|
-DCMAKE_BUILD_TYPE="${CI_BUILD_TYPE:-Release}"
|
|
-DMOBILEGL_LOG_ACTIVE_LEVEL=MOBILEGL_LOG_LEVEL_INFO
|
|
-DMOBILEGL_BUILD_TEST=ON
|
|
-DMOBILEGL_BUILD_BENCHMARK=ON
|
|
-DMOBILEGL_BUILD_INTEGRATION_TEST=ON
|
|
-DMOBILEGL_ITEST_VK_ICD="${VK_ICD_FILENAMES}"
|
|
-DMOBILEGL_BUILD_TRACE_REPLAY=OFF
|
|
-DMOBILEGL_BUILD_DISAGGREGATED="${disaggregated}"
|
|
-DMOBILEGL_BUILD_DISAGGREGATED_INPROC="${disaggregated}"
|
|
-DMOBILEGL_PIPE_VERIFY=OFF
|
|
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
|
|
-DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON
|
|
-DBENCHMARK_ENABLE_TESTING=OFF
|
|
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
|
|
)
|
|
;;
|
|
split)
|
|
# _INPROC implies _DISAGGREGATED; both are passed, so neither depends on remembering that.
|
|
flags=(
|
|
-DCMAKE_BUILD_TYPE=Release
|
|
-DMOBILEGL_LOG_ACTIVE_LEVEL=MOBILEGL_LOG_LEVEL_INFO
|
|
-DMOBILEGL_BUILD_TEST=ON
|
|
-DMOBILEGL_BUILD_BENCHMARK=OFF
|
|
-DMOBILEGL_BUILD_INTEGRATION_TEST=ON
|
|
-DMOBILEGL_ITEST_VK_ICD="${VK_ICD_FILENAMES}"
|
|
-DMOBILEGL_BUILD_TRACE_REPLAY=OFF
|
|
-DMOBILEGL_BUILD_DISAGGREGATED=ON
|
|
-DMOBILEGL_BUILD_DISAGGREGATED_INPROC=ON
|
|
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
|
|
)
|
|
;;
|
|
*)
|
|
echo "configure_build.sh: unknown variant '${variant}' (primary or split)" >&2
|
|
exit 2
|
|
;;
|
|
esac
|
|
|
|
cmake "${common[@]}" "${flags[@]}" "$@"
|