tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

update_verify.py (2395B)


      1 # This Source Code Form is subject to the terms of the Mozilla Public
      2 # License, v. 2.0. If a copy of the MPL was not distributed with this
      3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
      4 """
      5 Transform the beetmover task into an actual task description.
      6 """
      7 
      8 from taskgraph.transforms.base import TransformSequence
      9 from taskgraph.util.copy import deepcopy
     10 from taskgraph.util.treeherder import add_suffix, inherit_treeherder_from_dep
     11 
     12 from gecko_taskgraph.util.attributes import task_name
     13 
     14 transforms = TransformSequence()
     15 
     16 
     17 @transforms.add
     18 def add_command(config, tasks):
     19    config_tasks = {}
     20    for dep in config.kind_dependencies_tasks.values():
     21        if (
     22            "update-verify-config" in dep.kind
     23            or "update-verify-next-config" in dep.kind
     24        ):
     25            config_tasks[task_name(dep)] = dep
     26 
     27    for task in tasks:
     28        config_task = config_tasks[task["name"]]
     29        total_chunks = task["extra"]["chunks"]
     30        task["worker"].setdefault("env", {})["CHANNEL"] = config_task.task["extra"][
     31            "channel"
     32        ]
     33        task.setdefault("fetches", {})[config_task.label] = [
     34            "update-verify.cfg",
     35        ]
     36        task["treeherder"] = inherit_treeherder_from_dep(task, config_task)
     37 
     38        for this_chunk in range(1, total_chunks + 1):
     39            chunked = deepcopy(task)
     40            chunked["treeherder"]["symbol"] = add_suffix(
     41                chunked["treeherder"]["symbol"], this_chunk
     42            )
     43            chunked["label"] = "release-update-verify-{}-{}/{}".format(
     44                chunked["name"], this_chunk, total_chunks
     45            )
     46            if not chunked["worker"].get("env"):
     47                chunked["worker"]["env"] = {}
     48 
     49            command = [
     50                "tools/update-verify/scripts/chunked-verify.sh",
     51                f"--total-chunks={total_chunks} --this-chunk={this_chunk}",
     52            ]
     53 
     54            # Add upstream tools to the path
     55            if "linux64-libdmg" in chunked.get("fetches", {}).get("toolchain", []):
     56                path_override = "export PATH=$PATH:$MOZ_FETCHES_DIR/dmg &&"
     57                command.insert(0, path_override)
     58 
     59            chunked["run"] = {
     60                "using": "run-task",
     61                "cwd": "{checkout}",
     62                "command": " ".join(command),
     63                "sparse-profile": "update-verify",
     64            }
     65 
     66            yield chunked