Loading Changes.md +57 −0 Original line number Diff line number Diff line # Build System Changes for Android.mk Writers ## Gensrcs starts disallowing depfile property To migrate all gensrcs to Bazel, we are restricting the use of depfile property because Bazel requires specifying the dependencies directly. To fix existing uses, remove depfile and directly specify all the dependencies in .bp files. For example: ``` gensrcs { name: "framework-cppstream-protos", tools: [ "aprotoc", "protoc-gen-cppstream", ], cmd: "mkdir -p $(genDir)/$(in) " + "&& $(location aprotoc) " + " --plugin=$(location protoc-gen-cppstream) " + " -I . " + " $(in) ", srcs: [ "bar.proto", ], output_extension: "srcjar", } ``` where `bar.proto` imports `external.proto` would become ``` gensrcs { name: "framework-cppstream-protos", tools: [ "aprotoc", "protoc-gen-cpptream", ], tool_files: [ "external.proto", ], cmd: "mkdir -p $(genDir)/$(in) " + "&& $(location aprotoc) " + " --plugin=$(location protoc-gen-cppstream) " + " $(in) ", srcs: [ "bar.proto", ], output_extension: "srcjar", } ``` as in https://android-review.googlesource.com/c/platform/frameworks/base/+/2125692/. `BUILD_BROKEN_DEPFILE` can be used to allowlist usage of depfile in `gensrcs`. If `depfile` is needed for generating javastream proto, `java_library` with `proto.type` set `stream` is the alternative solution. Sees https://android-review.googlesource.com/c/platform/packages/modules/Permission/+/2118004/ for an example. ## Genrule starts disallowing directory inputs To better specify the inputs to the build, we are restricting use of directories Loading core/board_config.mk +1 −0 Original line number Diff line number Diff line Loading @@ -174,6 +174,7 @@ _board_strip_list += ODM_MANIFEST_SKUS _build_broken_var_list := \ BUILD_BROKEN_DEPFILE \ BUILD_BROKEN_DUP_RULES \ BUILD_BROKEN_DUP_SYSPROP \ BUILD_BROKEN_ELF_PREBUILT_PRODUCT_COPY_FILES \ Loading core/soong_config.mk +1 −0 Original line number Diff line number Diff line Loading @@ -274,6 +274,7 @@ $(call add_json_str, PrebuiltHiddenApiDir, $(BOARD_PREBUILT_HIDDENAPI_DIR)) $(call add_json_str, ShippingApiLevel, $(PRODUCT_SHIPPING_API_LEVEL)) $(call add_json_bool, BuildBrokenDepfile, $(filter true,$(BUILD_BROKEN_DEPFILE))) $(call add_json_bool, BuildBrokenEnforceSyspropOwner, $(filter true,$(BUILD_BROKEN_ENFORCE_SYSPROP_OWNER))) $(call add_json_bool, BuildBrokenTrebleSyspropNeverallow, $(filter true,$(BUILD_BROKEN_TREBLE_SYSPROP_NEVERALLOW))) $(call add_json_bool, BuildBrokenVendorPropertyNamespace, $(filter true,$(BUILD_BROKEN_VENDOR_PROPERTY_NAMESPACE))) Loading Loading
Changes.md +57 −0 Original line number Diff line number Diff line # Build System Changes for Android.mk Writers ## Gensrcs starts disallowing depfile property To migrate all gensrcs to Bazel, we are restricting the use of depfile property because Bazel requires specifying the dependencies directly. To fix existing uses, remove depfile and directly specify all the dependencies in .bp files. For example: ``` gensrcs { name: "framework-cppstream-protos", tools: [ "aprotoc", "protoc-gen-cppstream", ], cmd: "mkdir -p $(genDir)/$(in) " + "&& $(location aprotoc) " + " --plugin=$(location protoc-gen-cppstream) " + " -I . " + " $(in) ", srcs: [ "bar.proto", ], output_extension: "srcjar", } ``` where `bar.proto` imports `external.proto` would become ``` gensrcs { name: "framework-cppstream-protos", tools: [ "aprotoc", "protoc-gen-cpptream", ], tool_files: [ "external.proto", ], cmd: "mkdir -p $(genDir)/$(in) " + "&& $(location aprotoc) " + " --plugin=$(location protoc-gen-cppstream) " + " $(in) ", srcs: [ "bar.proto", ], output_extension: "srcjar", } ``` as in https://android-review.googlesource.com/c/platform/frameworks/base/+/2125692/. `BUILD_BROKEN_DEPFILE` can be used to allowlist usage of depfile in `gensrcs`. If `depfile` is needed for generating javastream proto, `java_library` with `proto.type` set `stream` is the alternative solution. Sees https://android-review.googlesource.com/c/platform/packages/modules/Permission/+/2118004/ for an example. ## Genrule starts disallowing directory inputs To better specify the inputs to the build, we are restricting use of directories Loading
core/board_config.mk +1 −0 Original line number Diff line number Diff line Loading @@ -174,6 +174,7 @@ _board_strip_list += ODM_MANIFEST_SKUS _build_broken_var_list := \ BUILD_BROKEN_DEPFILE \ BUILD_BROKEN_DUP_RULES \ BUILD_BROKEN_DUP_SYSPROP \ BUILD_BROKEN_ELF_PREBUILT_PRODUCT_COPY_FILES \ Loading
core/soong_config.mk +1 −0 Original line number Diff line number Diff line Loading @@ -274,6 +274,7 @@ $(call add_json_str, PrebuiltHiddenApiDir, $(BOARD_PREBUILT_HIDDENAPI_DIR)) $(call add_json_str, ShippingApiLevel, $(PRODUCT_SHIPPING_API_LEVEL)) $(call add_json_bool, BuildBrokenDepfile, $(filter true,$(BUILD_BROKEN_DEPFILE))) $(call add_json_bool, BuildBrokenEnforceSyspropOwner, $(filter true,$(BUILD_BROKEN_ENFORCE_SYSPROP_OWNER))) $(call add_json_bool, BuildBrokenTrebleSyspropNeverallow, $(filter true,$(BUILD_BROKEN_TREBLE_SYSPROP_NEVERALLOW))) $(call add_json_bool, BuildBrokenVendorPropertyNamespace, $(filter true,$(BUILD_BROKEN_VENDOR_PROPERTY_NAMESPACE))) Loading