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
This commit is contained in:
Cole Faust
2022-03-24 17:27:41 -07:00
parent 4242115d59
commit d9932ad053
5 changed files with 7 additions and 9 deletions

View File

@@ -59,7 +59,7 @@ function soong_build_go
BUILDDIR=$(getoutdir) \ BUILDDIR=$(getoutdir) \
SRCDIR=${TOP} \ SRCDIR=${TOP} \
BLUEPRINTDIR=${TOP}/build/blueprint \ 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 $@ build_go $@
} }

View File

@@ -6,8 +6,8 @@
set -eu set -eu
declare -r output_root="${OUT_DIR:-out}" declare -r output_root="${OUT_DIR:-out}"
declare -r runner="${output_root}/soong/rbcrun" declare -r runner="${output_root}/rbcrun"
declare -r converter="${output_root}/soong/mk2rbc" declare -r converter="${output_root}/mk2rbc"
declare -r launcher="${output_root}/rbc/launcher.rbc" declare -r launcher="${output_root}/rbc/launcher.rbc"
declare -r makefile_list="${output_root}/.module_paths/configuration.list" declare -r makefile_list="${output_root}/.module_paths/configuration.list"
declare -r makefile="$1" declare -r makefile="$1"

View File

@@ -53,6 +53,8 @@ export TOP=$(gettop)
source ${TOP}/build/soong/scripts/microfactory.bash source ${TOP}/build/soong/scripts/microfactory.bash
soong_build_go soong_ui android/soong/cmd/soong_ui 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} cd ${TOP}
exec "$(getoutdir)/soong_ui" "$@" exec "$(getoutdir)/soong_ui" "$@"

View File

@@ -83,12 +83,14 @@ function symlink_directory() {
function create_mock_soong { function create_mock_soong {
copy_directory build/blueprint copy_directory build/blueprint
copy_directory build/soong copy_directory build/soong
copy_directory build/make/tools/rbcrun
symlink_directory prebuilts/go symlink_directory prebuilts/go
symlink_directory prebuilts/build-tools symlink_directory prebuilts/build-tools
symlink_directory prebuilts/clang/host symlink_directory prebuilts/clang/host
symlink_directory external/go-cmp symlink_directory external/go-cmp
symlink_directory external/golang-protobuf symlink_directory external/golang-protobuf
symlink_directory external/starlark-go
touch "$MOCK_TOP/Android.bp" touch "$MOCK_TOP/Android.bp"
} }

View File

@@ -262,12 +262,6 @@ func runMakeProductConfig(ctx Context, config Config) {
"BUILD_BROKEN_USES_BUILD_STATIC_LIBRARY", "BUILD_BROKEN_USES_BUILD_STATIC_LIBRARY",
}, exportEnvVars...), BannerVars...) }, 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, "") makeVars, err := dumpMakeVars(ctx, config, config.Arguments(), allVars, true, "")
if err != nil { if err != nil {
ctx.Fatalln("Error dumping make vars:", err) ctx.Fatalln("Error dumping make vars:", err)