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)