Sandbox 在自定义规则中禁用沙盒

Sandbox 在自定义规则中禁用沙盒,sandbox,bazel,rule,Sandbox,Bazel,Rule,如何在自定义Bazel规则中禁用沙盒 我希望此规则的每次实例化都始终禁用沙盒,而用户无需执行任何操作。在规则实现中创建操作时,包括包含值为1的no sandbox键的dict参数。这将强制操作永远不要在沙箱中运行 def _impl(ctx): ctx.actions.run_shell( outputs = [ctx.outputs.executable], command = "..", execution_requirements = { "no-s

如何在自定义Bazel规则中禁用沙盒


我希望此规则的每次实例化都始终禁用沙盒,而用户无需执行任何操作。

在规则实现中创建操作时,包括包含值为
1
no sandbox
键的dict参数。这将强制操作永远不要在沙箱中运行

def _impl(ctx):
  ctx.actions.run_shell(
    outputs = [ctx.outputs.executable],
    command = "..",
    execution_requirements = {
      "no-sandbox": "1",
      "no-cache": "1",
      "no-remote": "1",
      "local": "1",
    },
  )
有关这些标记/要求的更多信息,请参阅上的
标记
属性