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'