Merge "Add initial bp2build converter support for apex_key modules."
diff --git a/android/module.go b/android/module.go
index 84e78d1..5e2e06a 100644
--- a/android/module.go
+++ b/android/module.go
@@ -1529,7 +1529,7 @@
 	var installDeps []*installPathsDepSet
 	var packagingSpecs []*packagingSpecsDepSet
 	ctx.VisitDirectDeps(func(dep Module) {
-		if IsInstallDepNeeded(ctx.OtherModuleDependencyTag(dep)) && !dep.IsHideFromMake() {
+		if IsInstallDepNeeded(ctx.OtherModuleDependencyTag(dep)) && !dep.IsHideFromMake() && !dep.IsSkipInstall() {
 			installDeps = append(installDeps, dep.base().installFilesDepSet)
 			packagingSpecs = append(packagingSpecs, dep.base().packagingSpecsDepSet)
 		}
diff --git a/android/packaging_test.go b/android/packaging_test.go
index f91dc5d..ff7446c 100644
--- a/android/packaging_test.go
+++ b/android/packaging_test.go
@@ -18,13 +18,15 @@
 	"testing"
 
 	"github.com/google/blueprint"
+	"github.com/google/blueprint/proptools"
 )
 
 // Module to be packaged
 type componentTestModule struct {
 	ModuleBase
 	props struct {
-		Deps []string
+		Deps         []string
+		Skip_install *bool
 	}
 }
 
@@ -49,6 +51,9 @@
 	builtFile := PathForModuleOut(ctx, m.Name())
 	dir := ctx.Target().Arch.ArchType.Multilib
 	installDir := PathForModuleInstall(ctx, dir)
+	if proptools.Bool(m.props.Skip_install) {
+		m.SkipInstall()
+	}
 	ctx.InstallFile(installDir, m.Name(), builtFile)
 }
 
@@ -365,3 +370,31 @@
 		}
 		`, []string{"lib64/foo"})
 }
+
+func TestPackagingWithSkipInstallDeps(t *testing.T) {
+	// package -[dep]-> foo -[dep]-> bar      -[dep]-> baz
+	//                  OK           SKIPPED
+	multiTarget := false
+	runPackagingTest(t, multiTarget,
+		`
+		component {
+			name: "foo",
+			deps: ["bar"],
+		}
+
+		component {
+			name: "bar",
+			deps: ["baz"],
+			skip_install: true,
+		}
+
+		component {
+			name: "baz",
+		}
+
+		package_module {
+			name: "package",
+			deps: ["foo"],
+		}
+		`, []string{"lib64/foo"})
+}
diff --git a/rust/config/allowed_list.go b/rust/config/allowed_list.go
index f568f27..ca110a2 100644
--- a/rust/config/allowed_list.go
+++ b/rust/config/allowed_list.go
@@ -28,6 +28,7 @@
 		"system/security",
 		"system/tools/aidl",
 		"tools/security/fuzzing/example_rust_fuzzer",
+		"vendor/",
 	}
 
 	DownstreamRustAllowedPaths = []string{
diff --git a/ui/build/dumpvars.go b/ui/build/dumpvars.go
index f3c442e..3d16073 100644
--- a/ui/build/dumpvars.go
+++ b/ui/build/dumpvars.go
@@ -261,6 +261,12 @@
 		"BUILD_BROKEN_USES_BUILD_STATIC_LIBRARY",
 	}, exportEnvVars...), BannerVars...)
 
+	// We need Roboleaf converter and runner in the mixed mode
+	runMicrofactory(ctx, config, ".bootstrap/bin/mk2rbc", "android/soong/mk2rbc/cmd",
+		map[string]string{"android/soong": "build/soong"})
+	runMicrofactory(ctx, config, ".bootstrap/bin/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)
diff --git a/ui/build/soong.go b/ui/build/soong.go
index a40457f..3fe7b0a 100644
--- a/ui/build/soong.go
+++ b/ui/build/soong.go
@@ -265,20 +265,8 @@
 		}
 	}()
 
-	var cfg microfactory.Config
-	cfg.Map("github.com/google/blueprint", "build/blueprint")
-
-	cfg.TrimPath = absPath(ctx, ".")
-
-	func() {
-		ctx.BeginTrace(metrics.RunSoong, "bpglob")
-		defer ctx.EndTrace()
-
-		bpglob := filepath.Join(config.SoongOutDir(), ".minibootstrap/bpglob")
-		if _, err := microfactory.Build(&cfg, bpglob, "github.com/google/blueprint/bootstrap/bpglob"); err != nil {
-			ctx.Fatalln("Failed to build bpglob:", err)
-		}
-	}()
+	runMicrofactory(ctx, config, ".minibootstrap/bpglob", "github.com/google/blueprint/bootstrap/bpglob",
+		map[string]string{"github.com/google/blueprint": "build/blueprint"})
 
 	ninja := func(name, file string) {
 		ctx.BeginTrace(metrics.RunSoong, name)
@@ -332,6 +320,25 @@
 	}
 }
 
+func runMicrofactory(ctx Context, config Config, relExePath string, pkg string, mapping map[string]string) {
+	name := filepath.Base(relExePath)
+	ctx.BeginTrace(metrics.RunSoong, name)
+	defer ctx.EndTrace()
+	cfg := microfactory.Config{TrimPath: absPath(ctx, ".")}
+	for pkgPrefix, pathPrefix := range mapping {
+		cfg.Map(pkgPrefix, pathPrefix)
+	}
+
+	exePath := filepath.Join(config.SoongOutDir(), relExePath)
+	dir := filepath.Dir(exePath)
+	if err := os.MkdirAll(dir, 0777); err != nil {
+		ctx.Fatalf("cannot create %s: %s", dir, err)
+	}
+	if _, err := microfactory.Build(&cfg, exePath, pkg); err != nil {
+		ctx.Fatalf("failed to build %s: %s", name, err)
+	}
+}
+
 func shouldCollectBuildSoongMetrics(config Config) bool {
 	// Do not collect metrics protobuf if the soong_build binary ran as the
 	// bp2build converter or the JSON graph dump.