From 446f30b3de12abe16f4de3fef17cde0f8c9a5e7e Mon Sep 17 00:00:00 2001 From: Paul Hammant Date: Sun, 1 Nov 2026 22:26:02 +0000 Subject: [PATCH] test: abi_policy's catalog imports leave no stub directory (#3485) f52e0e756 made a refused binary import remove its stub directory and checked it for the ownership refusals in binary_import_ownership. The catalog refusals (ae_lib_check_compat) go through the same path; abi_policy already builds those catalogs from the real header, so its import_it now gives each import a temp dir of its own (cygpath'd on Windows, as binary_import_ownership does) and fails on a leftover ae-binimport-*. With ae_remove_binimport_stubdirs made a no-op, all five catalog cases fail (major, duty, newer, otherabi, legacy); with main's ae.c they pass. From the closed #3506, which carried this beside a duplicate of the fix. Co-Authored-By: Claude Opus 5.5 --- ...1T222601Z-added-abi-policy-stubdir-check.md | 5 +++++ .../integration/abi_policy/test_abi_policy.sh | 18 +++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 new_changelogs/20261101T222601Z-added-abi-policy-stubdir-check.md diff --git a/new_changelogs/20261101T222601Z-added-abi-policy-stubdir-check.md b/new_changelogs/20261101T222601Z-added-abi-policy-stubdir-check.md new file mode 100644 index 000000000..b04628347 --- /dev/null +++ b/new_changelogs/20261101T222601Z-added-abi-policy-stubdir-check.md @@ -0,0 +1,5 @@ +- **`abi_policy` checks that a catalog import leaves no stub directory** (#3485). + Each of its hand-made catalogs (another major, an unknown duty, a newer minor, + another runtime ABI, a legacy shared runtime) is imported with a temp dir of + its own, and a leftover `ae-binimport-*` fails the test, as + `binary_import_ownership` already does for the ownership refusals. diff --git a/tests/integration/abi_policy/test_abi_policy.sh b/tests/integration/abi_policy/test_abi_policy.sh index 1a472978c..c5a2af230 100644 --- a/tests/integration/abi_policy/test_abi_policy.sh +++ b/tests/integration/abi_policy/test_abi_policy.sh @@ -4,7 +4,8 @@ # - the importer: a catalog of another major, one that requires a duty this # importer does not know (refused, naming it, both versions and the fix), # one of a newer minor with nothing new to do (read), and shared-runtime -# libraries of another runtime ABI or of none recorded (refused); +# libraries of another runtime ABI or of none recorded (refused), none of +# them leaving its stub directory in the temp dir (#3485); # - the first call: a library compiled for another runtime ABI than the # runtime it links returns zero values with AETHER_INCOMPATIBLE, none of # its code run, and its preflight says why; @@ -53,9 +54,20 @@ fake() { cp "$SCRIPT_DIR/app.ae" "$d/app.ae" } -# $1 = case dir: 0 when the importer built the program +# $1 = case dir: 0 when the importer built the program. #3485: in a temp +# directory of its own, so what the import leaves there can be seen: the +# stub directory it wrote is removed, whether it was refused or not. import_it() { - (cd "$TMP/$1" && "$AE" build app.ae -o app > build.log 2>&1) + tmp="$TMP/$1/tmp" + mkdir -p "$tmp" + tmp_env="$tmp" + command -v cygpath >/dev/null 2>&1 && tmp_env="$(cygpath -m "$tmp")" + (cd "$TMP/$1" && TMPDIR="$tmp_env" TEMP="$tmp_env" TMP="$tmp_env" \ + "$AE" build app.ae -o app > build.log 2>&1) + rc=$? + left="$(ls -d "$tmp"/ae-binimport-* 2>/dev/null)" + [ -z "$left" ] || bad "$1: the import left its stub directory ($left)" "$TMP/$1/build.log" + return $rc } # $1 = case dir, $2 = a fixed string its build log must hold, $3 = label