Skip to content
Merged
Show file tree
Hide file tree
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
26 changes: 21 additions & 5 deletions src/fuzzfetch/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from dataclasses import dataclass, fields
from datetime import datetime
from enum import Enum
from itertools import product
from itertools import chain, product
from logging import getLogger
from platform import machine as plat_machine
from platform import system as plat_system
Expand Down Expand Up @@ -232,6 +232,18 @@ def generate_task_paths(
task_path = f"/task/{build}"
task_template_paths = ((cls.TASKCLUSTER_API, task_path),)

if target_platform == "linux":
old_template_paths = tuple(task_template_paths)
task_template_paths = tuple(
chain(
old_template_paths,
[
(api, task_path.replace("linux-", "linux32-"))
for (api, task_path) in old_template_paths
],
)
)

for template_path, try_wo_opt in product(task_template_paths, (False, True)):
template, path = template_path

Expand Down Expand Up @@ -427,10 +439,14 @@ def from_platform_guess(cls, build_string: str) -> Platform:
match: list[str] = []
for system, platform in cls.SUPPORTED.items():
for machine, platform_guess in platform.items():
if platform_guess in build_string and (
not match or len(match[2]) < len(platform_guess)
):
match = [system, machine, platform_guess]
platform_guesses = [platform_guess]
if platform_guess == "linux":
platform_guesses.append("linux32")
for platform_guess in platform_guesses:
if platform_guess in build_string and (
not match or len(match[2]) < len(platform_guess)
):
match = [system, machine, platform_guess]
if match:
return cls(match[0], match[1])
raise FetcherException(f"Could not extract platform from {build_string}")
Expand Down
2 changes: 2 additions & 0 deletions tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ def test_platform_initialization_unsupported_machine():
("linux64", ("Linux", "x86_64", "linux64")),
("win64-aarch64", ("Windows", "arm64", "win64-aarch64")),
("android-aarch64", ("Android", "arm64", "android-aarch64")),
("linux32", ("Linux", "x86", "linux")),
("linux", ("Linux", "x86", "linux")),
],
)
def test_from_platform_guess(build_string, expected):
Expand Down