Loading core/packaging/flags.mk +16 −10 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ # # TODO: Should we do all of the images in $(IMAGES_TO_BUILD)? _FLAG_PARTITIONS := product system system_ext vendor _FLAG_PARTITIONS := product system vendor # ----------------------------------------------------------------- Loading @@ -28,7 +28,6 @@ _FLAG_PARTITIONS := product system system_ext vendor # $(1): built aconfig flags file (out) # $(2): installed aconfig flags file (out) # $(3): the partition (in) # $(4): input aconfig files for the partition (in) define generate-partition-aconfig-flag-file $(eval $(strip $(1)): PRIVATE_OUT := $(strip $(1))) $(eval $(strip $(1)): PRIVATE_IN := $(strip $(4))) Loading @@ -36,12 +35,14 @@ $(strip $(1)): $(ACONFIG) $(strip $(4)) mkdir -p $$(dir $$(PRIVATE_OUT)) $$(if $$(PRIVATE_IN), \ $$(ACONFIG) dump --dedup --format protobuf --out $$(PRIVATE_OUT) \ --filter container:$$(strip $(3)) $$(addprefix --cache ,$$(PRIVATE_IN)), \ --filter container:$(strip $(3)) \ $$(addprefix --cache ,$$(PRIVATE_IN)), \ echo -n > $$(PRIVATE_OUT) \ ) $(call copy-one-file, $(1), $(2)) endef # Create a summary file of build flags for each partition # $(1): built aconfig flags file (out) # $(2): installed aconfig flags file (out) Loading @@ -59,16 +60,22 @@ $(strip $(1)): $(ACONFIG) $(strip $(3)) $(call copy-one-file, $(1), $(2)) endef $(foreach partition, $(_FLAG_PARTITIONS), \ $(eval aconfig_flag_summaries_protobuf.$(partition) := $(PRODUCT_OUT)/$(partition)/etc/aconfig_flags.pb) \ $(eval $(call generate-partition-aconfig-flag-file, \ $(TARGET_OUT_FLAGS)/$(partition)/aconfig_flags.pb, \ $(aconfig_flag_summaries_protobuf.$(partition)), \ $(partition), \ $(sort $(foreach m,$(call register-names-for-partition, $(partition)), \ $(sort \ $(foreach m, $(call register-names-for-partition, $(partition)), \ $(ALL_MODULES.$(m).ACONFIG_FILES) \ )), \ ) \ $(if $(filter system, $(partition)), \ $(foreach m, $(call register-names-for-partition, system_ext), \ $(ALL_MODULES.$(m).ACONFIG_FILES) \ ) \ ) \ ) \ )) \ ) Loading Loading @@ -175,4 +182,3 @@ $(foreach partition, $(_FLAG_PARTITIONS), \ $(eval aconfig_storage_flag_map.$(partition):=) \ $(eval aconfig_storage_flag_val.$(partition):=) \ ) tools/aconfig/aconfig/src/commands.rs +12 −2 Original line number Diff line number Diff line Loading @@ -79,8 +79,18 @@ pub fn parse_flags( .read_to_string(&mut contents) .with_context(|| format!("failed to read {}", input.source))?; let flag_declarations = aconfig_protos::flag_declarations::try_from_text_proto(&contents) let mut flag_declarations = aconfig_protos::flag_declarations::try_from_text_proto(&contents) .with_context(|| input.error_context())?; // system_ext flags should be treated as system flags as we are combining /system_ext // and /system as one container // TODO: remove this logic when we start enforcing that system_ext cannot be set as // container in aconfig declaration files. if flag_declarations.container() == "system_ext" { flag_declarations.set_container(String::from("system")); } ensure!( package == flag_declarations.package(), "failed to parse {}: expected package {}, got {}", Loading Loading
core/packaging/flags.mk +16 −10 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ # # TODO: Should we do all of the images in $(IMAGES_TO_BUILD)? _FLAG_PARTITIONS := product system system_ext vendor _FLAG_PARTITIONS := product system vendor # ----------------------------------------------------------------- Loading @@ -28,7 +28,6 @@ _FLAG_PARTITIONS := product system system_ext vendor # $(1): built aconfig flags file (out) # $(2): installed aconfig flags file (out) # $(3): the partition (in) # $(4): input aconfig files for the partition (in) define generate-partition-aconfig-flag-file $(eval $(strip $(1)): PRIVATE_OUT := $(strip $(1))) $(eval $(strip $(1)): PRIVATE_IN := $(strip $(4))) Loading @@ -36,12 +35,14 @@ $(strip $(1)): $(ACONFIG) $(strip $(4)) mkdir -p $$(dir $$(PRIVATE_OUT)) $$(if $$(PRIVATE_IN), \ $$(ACONFIG) dump --dedup --format protobuf --out $$(PRIVATE_OUT) \ --filter container:$$(strip $(3)) $$(addprefix --cache ,$$(PRIVATE_IN)), \ --filter container:$(strip $(3)) \ $$(addprefix --cache ,$$(PRIVATE_IN)), \ echo -n > $$(PRIVATE_OUT) \ ) $(call copy-one-file, $(1), $(2)) endef # Create a summary file of build flags for each partition # $(1): built aconfig flags file (out) # $(2): installed aconfig flags file (out) Loading @@ -59,16 +60,22 @@ $(strip $(1)): $(ACONFIG) $(strip $(3)) $(call copy-one-file, $(1), $(2)) endef $(foreach partition, $(_FLAG_PARTITIONS), \ $(eval aconfig_flag_summaries_protobuf.$(partition) := $(PRODUCT_OUT)/$(partition)/etc/aconfig_flags.pb) \ $(eval $(call generate-partition-aconfig-flag-file, \ $(TARGET_OUT_FLAGS)/$(partition)/aconfig_flags.pb, \ $(aconfig_flag_summaries_protobuf.$(partition)), \ $(partition), \ $(sort $(foreach m,$(call register-names-for-partition, $(partition)), \ $(sort \ $(foreach m, $(call register-names-for-partition, $(partition)), \ $(ALL_MODULES.$(m).ACONFIG_FILES) \ )), \ ) \ $(if $(filter system, $(partition)), \ $(foreach m, $(call register-names-for-partition, system_ext), \ $(ALL_MODULES.$(m).ACONFIG_FILES) \ ) \ ) \ ) \ )) \ ) Loading Loading @@ -175,4 +182,3 @@ $(foreach partition, $(_FLAG_PARTITIONS), \ $(eval aconfig_storage_flag_map.$(partition):=) \ $(eval aconfig_storage_flag_val.$(partition):=) \ )
tools/aconfig/aconfig/src/commands.rs +12 −2 Original line number Diff line number Diff line Loading @@ -79,8 +79,18 @@ pub fn parse_flags( .read_to_string(&mut contents) .with_context(|| format!("failed to read {}", input.source))?; let flag_declarations = aconfig_protos::flag_declarations::try_from_text_proto(&contents) let mut flag_declarations = aconfig_protos::flag_declarations::try_from_text_proto(&contents) .with_context(|| input.error_context())?; // system_ext flags should be treated as system flags as we are combining /system_ext // and /system as one container // TODO: remove this logic when we start enforcing that system_ext cannot be set as // container in aconfig declaration files. if flag_declarations.container() == "system_ext" { flag_declarations.set_container(String::from("system")); } ensure!( package == flag_declarations.package(), "failed to parse {}: expected package {}, got {}", Loading