From 4339bd69f2fbcc1379ceffd08b094d0c3738335d 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 14:04:21 +0200 Subject: [PATCH] Name the softfp world so makepkg can build in it makepkg turns CARCH into shell variable names -- depends_$CARCH, provides_$CARCH and five more -- so a world name with a hyphen in it is not a name makepkg can use. With CARCH=vita-softfp, bash reads ${provides_vita-softfp[@]} as ${provides_vita-...}: the variable provides_vita with the default value 'softfp[@]'. It appends that literal string to all seven arrays, and then the matching unset fails because the identifier is invalid and makepkg aborts. The abort is what saved us. Without it every softfp package would have shipped with a fabricated depends=softfp[@]. pacman assumes architectures are identifiers -- x86_64, aarch64, armv7h -- and never says so, because nobody had used a hyphen. So the world is vita_softfp now, and Profiles.cmake refuses any name that would break the same way. --- CMakeLists.txt | 2 +- cmake/Profiles.cmake | 14 ++++++++++++-- scripts/validate-core-package.sh | 2 +- tests/ci/test-build-host-args.sh | 4 ++-- tests/protocol/test-describe-lock.sh | 2 +- 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1196d2b..0eec244 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -127,7 +127,7 @@ if(NOT VITASDK_FLOAT_ABI STREQUAL "hard" AND NOT VITASDK_FLOAT_ABI STREQUAL "sof message(FATAL_ERROR "VITASDK_FLOAT_ABI must be 'hard' or 'softfp', got '${VITASDK_FLOAT_ABI}'") endif() if(VITASDK_FLOAT_ABI STREQUAL "softfp") - set(world_arch "vita-softfp") + set(world_arch "vita_softfp") else() set(world_arch "vita") endif() diff --git a/cmake/Profiles.cmake b/cmake/Profiles.cmake index ca3f557..ea63d4c 100644 --- a/cmake/Profiles.cmake +++ b/cmake/Profiles.cmake @@ -1,10 +1,20 @@ include_guard(GLOBAL) # Published profile (world) names; describe rejects anything else. -set(VITASDK_PROFILES vita vita-softfp) +set(VITASDK_PROFILES vita vita_softfp) # The float ABI each profile bakes into the toolchain. A profile is a world and # a world is named by the architecture its packages carry, so the name is the # same on both sides of the build. set(VITASDK_PROFILE_FLOAT_ABI_vita hard) -set(VITASDK_PROFILE_FLOAT_ABI_vita-softfp softfp) +set(VITASDK_PROFILE_FLOAT_ABI_vita_softfp softfp) + +# makepkg builds shell variable names from CARCH (depends_$CARCH), so a world +# whose name is not an identifier corrupts them and then aborts the build. +foreach(profile IN LISTS VITASDK_PROFILES) + if(NOT profile MATCHES "^[A-Za-z_][A-Za-z0-9_]*$") + message(FATAL_ERROR + "profile '${profile}' is not a valid shell identifier; makepkg " + "expands depends_${profile} and friends") + endif() +endforeach() diff --git a/scripts/validate-core-package.sh b/scripts/validate-core-package.sh index f9cf339..3b77398 100755 --- a/scripts/validate-core-package.sh +++ b/scripts/validate-core-package.sh @@ -61,7 +61,7 @@ if [[ $pkgname == vitasdk-core ]]; then exit 1 } - # The world (vita, vita-softfp, ...) is stamped in two independent places; + # The world (vita, vita_softfp, ...) is stamped in two independent places; # a mismatch means the build tagged the release for one world while # actually configuring the toolchain, or makepkg, for another. world_from_version=$(bsdtar -xOf "$package" version_info.txt | diff --git a/tests/ci/test-build-host-args.sh b/tests/ci/test-build-host-args.sh index f91b186..ea1ae13 100755 --- a/tests/ci/test-build-host-args.sh +++ b/tests/ci/test-build-host-args.sh @@ -140,9 +140,9 @@ run_build_host \ --host x86_64-linux-gnu --stage 1 \ --artifacts-dir "$temporary_directory/artifacts-6" --out-dir "$temporary_directory/out-6" \ --build-id sha256:test --version 0.1.1 --revision "$revision" \ - --profile vita-softfp --packaged false >/dev/null 2>&1 || true + --profile vita_softfp --packaged false >/dev/null 2>&1 || true -grep -qx -- '-DVITASDK_PROFILE=vita-softfp' "$recorded" || { +grep -qx -- '-DVITASDK_PROFILE=vita_softfp' "$recorded" || { printf 'stage 1 did not pass the profile to cmake:\n%s\n' "$(cat "$recorded")" >&2 exit 1 } diff --git a/tests/protocol/test-describe-lock.sh b/tests/protocol/test-describe-lock.sh index 50b596b..d208e61 100755 --- a/tests/protocol/test-describe-lock.sh +++ b/tests/protocol/test-describe-lock.sh @@ -33,7 +33,7 @@ second_run=$(describe --profile vita --revision "$base_rev") base_build_id=$(field build_id <<< "$first_run") # Changing the profile changes build_id, same revision. -softfp_build_id=$(describe --profile vita-softfp --revision "$base_rev" | field build_id) +softfp_build_id=$(describe --profile vita_softfp --revision "$base_rev" | field build_id) [[ $base_build_id != "$softfp_build_id" ]] || { printf 'build_id did not change when the profile changed\n' >&2 exit 1