Skip to content

Instantly share code, notes, and snippets.

@william-smith-skydio
Last active February 22, 2024 19:32
Show Gist options
  • Save william-smith-skydio/1e4c008043713f0fc470c8d944ab5993 to your computer and use it in GitHub Desktop.
Save william-smith-skydio/1e4c008043713f0fc470c8d944ab5993 to your computer and use it in GitHub Desktop.
sh_test(
name = "unsandboxed_test",
srcs = ["unsandboxed_test.sh"],
# this test must be run unsandboxed
tags = ["no-sandbox"],
)
def _reproducer_aspect_impl(target, ctx):
output = ctx.actions.declare_file("{}.aspect_out".format(target.label.name))
ctx.actions.run_shell(
# if sandboxing is enabled, we should only see the handful of processes in the sandboxed
# process namespace
command = 'ps > "$1"',
arguments = [output.path],
outputs = [output],
)
return [OutputGroupInfo(aspect_out = depset([output]))]
reproducer_aspect = aspect(
implementation = _reproducer_aspect_impl,
)
# pretend we do something interesting here
# empty workspace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment