create non-temporal directory fir build deps (#54)

+ small corrections
This commit is contained in:
irengrig 2018-08-22 15:15:53 +02:00 committed by GitHub
parent e711ddb2f0
commit 3983fc9c4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 17 deletions

View File

@ -163,8 +163,9 @@ def cc_external_rule_impl(ctx, attrs):
"source " + shell_utils,
"echo \"Building external library '{}'\"".format(lib_name),
"export TMPDIR=$(mktemp -d)",
"trap \"{ rm -rf $TMPDIR; }\" EXIT",
"export EXT_BUILD_DEPS=$(create_tmp_dir $EXT_BUILD_ROOT)",
"trap \"{ rm -rf $TMPDIR $EXT_BUILD_ROOT/bazel_foreign_cc_deps; }\" EXIT",
"export EXT_BUILD_DEPS=$EXT_BUILD_ROOT/bazel_foreign_cc_deps",
"mkdir -p $EXT_BUILD_DEPS",
"\n".join(_copy_deps_and_tools(inputs)),
"define_absolute_paths $EXT_BUILD_ROOT/bin $EXT_BUILD_ROOT/bin",
"export INSTALLDIR=$EXT_BUILD_ROOT/" + outputs.installdir.path,

View File

@ -13,7 +13,7 @@ def _ninja_tool(ctx):
])
ctx.actions.run_shell(
mnemonic = "BootsrapNinja",
mnemonic = "BootstrapNinja",
inputs = ctx.attr.ninja_srcs.files,
outputs = [ninja],
tools = [],

View File

@ -123,10 +123,3 @@ function define_absolute_paths() {
function replace_absolute_paths() {
replace_in_files $1 $2 $REPLACE_VALUE
}
# create temp directory in specific directory
# $1 directory where to create temp directory
function create_tmp_dir() {
local in_folder=$1
mktemp -d -t ${in_folder}
}

View File

@ -123,10 +123,3 @@ function define_absolute_paths() {
function replace_absolute_paths() {
replace_in_files $1 $2 $REPLACE_VALUE
}
# create temp directory in specific directory
# $1 directory where to create temp directory
function create_tmp_dir() {
local in_folder=$1
mktemp -d --tmpdir=${in_folder}
}