Run mkdir before creating BuildManifest.apk
mkdir on the directory of a ninja output is usually not necessary, since
ninja creates the directory of all outputs of a build graph edge before
running the build graph cmd. However, the command of creating the
filesystem runs `rm -rf` on the intermediates filesystem directory,
undoing the mkdir created by ninja.
This is an issue for system_ext specifically. system does not run into
this issue because it includes a dep `fsverity-release-cert-der` which
installs a file in /etc/security/fsverity.
Test: m out/soong/.intermediates/build/soong/fsgen/aosp_cf_x86_64_phone_generated_system_ext_image/android_common/aosp_cf_x86_64_phone_generated_system_ext_image.img
Bug: 383144733
Change-Id: Ia65346e0185b355ec3854427e5df7994160088d3
diff --git a/filesystem/fsverity_metadata.go b/filesystem/fsverity_metadata.go
index ef46067..6372c5e 100644
--- a/filesystem/fsverity_metadata.go
+++ b/filesystem/fsverity_metadata.go
@@ -120,6 +120,7 @@
}
unsignedApkCommand := builder.Command().
+ Textf("mkdir -p %s && ", filepath.Dir(apkPath.String())).
BuiltTool("aapt2").
Text("link").
FlagWithOutput("-o ", apkPath).