tor-browser

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

mac.star (1639B)


      1 # -*- bazel-starlark -*-
      2 # Copyright 2023 The Chromium Authors
      3 # Use of this source code is governed by a BSD-style license that can be
      4 # found in the LICENSE file.
      5 """Siso configuration for macOS."""
      6 
      7 load("@builtin//struct.star", "module")
      8 load("./clang_mac.star", "clang")
      9 load("./config.star", "config")
     10 load("./typescript_unix.star", "typescript")
     11 
     12 def __filegroups(ctx):
     13     fg = {}
     14     fg.update(clang.filegroups(ctx))
     15     fg.update(typescript.filegroups(ctx))
     16     return fg
     17 
     18 def __codesign(ctx, cmd):
     19     # codesign.py uses the last arguments as bundle.path
     20     # and it would remove existing files under bundle.path,
     21     # but siso could not detect such removal, so would cause failure
     22     # in subsequent steps. https://crbug.com/372628498
     23     # To capture such removal, specify the bundle path as output,
     24     # so hashfs.RetrieveUpdateEntriesFromLocal can detect them.
     25     bundle_path = ctx.fs.canonpath(cmd.args[-1])
     26     ctx.actions.fix(reconcile_outputdirs = [bundle_path])
     27 
     28 __handlers = {
     29     "codesign": __codesign,
     30 }
     31 __handlers.update(clang.handlers)
     32 __handlers.update(typescript.handlers)
     33 
     34 def __step_config(ctx, step_config):
     35     config.check(ctx)
     36     step_config = clang.step_config(ctx, step_config)
     37     step_config = typescript.step_config(ctx, step_config)
     38     step_config["rules"].extend([
     39         {
     40             "name": "codesign",
     41             "command_prefix": "python3 ../../build/config/apple/codesign.py ",
     42             "handler": "codesign",
     43         },
     44     ])
     45     return step_config
     46 
     47 chromium = module(
     48     "chromium",
     49     step_config = __step_config,
     50     filegroups = __filegroups,
     51     handlers = __handlers,
     52 )