tor-browser

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

repackage_set_upstream_mac_kind.py (1469B)


      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 mac notarization tasks
      6 """
      7 
      8 from taskgraph.transforms.base import TransformSequence
      9 from taskgraph.util.dependencies import get_primary_dependency
     10 from taskgraph.util.schema import resolve_keyed_by
     11 
     12 from gecko_taskgraph.util.attributes import release_level
     13 
     14 transforms = TransformSequence()
     15 
     16 
     17 @transforms.add
     18 def repackage_set_upstream_mac_kind(config, tasks):
     19    """
     20    Notarization only runs on level 3
     21    If level < 3 then repackage the mac-signing task artifact
     22    Exception for debug builds, which will use signed build on level 3
     23    """
     24    for task in tasks:
     25        primary_dep = get_primary_dependency(config, task)
     26        assert primary_dep
     27 
     28        if "macosx64" not in primary_dep.attributes["build_platform"]:
     29            task.pop("upstream-mac-kind")
     30            yield task
     31            continue
     32        resolve_keyed_by(
     33            task,
     34            "upstream-mac-kind",
     35            item_name=config.kind,
     36            **{
     37                "build-platform": primary_dep.attributes["build_platform"],
     38                "release-level": release_level(config.params),
     39            },
     40        )
     41        upstream_mac_kind = task.pop("upstream-mac-kind")
     42 
     43        if primary_dep.kind != upstream_mac_kind:
     44            continue
     45        yield task