summaryrefslogtreecommitdiffstats
path: root/taskcluster/gecko_taskgraph/transforms/job
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
commitd8bbc7858622b6d9c278469aab701ca0b609cddf (patch)
treeeff41dc61d9f714852212739e6b3738b82a2af87 /taskcluster/gecko_taskgraph/transforms/job
parentReleasing progress-linux version 125.0.3-1~progress7.99u1. (diff)
downloadfirefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz
firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'taskcluster/gecko_taskgraph/transforms/job')
-rw-r--r--taskcluster/gecko_taskgraph/transforms/job/__init__.py15
-rw-r--r--taskcluster/gecko_taskgraph/transforms/job/mach.py2
-rw-r--r--taskcluster/gecko_taskgraph/transforms/job/mozharness.py2
3 files changed, 13 insertions, 6 deletions
diff --git a/taskcluster/gecko_taskgraph/transforms/job/__init__.py b/taskcluster/gecko_taskgraph/transforms/job/__init__.py
index b87f7e0955..54cedf513a 100644
--- a/taskcluster/gecko_taskgraph/transforms/job/__init__.py
+++ b/taskcluster/gecko_taskgraph/transforms/job/__init__.py
@@ -14,11 +14,12 @@ import json
import logging
import mozpack.path as mozpath
+from packaging.version import Version
from taskgraph.transforms.base import TransformSequence
from taskgraph.util.python_path import import_sibling_modules
from taskgraph.util.schema import Schema, validate_schema
from taskgraph.util.taskcluster import get_artifact_prefix
-from voluptuous import Any, Exclusive, Extra, Optional, Required
+from voluptuous import Any, Coerce, Exclusive, Extra, Optional, Required
from gecko_taskgraph.transforms.cached_tasks import order_tasks
from gecko_taskgraph.transforms.task import task_description_schema
@@ -62,7 +63,7 @@ job_description_schema = Schema(
"optimization"
],
Optional("use-sccache"): task_description_schema["use-sccache"],
- Optional("use-system-python"): bool,
+ Optional("use-python"): Any("system", "default", Coerce(Version)),
Optional("priority"): task_description_schema["priority"],
# The "when" section contains descriptions of the circumstances under which
# this task should be included in the task graph. This will be converted
@@ -245,9 +246,15 @@ def get_attribute(dict, key, attributes, attribute_name):
@transforms.add
def use_system_python(config, jobs):
for job in jobs:
- if job.pop("use-system-python", True):
+ taskcluster_python = job.pop("use-python", "system")
+ if taskcluster_python == "system":
yield job
else:
+ if taskcluster_python == "default":
+ python_version = "python" # the taskcluster default alias
+ else:
+ python_version = f"python-{taskcluster_python}"
+
fetches = job.setdefault("fetches", {})
toolchain = fetches.setdefault("toolchain", [])
if "win" in job["worker"]["os"]:
@@ -259,7 +266,7 @@ def use_system_python(config, jobs):
else:
raise ValueError("unexpected worker.os value {}".format(platform))
- toolchain.append("{}-python".format(platform))
+ toolchain.append(f"{platform}-{python_version}")
worker = job.setdefault("worker", {})
env = worker.setdefault("env", {})
diff --git a/taskcluster/gecko_taskgraph/transforms/job/mach.py b/taskcluster/gecko_taskgraph/transforms/job/mach.py
index 775213f8fe..5f830ec04b 100644
--- a/taskcluster/gecko_taskgraph/transforms/job/mach.py
+++ b/taskcluster/gecko_taskgraph/transforms/job/mach.py
@@ -50,7 +50,7 @@ def configure_mach(config, job, taskdesc):
if python:
del run["python-version"]
- if taskdesc.get("use-system-python"):
+ if taskdesc.get("use-python", "system") == "system":
if worker["os"] == "macosx" and python == 3:
python = "/usr/local/bin/python3"
diff --git a/taskcluster/gecko_taskgraph/transforms/job/mozharness.py b/taskcluster/gecko_taskgraph/transforms/job/mozharness.py
index 4d7293ec51..ada5b85ea3 100644
--- a/taskcluster/gecko_taskgraph/transforms/job/mozharness.py
+++ b/taskcluster/gecko_taskgraph/transforms/job/mozharness.py
@@ -289,7 +289,7 @@ def mozharness_on_generic_worker(config, job, taskdesc):
system_python_dir = ""
gecko_path = "$GECKO_PATH"
- if run.get("use-system-python", True):
+ if run.get("use-python", "system") == "system":
python_bindir = system_python_dir
else:
# $MOZ_PYTHON_HOME is going to be substituted in run-task, when we