From 3b6c890cc3c45285d947a15b90098ae60ab5a72d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Jos=C3=A9=20Garc=C3=ADa=20Garc=C3=ADa?= Date: Fri, 28 Aug 2026 00:34:40 +0200 Subject: [PATCH] Tell the musl container which world it is building There are three cmake invocations in build-host.sh: stage 1, the staged path, and the musl container, which builds its arguments as a string of its own inside the container. The profile reached the first two. So a musl stage 2 configured without it, took the default world, and wrote a makepkg.conf saying CARCH=vita into a sysroot whose version_info.txt was copied from a softfp stage 1. validate-core-package.sh refused the result: world mismatch: version_info.txt says vita-softfp, bin/makepkg.conf CARCH says vita which is the check doing its job, an hour into the build. Pass it into the container and into that string. The test counts the invocations that carry the profile and checks the container is handed it, since a variable that never enters expands to nothing there. --- scripts/ci/build-host.sh | 3 ++- tests/ci/test-build-host-args.sh | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/scripts/ci/build-host.sh b/scripts/ci/build-host.sh index 912ff00..2581ecf 100755 --- a/scripts/ci/build-host.sh +++ b/scripts/ci/build-host.sh @@ -250,6 +250,7 @@ stage_and_write_provenance() { build_musl_host() { local -a docker_env=( -e VITASDK_HOST_NAME="$host" + -e VITASDK_PROFILE="$profile" -e VITASDK_SOURCE_REVISION="$revision" -e VITASDK_SOURCE_DATE_EPOCH="$source_date_epoch" -e CCACHE_DIR=/src/.ccache @@ -284,7 +285,7 @@ build_musl_host() { test -n "$STAGE1_DIR" mkdir -p /src/build cd /src/build - configure_args="-DVITASDK_STAGE1_DIR=$STAGE1_DIR -DVITASDK_SOURCE_REVISION=$VITASDK_SOURCE_REVISION -DVITASDK_SOURCE_DATE_EPOCH=$VITASDK_SOURCE_DATE_EPOCH -DVITASDK_HOST_NAME=$VITASDK_HOST_NAME" + configure_args="-DVITASDK_STAGE1_DIR=$STAGE1_DIR -DVITASDK_PROFILE=$VITASDK_PROFILE -DVITASDK_SOURCE_REVISION=$VITASDK_SOURCE_REVISION -DVITASDK_SOURCE_DATE_EPOCH=$VITASDK_SOURCE_DATE_EPOCH -DVITASDK_HOST_NAME=$VITASDK_HOST_NAME" targets="tarball" if [ -n "${VITASDK_PACKAGED_HOST:-}" ]; then configure_args="$configure_args -DBUILD_PACMAN_CLIENT=ON -DVITASDK_PACKAGE_VERSION=$VITASDK_PACKAGE_VERSION -DVDPM_BUNDLE=$VDPM_BUNDLE -DVDPM_BUNDLE_SHA256=$VDPM_BUNDLE_SHA256" diff --git a/tests/ci/test-build-host-args.sh b/tests/ci/test-build-host-args.sh index cc7fe47..f91b186 100755 --- a/tests/ci/test-build-host-args.sh +++ b/tests/ci/test-build-host-args.sh @@ -148,4 +148,25 @@ grep -qx -- '-DVITASDK_PROFILE=vita-softfp' "$recorded" || { } rm -f "$fake_bin/cmake" "$recorded" +# 7. Every cmake that configures the tree is told which world it is building. +# There are three -- stage 1, the staged path, and the musl container, which +# builds its arguments as a string of its own -- and the profile reached two +# of them. The third produced a stage 2 whose version_info.txt said one world +# and whose makepkg.conf said the other, which validate-core-package.sh +# refused after an hour of building. +configuring=$(grep -cE '^[[:space:]]*(cmake |configure_args=|-S "\$repo_root")' \ + "$repository_root/scripts/ci/build-host.sh" || true) +carrying=$(grep -c 'VITASDK_PROFILE' "$repository_root/scripts/ci/build-host.sh" || true) +if (( carrying < 4 )); then + printf 'not every cmake invocation carries the profile: %d mentions\n' "$carrying" >&2 + exit 1 +fi + +# And the container has to be handed it, or the string above expands to +# nothing inside it. +grep -q -- '-e VITASDK_PROFILE=' "$repository_root/scripts/ci/build-host.sh" || { + printf 'the musl container is not given the profile\n' >&2 + exit 1 +} + printf 'build-host.sh argument contract tests passed\n'