Skip to content

Commit 24e2ce9

Browse files
authored
Tell the musl container which world it is building (#181)
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.
1 parent 90bd8e9 commit 24e2ce9

2 files changed

Lines changed: 23 additions & 1 deletion

File tree

scripts/ci/build-host.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ stage_and_write_provenance() {
250250
build_musl_host() {
251251
local -a docker_env=(
252252
-e VITASDK_HOST_NAME="$host"
253+
-e VITASDK_PROFILE="$profile"
253254
-e VITASDK_SOURCE_REVISION="$revision"
254255
-e VITASDK_SOURCE_DATE_EPOCH="$source_date_epoch"
255256
-e CCACHE_DIR=/src/.ccache
@@ -284,7 +285,7 @@ build_musl_host() {
284285
test -n "$STAGE1_DIR"
285286
mkdir -p /src/build
286287
cd /src/build
287-
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"
288+
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"
288289
targets="tarball"
289290
if [ -n "${VITASDK_PACKAGED_HOST:-}" ]; then
290291
configure_args="$configure_args -DBUILD_PACMAN_CLIENT=ON -DVITASDK_PACKAGE_VERSION=$VITASDK_PACKAGE_VERSION -DVDPM_BUNDLE=$VDPM_BUNDLE -DVDPM_BUNDLE_SHA256=$VDPM_BUNDLE_SHA256"

tests/ci/test-build-host-args.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,4 +148,25 @@ grep -qx -- '-DVITASDK_PROFILE=vita-softfp' "$recorded" || {
148148
}
149149
rm -f "$fake_bin/cmake" "$recorded"
150150

151+
# 7. Every cmake that configures the tree is told which world it is building.
152+
# There are three -- stage 1, the staged path, and the musl container, which
153+
# builds its arguments as a string of its own -- and the profile reached two
154+
# of them. The third produced a stage 2 whose version_info.txt said one world
155+
# and whose makepkg.conf said the other, which validate-core-package.sh
156+
# refused after an hour of building.
157+
configuring=$(grep -cE '^[[:space:]]*(cmake |configure_args=|-S "\$repo_root")' \
158+
"$repository_root/scripts/ci/build-host.sh" || true)
159+
carrying=$(grep -c 'VITASDK_PROFILE' "$repository_root/scripts/ci/build-host.sh" || true)
160+
if (( carrying < 4 )); then
161+
printf 'not every cmake invocation carries the profile: %d mentions\n' "$carrying" >&2
162+
exit 1
163+
fi
164+
165+
# And the container has to be handed it, or the string above expands to
166+
# nothing inside it.
167+
grep -q -- '-e VITASDK_PROFILE=' "$repository_root/scripts/ci/build-host.sh" || {
168+
printf 'the musl container is not given the profile\n' >&2
169+
exit 1
170+
}
171+
151172
printf 'build-host.sh argument contract tests passed\n'

0 commit comments

Comments
 (0)