Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix building without sandboxing #769

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions foreign_cc/built_tools/private/built_tools_framework.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ def built_tool_rule_impl(ctx, script_lines, out_dir, mnemonic):
"export EXT_BUILD_ROOT=##pwd##",
"export INSTALLDIR=$$EXT_BUILD_ROOT$$/{}".format(out_dir.path),
"export BUILD_TMPDIR=$$INSTALLDIR$$.build_tmpdir",
"##rm_rf## $$INSTALLDIR$$",
"##rm_rf## $$BUILD_TMPDIR$$",
"##mkdirs## $$INSTALLDIR$$",
"##mkdirs## $$BUILD_TMPDIR$$",
"##copy_dir_contents_to_dir## ./{} $$BUILD_TMPDIR$$".format(root),
"cd $$BUILD_TMPDIR$$",
Expand Down
2 changes: 2 additions & 0 deletions foreign_cc/private/framework.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,8 @@ def cc_external_rule_impl(ctx, attrs):
"##script_prelude##",
] + env_prelude + [
"##path## $$EXT_BUILD_ROOT$$",
"##rm_rf## $$BUILD_TMPDIR$$",
"##rm_rf## $$EXT_BUILD_DEPS$$",
"##mkdirs## $$INSTALLDIR$$",
"##mkdirs## $$BUILD_TMPDIR$$",
"##mkdirs## $$EXT_BUILD_DEPS$$",
Expand Down
4 changes: 4 additions & 0 deletions foreign_cc/private/framework/toolchains/commands.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@ PLATFORM_COMMANDS = {
"Replace the target symlink with resolved file it points to if `file` is a symlink"
),
),
"rm_rf": _command_info(
arguments = [_argument_info(name = "path", data_type = type(""), doc = "Path to directory")],
doc = "Recursively removes the given path",
),
"script_extension": _command_info(
arguments = [],
doc = "Return the extension for the current set of commands (`.sh` for bash, `.ps1` for powershell)",
Expand Down
3 changes: 3 additions & 0 deletions foreign_cc/private/framework/toolchains/linux_commands.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ def disable_tracing():
def mkdirs(path):
return "mkdir -p " + path

def rm_rf(path):
return "rm -rf " + path

def if_else(condition, if_text, else_text):
return """
if [ {condition} ]; then
Expand Down
3 changes: 3 additions & 0 deletions foreign_cc/private/framework/toolchains/macos_commands.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ def disable_tracing():
def mkdirs(path):
return "mkdir -p " + path

def rm_rf(path):
return "rm -rf " + path

def if_else(condition, if_text, else_text):
return """\
if [ {condition} ]; then
Expand Down
3 changes: 3 additions & 0 deletions foreign_cc/private/framework/toolchains/windows_commands.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ def disable_tracing():
def mkdirs(path):
return "mkdir -p " + path

def rm_rf(path):
return "rm -rf " + path
jsharpe marked this conversation as resolved.
Show resolved Hide resolved

def if_else(condition, if_text, else_text):
return """\
if [ {condition} ]; then
Expand Down