Loading scripts/rbc-run +21 −7 Original line number Diff line number Diff line Loading @@ -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 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 "$converter" -mode=write -r --outdir "$output_root" --launcher="$launcher" "$makefile" "$runner" RBC_OUT="make,global" RBC_DEBUG="${RBC_DEBUG:-}" $@ "$launcher" tests/bootstrap_test.sh +12 −12 Original line number Diff line number Diff line Loading @@ -17,10 +17,10 @@ function test_smoke { function test_null_build() { setup run_soong local bootstrap_mtime1=$(stat -c "%y" out/soong/.bootstrap/build.ninja) local bootstrap_mtime1=$(stat -c "%y" out/soong/bootstrap.ninja) local output_mtime1=$(stat -c "%y" out/soong/build.ninja) run_soong local bootstrap_mtime2=$(stat -c "%y" out/soong/.bootstrap/build.ninja) local bootstrap_mtime2=$(stat -c "%y" out/soong/bootstrap.ninja) local output_mtime2=$(stat -c "%y" out/soong/build.ninja) if [[ "$bootstrap_mtime1" == "$bootstrap_mtime2" ]]; then Loading @@ -36,12 +36,12 @@ function test_null_build() { function test_soong_build_rebuilt_if_blueprint_changes() { setup run_soong local mtime1=$(stat -c "%y" out/soong/.bootstrap/build.ninja) local mtime1=$(stat -c "%y" out/soong/bootstrap.ninja) sed -i 's/pluginGenSrcCmd/pluginGenSrcCmd2/g' build/blueprint/bootstrap/bootstrap.go run_soong local mtime2=$(stat -c "%y" out/soong/.bootstrap/build.ninja) local mtime2=$(stat -c "%y" out/soong/bootstrap.ninja) if [[ "$mtime1" == "$mtime2" ]]; then fail "Bootstrap Ninja file did not change" Loading Loading @@ -541,7 +541,7 @@ EOF function test_bp2build_smoke { setup run_soong bp2build [[ -e out/soong/.bootstrap/bp2build_workspace_marker ]] || fail "bp2build marker file not created" [[ -e out/soong/bp2build_workspace_marker ]] || fail "bp2build marker file not created" [[ -e out/soong/workspace ]] || fail "Bazel workspace not created" } Loading @@ -551,7 +551,7 @@ function test_bp2build_generates_marker_file { run_soong bp2build if [[ ! -f "./out/soong/.bootstrap/bp2build_workspace_marker" ]]; then if [[ ! -f "./out/soong/bp2build_workspace_marker" ]]; then fail "Marker file was not generated" fi } Loading Loading @@ -592,10 +592,10 @@ function test_bp2build_null_build { setup run_soong bp2build local mtime1=$(stat -c "%y" out/soong/.bootstrap/bp2build_workspace_marker) local mtime1=$(stat -c "%y" out/soong/bp2build_workspace_marker) run_soong bp2build local mtime2=$(stat -c "%y" out/soong/.bootstrap/bp2build_workspace_marker) local mtime2=$(stat -c "%y" out/soong/bp2build_workspace_marker) if [[ "$mtime1" != "$mtime2" ]]; then fail "Output Ninja file changed on null build" Loading Loading @@ -626,7 +626,7 @@ EOF function test_multiple_soong_build_modes() { setup run_soong json-module-graph bp2build nothing if [[ ! -f "out/soong/.bootstrap/bp2build_workspace_marker" ]]; then if [[ ! -f "out/soong/bp2build_workspace_marker" ]]; then fail "bp2build marker file was not generated" fi Loading Loading @@ -780,11 +780,11 @@ function test_bp2build_back_and_forth_null_build { fail "Output Ninja file changed when switching to bp2build" fi local marker_mtime1=$(stat -c "%y" out/soong/.bootstrap/bp2build_workspace_marker) local marker_mtime1=$(stat -c "%y" out/soong/bp2build_workspace_marker) run_soong local output_mtime3=$(stat -c "%y" out/soong/build.ninja) local marker_mtime2=$(stat -c "%y" out/soong/.bootstrap/bp2build_workspace_marker) local marker_mtime2=$(stat -c "%y" out/soong/bp2build_workspace_marker) if [[ "$output_mtime1" != "$output_mtime3" ]]; then fail "Output Ninja file changed when switching to regular build from bp2build" fi Loading @@ -794,7 +794,7 @@ function test_bp2build_back_and_forth_null_build { run_soong bp2build local output_mtime4=$(stat -c "%y" out/soong/build.ninja) local marker_mtime3=$(stat -c "%y" out/soong/.bootstrap/bp2build_workspace_marker) local marker_mtime3=$(stat -c "%y" out/soong/bp2build_workspace_marker) if [[ "$output_mtime1" != "$output_mtime4" ]]; then fail "Output Ninja file changed when switching back to bp2build" fi Loading tests/bp2build_bazel_test.sh +4 −4 Original line number Diff line number Diff line Loading @@ -11,10 +11,10 @@ readonly GENERATED_BUILD_FILE_NAME="BUILD.bazel" function test_bp2build_null_build() { setup run_soong bp2build local output_mtime1=$(stat -c "%y" out/soong/.bootstrap/bp2build_workspace_marker) local output_mtime1=$(stat -c "%y" out/soong/bp2build_workspace_marker) run_soong bp2build local output_mtime2=$(stat -c "%y" out/soong/.bootstrap/bp2build_workspace_marker) local output_mtime2=$(stat -c "%y" out/soong/bp2build_workspace_marker) if [[ "$output_mtime1" != "$output_mtime2" ]]; then fail "Output bp2build marker file changed on null build" Loading @@ -36,10 +36,10 @@ EOF touch foo/bar/a.txt foo/bar/b.txt run_soong bp2build local output_mtime1=$(stat -c "%y" out/soong/.bootstrap/bp2build_workspace_marker) local output_mtime1=$(stat -c "%y" out/soong/bp2build_workspace_marker) run_soong bp2build local output_mtime2=$(stat -c "%y" out/soong/.bootstrap/bp2build_workspace_marker) local output_mtime2=$(stat -c "%y" out/soong/bp2build_workspace_marker) if [[ "$output_mtime1" != "$output_mtime2" ]]; then fail "Output bp2build marker file changed on null build" Loading ui/build/config.go +3 −2 Original line number Diff line number Diff line Loading @@ -784,12 +784,13 @@ func (c *configImpl) PrebuiltOS() string { panic("Unknown GOOS") } } func (c *configImpl) HostToolDir() string { return filepath.Join(c.SoongOutDir(), "host", c.PrebuiltOS(), "bin") } func (c *configImpl) NamedGlobFile(name string) string { return shared.JoinPath(c.SoongOutDir(), ".bootstrap/build-globs."+name+".ninja") return shared.JoinPath(c.SoongOutDir(), "globs-"+name+".ninja") } func (c *configImpl) UsedEnvFile(tag string) string { Loading @@ -797,7 +798,7 @@ func (c *configImpl) UsedEnvFile(tag string) string { } func (c *configImpl) Bp2BuildMarkerFile() string { return shared.JoinPath(c.SoongOutDir(), ".bootstrap/bp2build_workspace_marker") return shared.JoinPath(c.SoongOutDir(), "bp2build_workspace_marker") } func (c *configImpl) SoongDocsHtml() string { Loading ui/build/dumpvars.go +2 −2 Original line number Diff line number Diff line Loading @@ -263,9 +263,9 @@ func runMakeProductConfig(ctx Context, config Config) { }, exportEnvVars...), BannerVars...) // We need Roboleaf converter and runner in the mixed mode runMicrofactory(ctx, config, ".bootstrap/bin/mk2rbc", "android/soong/mk2rbc/cmd", runMicrofactory(ctx, config, "mk2rbc", "android/soong/mk2rbc/cmd", map[string]string{"android/soong": "build/soong"}) runMicrofactory(ctx, config, ".bootstrap/bin/rbcrun", "rbcrun/cmd", 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, "") Loading Loading
scripts/rbc-run +21 −7 Original line number Diff line number Diff line Loading @@ -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 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 "$converter" -mode=write -r --outdir "$output_root" --launcher="$launcher" "$makefile" "$runner" RBC_OUT="make,global" RBC_DEBUG="${RBC_DEBUG:-}" $@ "$launcher"
tests/bootstrap_test.sh +12 −12 Original line number Diff line number Diff line Loading @@ -17,10 +17,10 @@ function test_smoke { function test_null_build() { setup run_soong local bootstrap_mtime1=$(stat -c "%y" out/soong/.bootstrap/build.ninja) local bootstrap_mtime1=$(stat -c "%y" out/soong/bootstrap.ninja) local output_mtime1=$(stat -c "%y" out/soong/build.ninja) run_soong local bootstrap_mtime2=$(stat -c "%y" out/soong/.bootstrap/build.ninja) local bootstrap_mtime2=$(stat -c "%y" out/soong/bootstrap.ninja) local output_mtime2=$(stat -c "%y" out/soong/build.ninja) if [[ "$bootstrap_mtime1" == "$bootstrap_mtime2" ]]; then Loading @@ -36,12 +36,12 @@ function test_null_build() { function test_soong_build_rebuilt_if_blueprint_changes() { setup run_soong local mtime1=$(stat -c "%y" out/soong/.bootstrap/build.ninja) local mtime1=$(stat -c "%y" out/soong/bootstrap.ninja) sed -i 's/pluginGenSrcCmd/pluginGenSrcCmd2/g' build/blueprint/bootstrap/bootstrap.go run_soong local mtime2=$(stat -c "%y" out/soong/.bootstrap/build.ninja) local mtime2=$(stat -c "%y" out/soong/bootstrap.ninja) if [[ "$mtime1" == "$mtime2" ]]; then fail "Bootstrap Ninja file did not change" Loading Loading @@ -541,7 +541,7 @@ EOF function test_bp2build_smoke { setup run_soong bp2build [[ -e out/soong/.bootstrap/bp2build_workspace_marker ]] || fail "bp2build marker file not created" [[ -e out/soong/bp2build_workspace_marker ]] || fail "bp2build marker file not created" [[ -e out/soong/workspace ]] || fail "Bazel workspace not created" } Loading @@ -551,7 +551,7 @@ function test_bp2build_generates_marker_file { run_soong bp2build if [[ ! -f "./out/soong/.bootstrap/bp2build_workspace_marker" ]]; then if [[ ! -f "./out/soong/bp2build_workspace_marker" ]]; then fail "Marker file was not generated" fi } Loading Loading @@ -592,10 +592,10 @@ function test_bp2build_null_build { setup run_soong bp2build local mtime1=$(stat -c "%y" out/soong/.bootstrap/bp2build_workspace_marker) local mtime1=$(stat -c "%y" out/soong/bp2build_workspace_marker) run_soong bp2build local mtime2=$(stat -c "%y" out/soong/.bootstrap/bp2build_workspace_marker) local mtime2=$(stat -c "%y" out/soong/bp2build_workspace_marker) if [[ "$mtime1" != "$mtime2" ]]; then fail "Output Ninja file changed on null build" Loading Loading @@ -626,7 +626,7 @@ EOF function test_multiple_soong_build_modes() { setup run_soong json-module-graph bp2build nothing if [[ ! -f "out/soong/.bootstrap/bp2build_workspace_marker" ]]; then if [[ ! -f "out/soong/bp2build_workspace_marker" ]]; then fail "bp2build marker file was not generated" fi Loading Loading @@ -780,11 +780,11 @@ function test_bp2build_back_and_forth_null_build { fail "Output Ninja file changed when switching to bp2build" fi local marker_mtime1=$(stat -c "%y" out/soong/.bootstrap/bp2build_workspace_marker) local marker_mtime1=$(stat -c "%y" out/soong/bp2build_workspace_marker) run_soong local output_mtime3=$(stat -c "%y" out/soong/build.ninja) local marker_mtime2=$(stat -c "%y" out/soong/.bootstrap/bp2build_workspace_marker) local marker_mtime2=$(stat -c "%y" out/soong/bp2build_workspace_marker) if [[ "$output_mtime1" != "$output_mtime3" ]]; then fail "Output Ninja file changed when switching to regular build from bp2build" fi Loading @@ -794,7 +794,7 @@ function test_bp2build_back_and_forth_null_build { run_soong bp2build local output_mtime4=$(stat -c "%y" out/soong/build.ninja) local marker_mtime3=$(stat -c "%y" out/soong/.bootstrap/bp2build_workspace_marker) local marker_mtime3=$(stat -c "%y" out/soong/bp2build_workspace_marker) if [[ "$output_mtime1" != "$output_mtime4" ]]; then fail "Output Ninja file changed when switching back to bp2build" fi Loading
tests/bp2build_bazel_test.sh +4 −4 Original line number Diff line number Diff line Loading @@ -11,10 +11,10 @@ readonly GENERATED_BUILD_FILE_NAME="BUILD.bazel" function test_bp2build_null_build() { setup run_soong bp2build local output_mtime1=$(stat -c "%y" out/soong/.bootstrap/bp2build_workspace_marker) local output_mtime1=$(stat -c "%y" out/soong/bp2build_workspace_marker) run_soong bp2build local output_mtime2=$(stat -c "%y" out/soong/.bootstrap/bp2build_workspace_marker) local output_mtime2=$(stat -c "%y" out/soong/bp2build_workspace_marker) if [[ "$output_mtime1" != "$output_mtime2" ]]; then fail "Output bp2build marker file changed on null build" Loading @@ -36,10 +36,10 @@ EOF touch foo/bar/a.txt foo/bar/b.txt run_soong bp2build local output_mtime1=$(stat -c "%y" out/soong/.bootstrap/bp2build_workspace_marker) local output_mtime1=$(stat -c "%y" out/soong/bp2build_workspace_marker) run_soong bp2build local output_mtime2=$(stat -c "%y" out/soong/.bootstrap/bp2build_workspace_marker) local output_mtime2=$(stat -c "%y" out/soong/bp2build_workspace_marker) if [[ "$output_mtime1" != "$output_mtime2" ]]; then fail "Output bp2build marker file changed on null build" Loading
ui/build/config.go +3 −2 Original line number Diff line number Diff line Loading @@ -784,12 +784,13 @@ func (c *configImpl) PrebuiltOS() string { panic("Unknown GOOS") } } func (c *configImpl) HostToolDir() string { return filepath.Join(c.SoongOutDir(), "host", c.PrebuiltOS(), "bin") } func (c *configImpl) NamedGlobFile(name string) string { return shared.JoinPath(c.SoongOutDir(), ".bootstrap/build-globs."+name+".ninja") return shared.JoinPath(c.SoongOutDir(), "globs-"+name+".ninja") } func (c *configImpl) UsedEnvFile(tag string) string { Loading @@ -797,7 +798,7 @@ func (c *configImpl) UsedEnvFile(tag string) string { } func (c *configImpl) Bp2BuildMarkerFile() string { return shared.JoinPath(c.SoongOutDir(), ".bootstrap/bp2build_workspace_marker") return shared.JoinPath(c.SoongOutDir(), "bp2build_workspace_marker") } func (c *configImpl) SoongDocsHtml() string { Loading
ui/build/dumpvars.go +2 −2 Original line number Diff line number Diff line Loading @@ -263,9 +263,9 @@ func runMakeProductConfig(ctx Context, config Config) { }, exportEnvVars...), BannerVars...) // We need Roboleaf converter and runner in the mixed mode runMicrofactory(ctx, config, ".bootstrap/bin/mk2rbc", "android/soong/mk2rbc/cmd", runMicrofactory(ctx, config, "mk2rbc", "android/soong/mk2rbc/cmd", map[string]string{"android/soong": "build/soong"}) runMicrofactory(ctx, config, ".bootstrap/bin/rbcrun", "rbcrun/cmd", 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, "") Loading