summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Cole Faust <colefaust@google.com> 2022-03-24 17:27:41 -0700
committer Cole Faust <colefaust@google.com> 2022-03-29 14:55:17 -0700
commitd9932ad053beae4a6313f17b6ac6fcc606ec4f8b (patch)
tree5b73330aec9d79ae77081bc19e5696c03848038a
parent4242115d59289791600d42fbc62eade3a1b40519 (diff)
Always build mk2rbc/rbcrun
Currently, mk2rbc/rbcrun aren't built in certain phases of the build, which causes the Starlark product configuration to fail when using get_build_var if a regular build hasn't been run before. Bug: 226677850 Test: Manually Change-Id: If85608eef63be25fddc4d916c82247c13eb0195f
-rw-r--r--scripts/microfactory.bash2
-rwxr-xr-xscripts/rbc-run4
-rwxr-xr-xsoong_ui.bash2
-rw-r--r--tests/lib.sh2
-rw-r--r--ui/build/dumpvars.go6
5 files changed, 7 insertions, 9 deletions
diff --git a/scripts/microfactory.bash b/scripts/microfactory.bash
index 5e702e0bf..192b38f23 100644
--- a/scripts/microfactory.bash
+++ b/scripts/microfactory.bash
@@ -59,7 +59,7 @@ function soong_build_go
BUILDDIR=$(getoutdir) \
SRCDIR=${TOP} \
BLUEPRINTDIR=${TOP}/build/blueprint \
- EXTRA_ARGS="-pkg-path android/soong=${TOP}/build/soong -pkg-path google.golang.org/protobuf=${TOP}/external/golang-protobuf" \
+ EXTRA_ARGS="-pkg-path android/soong=${TOP}/build/soong -pkg-path rbcrun=${TOP}/build/make/tools/rbcrun -pkg-path google.golang.org/protobuf=${TOP}/external/golang-protobuf -pkg-path go.starlark.net=${TOP}/external/starlark-go" \
build_go $@
}
diff --git a/scripts/rbc-run b/scripts/rbc-run
index b8a6c0c73..8d93f0e99 100755
--- a/scripts/rbc-run
+++ b/scripts/rbc-run
@@ -6,8 +6,8 @@
set -eu
declare -r output_root="${OUT_DIR:-out}"
-declare -r runner="${output_root}/soong/rbcrun"
-declare -r converter="${output_root}/soong/mk2rbc"
+declare -r runner="${output_root}/rbcrun"
+declare -r converter="${output_root}/mk2rbc"
declare -r launcher="${output_root}/rbc/launcher.rbc"
declare -r makefile_list="${output_root}/.module_paths/configuration.list"
declare -r makefile="$1"
diff --git a/soong_ui.bash b/soong_ui.bash
index c1c236b9d..49c4b78c4 100755
--- a/soong_ui.bash
+++ b/soong_ui.bash
@@ -53,6 +53,8 @@ export TOP=$(gettop)
source ${TOP}/build/soong/scripts/microfactory.bash
soong_build_go soong_ui android/soong/cmd/soong_ui
+soong_build_go mk2rbc android/soong/mk2rbc/cmd
+soong_build_go rbcrun rbcrun/cmd
cd ${TOP}
exec "$(getoutdir)/soong_ui" "$@"
diff --git a/tests/lib.sh b/tests/lib.sh
index 55f9ab464..1bb2df915 100644
--- a/tests/lib.sh
+++ b/tests/lib.sh
@@ -83,12 +83,14 @@ function symlink_directory() {
function create_mock_soong {
copy_directory build/blueprint
copy_directory build/soong
+ copy_directory build/make/tools/rbcrun
symlink_directory prebuilts/go
symlink_directory prebuilts/build-tools
symlink_directory prebuilts/clang/host
symlink_directory external/go-cmp
symlink_directory external/golang-protobuf
+ symlink_directory external/starlark-go
touch "$MOCK_TOP/Android.bp"
}
diff --git a/ui/build/dumpvars.go b/ui/build/dumpvars.go
index 3f10f75e3..11311f997 100644
--- a/ui/build/dumpvars.go
+++ b/ui/build/dumpvars.go
@@ -262,12 +262,6 @@ func runMakeProductConfig(ctx Context, config Config) {
"BUILD_BROKEN_USES_BUILD_STATIC_LIBRARY",
}, exportEnvVars...), BannerVars...)
- // We need Roboleaf converter and runner in the mixed mode
- runMicrofactory(ctx, config, "mk2rbc", "android/soong/mk2rbc/cmd",
- map[string]string{"android/soong": "build/soong"})
- runMicrofactory(ctx, config, "rbcrun", "rbcrun/cmd",
- map[string]string{"go.starlark.net": "external/starlark-go", "rbcrun": "build/make/tools/rbcrun"})
-
makeVars, err := dumpMakeVars(ctx, config, config.Arguments(), allVars, true, "")
if err != nil {
ctx.Fatalln("Error dumping make vars:", err)