From 6b7d7742905c688c3a136cc6b3f1221ca5f99dc2 Mon Sep 17 00:00:00 2001 From: Jesse Schwartzentruber Date: Thu, 16 Oct 2025 12:02:34 -0400 Subject: [PATCH] fix: Check for zst test artifacts --- src/fuzzfetch/core.py | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/fuzzfetch/core.py b/src/fuzzfetch/core.py index a1b6def2..913cec23 100644 --- a/src/fuzzfetch/core.py +++ b/src/fuzzfetch/core.py @@ -431,9 +431,11 @@ def resolve_targets(self, targets: Sequence[str]) -> None: resolve_url(self.artifact_url("mozsearch-distinclude.map")) for target in targets_remaining: - try: - resolve_url(self.artifact_url(f"{target}.tests.tar.gz")) - except FetcherException: # noqa: PERF203 + for ext in ("zst", "gz"): + with suppress(FetcherException): + resolve_url(self.artifact_url(f"{target}.tests.tar.{ext}")) + break + else: resolve_url(self.artifact_url(f"{target}.tests.zip")) def extract_build(self, path: PathArg) -> None: @@ -492,10 +494,12 @@ def extract_build(self, path: PathArg) -> None: if "gtest" in targets_remaining: targets_remaining.remove("gtest") - try: - self.extract_tar(self.artifact_url("gtest.tests.tar.gz"), path) - except FetcherException: - self.extract_zip(self.artifact_url("gtest.tests.zip"), path) + for ext in ("zst", "gz"): + with suppress(FetcherException): + self.extract_tar(self.artifact_url(f"gtest.tests.tar.{ext}")) + break + else: + self.extract_zip(self.artifact_url("gtest.tests.zip")) if self._platform.system == "Windows": libxul = "xul.dll" elif self._platform.system == "Linux": @@ -546,10 +550,12 @@ def extract_build(self, path: PathArg) -> None: # any still remaining targets are assumed to be test artifacts for target in targets_remaining: - try: - self.extract_tar(self.artifact_url(f"{target}.tests.tar.gz"), path=path) - except FetcherException: # noqa: PERF203 - self.extract_zip(self.artifact_url(f"{target}.tests.zip"), path=path) + for ext in ("zst", "gz"): + with suppress(FetcherException): + self.extract_tar(self.artifact_url(f"{target}.tests.tar.{ext}")) + break + else: + self.extract_zip(self.artifact_url(f"{target}.tests.zip")) # used by Pernosco to locate source ('\n' is expected) (path / "taskcluster-build-task").write_bytes(f"{self.task_id}\n".encode())