Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 17 additions & 11 deletions src/fuzzfetch/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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":
Expand Down Expand Up @@ -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())
Expand Down