fix(release): exclude removed libraries from packages (#4297)

This commit is contained in:
Bharat Yadav 2026-10-12 13:01:13 +05:30 committed by GitHub
parent 0f0291e39b
commit f961c52ad8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 1 deletions

View File

@ -18,7 +18,7 @@ def package(platform, build, output, version):
if missing:
raise RuntimeError(f"Missing patched libraries: {', '.join(sorted(missing))}")
executable = "relinker.exe" if platform == "windows" else "relinker"
files = list(libraries)
files = [library for library in libraries if library.name in expected]
if platform == "windows":
runtime = Path("C:/winlibs/mingw64/bin")
files.extend(runtime / name for name in ("libgcc_s_seh-1.dll", "libstdc++-6.dll", "libwinpthread-1.dll"))

View File

@ -56,6 +56,18 @@ class ReleasePackageTests(unittest.TestCase):
with zipfile.ZipFile(self.output / "prx-linux-v1.0.zip") as archive:
self.assertEqual(archive.namelist(), ["libs/libc.prx"])
def test_removed_libraries_are_not_packaged_from_a_reused_build(self):
stale = self.library.with_name("libRemoved.prx")
stale.write_bytes(b"obsolete library")
package_release.package("linux", self.build, self.output, "v1.0")
with zipfile.ZipFile(self.output / "prx-linux-v1.0.zip") as archive:
self.assertEqual(archive.namelist(), ["libs/libc.prx"])
self.assertEqual(archive.read("libs/libc.prx"), b"library bytes")
with tarfile.open(self.output / "prx-linux-v1.0.tar.gz") as archive:
self.assertEqual(archive.getnames(), ["libs/libc.prx"])
self.assertEqual(archive.extractfile("libs/libc.prx").read(), b"library bytes")
self.assertEqual(stale.read_bytes(), b"obsolete library")
def test_tar_and_zip_include_the_same_symlink_contents(self):
target = self.library.with_name("libc.target")
self.library.rename(target)