Remove the out/soong/.bootstrap directory.

It's better not to have state hidden in dotfiles (or rather,
dotdirectories) if we can help.

It's questionable whether the "linux-x86" path segment makes sense since
soong_build only ever runs on one operating system, but I didn't want to
rock the boat now.

Drive-by fixed some quoting fixes in rbc-run. Notably, I didn't wrap
`$@` into double quotes because I don't know whether the lack of double
quotes was intended or not.

Also drive-by fixed the fact that "out/soong" was added twice to the
directory name of bpglob. This turned out not to be a problem because
bpglob doesn't need to be explicitly built: if it's needed, it's
declared as an input of the glob files so it'll be built automatically
(at the cost of the first "null build" not actually being a null build)

Test: Presubmits.
Change-Id: I710d8d16cd8212059a0ca1ee95378505303eed83
This commit is contained in:
Lukacs T. Berki
2021-11-02 14:42:04 +01:00
parent 9de51af72c
commit 90b4334a64
7 changed files with 49 additions and 42 deletions

View File

@@ -4,12 +4,26 @@
# that will be passed to rbcrun.
[[ $# -gt 0 && -f "$1" ]] || { echo "Usage: ${0##*/} product.mk [Additional rbcrun arguments]" >&2; exit 1; }
set -eu
declare -r output_root=${OUT_DIR:-out}
declare -r runner="$output_root/soong/.bootstrap/bin/rbcrun"
declare -r converter="$output_root/soong/.bootstrap/bin/mk2rbc"
declare -r launcher=$output_root/launchers/run.rbc
declare -r makefile=$1
shift
$converter -mode=write -r --outdir $output_root --launcher=$launcher $makefile
$runner RBC_OUT="make,global" RBC_DEBUG="${RBC_DEBUG:-}" $@ $launcher
case $(uname -s) in
Linux)
declare -r os="linux-x86";
;;
Darwin)
declare -r os="darwin-x86";
;;
*)
echo "Unknown OS: $(uname -s)" >&2;
exit 1;
;;
esac
declare -r output_root="${OUT_DIR:-out}"
declare -r runner="${output_root}/soong/host/${os}/bin/rbcrun"
declare -r converter="${output_root}/soong/host/${os}/bin/mk2rbc"
declare -r launcher="$output_root/launchers/run.rbc"
declare -r makefile="$1"
shift
"$converter" -mode=write -r --outdir "$output_root" --launcher="$launcher" "$makefile"
"$runner" RBC_OUT="make,global" RBC_DEBUG="${RBC_DEBUG:-}" $@ "$launcher"