From 2de75c46796d7f6837952c741e7f2defd51a9be3 Mon Sep 17 00:00:00 2001 From: Anthony Ronning <101225832+AnthonyRonning@users.noreply.github.com> Date: Tue, 3 Nov 2026 15:51:46 -0800 Subject: [PATCH] Fix Debian normalization test on macOS The test added in #1426 runs normalize_deb_package with the shell's ar. On Darwin that is llvm-ar, whose default BSD format pads members. The padding survives extraction, and GNU tar treats gzip's trailing garbage warning as fatal, so any Mac commit running the repo hook component stopped here. Have this test write GNU archives, which is what a Debian package is, when ar is llvm-ar. Packaging scripts and GNU ar runs are unchanged. Fixes #1438 Co-Authored-By: Claude Opus 5.5 --- scripts/ci/test_linux_rpm_packaging.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/ci/test_linux_rpm_packaging.py b/scripts/ci/test_linux_rpm_packaging.py index 25c94848c..994521524 100644 --- a/scripts/ci/test_linux_rpm_packaging.py +++ b/scripts/ci/test_linux_rpm_packaging.py @@ -68,6 +68,17 @@ def test_invalid_staging_identity_never_builds_rpm(self): self.assertNotEqual(result.returncode, 0) self.assertFalse(self.rpm.exists()) + def use_gnu_ar_format(self): + # Debian packages are GNU archives. llvm-ar writes BSD ones on Darwin, + # padding members with bytes that GNU tar rejects after gzip. + ar = shutil.which("ar") + version = subprocess.run([ar, "--version"], capture_output=True, text=True) + if "LLVM" not in version.stdout: + return + tool = self.bin / "ar" + tool.write_text(f'#!{shutil.which("bash")}\nexec "{ar}" --format=gnu "$@"\n') + tool.chmod(0o755) + def test_failed_extraction_is_not_hidden_by_cleanup(self): result = self.run_shell(''' ar() { return 19; } @@ -95,6 +106,7 @@ def test_appimage_extraction_excludes_privileged_xattrs(self): self.assertTrue((self.tauri / "extracted/AppRun").exists()) def test_deb_normalization_refreshes_checksums_and_verifier_rejects_tampering(self): + self.use_gnu_ar_format() self.deb.unlink() payload = self.root / "deb-input" (payload / "usr/bin").mkdir(parents=True)