Commit graph

820 commits

Author SHA1 Message Date
Treehugger Robot
db664386ec Merge "release_config: Do not force ranking in inheritance graph" into main 2024-06-07 01:07:53 +00:00
Treehugger Robot
211fdd6618 Merge "Drop IncludeTags" into main 2024-06-06 22:12:38 +00:00
LaMont Jones
4bb19b2414 release_config: Do not force ranking in inheritance graph
Let graphvis decide how to best display the release config graph.
Also add some color to the graph.

Bug: None
Test: manual
Change-Id: If8b9eb41eb78bd553fd5543938a2c1c098b41591
2024-06-06 12:22:26 -07:00
LaMont Jones
b4f866c73c Allow product-specific release configs.
Bug: 343794062
Test: manual
Change-Id: Ifdfab5978221f1396681a2c851bad7be502b6ea7
2024-06-04 14:27:07 -07:00
Yu Liu
fba4e70227 Merge "Upload build.trace.gz for user builds." into main 2024-06-04 17:24:50 +00:00
Joe Onorato
5219ed0b4b Merge changes from topic "list_releases" into main
* changes:
  Add list_releases command
  Add standalone list_products and list_variants commands.
2024-05-31 20:22:06 +00:00
Treehugger Robot
9b8cfd5144 Merge "Add prior_stages: to release config" into main 2024-05-31 16:40:49 +00:00
LaMont Jones
756bd68cde Limit release config inheritance from aliases
If the release config has a name matching build prefixes, it may not
inherit from an alias.

Bug: 340208722
Bug: 328495189
Test: manual
Change-Id: Idb7b1fa372db980c5732b700663553b7a9bf4a36
2024-05-30 20:23:01 -07:00
LaMont Jones
5195b82f42 Add prior_stages: to release config
Include those paths in the inheritance graph.

Bug: 348495189
Test: manual
Merged-In: I993af3a34ab7dd9a3346c6ffccb17e7abff23545
Change-Id: I993af3a34ab7dd9a3346c6ffccb17e7abff23545
2024-05-30 20:22:49 -07:00
Treehugger Robot
55ee3fcef6 Merge "Create inheritance graph" into main 2024-05-31 00:38:07 +00:00
LaMont Jones
ed22f82c01 Create inheritance graph
release-config now creates `inhertance_graph-${TARGET_PRODUCT}.dot`
showing the inheritance graph for all release configs present for
${TARGET_PRODUCT}.

Bug: 328495189
Test: manual, TH
Change-Id: I79242eaa848e0374b33f376e44d8938e9d398e21
2024-05-30 16:11:58 -07:00
Joe Onorato
53f3057037 Add list_releases command
Bug: 340648588
Test: list_releases
Change-Id: Ibce4704c64620b74c24952f16c2be902d8483f02
2024-05-30 15:52:09 -07:00
LaMont Jones
5a48f0d7f2 Better default value for RELEASE_PLATFORM_VERSION
If the release config name is a build prefix and different from the
inherited value, set RELEASE_PLATFORM_VERSION based on the release
config name.

Bug: 348495189
Test: manual
Change-Id: I95d715150cba9b57e343a8b8364d36f38dcc18a3
2024-05-30 14:43:48 -07:00
Treehugger Robot
89341ed9ad Merge "Build build_flags.json in soong" into main 2024-05-29 00:18:16 +00:00
LaMont Jones
194d492d55 all_flags.pb: Properly handle intermediate files
Bug: 343203557
Test: manual, TH
Change-Id: I9a4ef39b0c2a641ccd996187ce5f7629520dffc0
2024-05-28 13:24:19 -07:00
Justin Yun
5f53869dfe Build build_flags.json in soong
Define release_flags_json module type to install build_flags.json in
'etc'. release_flags_json reads the json files generated from the
soong release-config command.

Bug: 324996303
Test: build and see if the files are installed
Change-Id: I8cdcb7c61dd75cc54e4912d2ed7d1687f424151c
2024-05-23 14:58:08 +09:00
LaMont Jones
aae7c4a302 Merge "Generate specific message for build flag declarations artifact" into main 2024-05-22 22:07:20 +00:00
LaMont Jones
6d9ff256ed Generate specific message for build flag declarations artifact
Many of the fields in `flag_artifact` are not valid in
the all_build_flag_definitions artifact.

Bug: 328495189
Test: manual
Change-Id: I00eab1ef76f67f7db2118a6fc0d5771e3dd39fbb
2024-05-22 13:46:34 -07:00
Spandan Das
aa9369b71d Drop IncludeTags
This was previously used in conjunction with blueprint_package_includes
to prune Android.bp files from soong analysis.

Test: m nothing
Bug: 308188212
Change-Id: Ie82e20eec63bd0be70e1cf0290c70f62d5621c76
2024-05-22 19:23:47 +00:00
Cole Faust
a642853510 Merge "Log warnings to stdout instead of stderr" into main 2024-05-22 16:58:35 +00:00
LaMont Jones
44789260ad release_config_proto: revert enum rename
This caused the existing textproto files to be misparsed.

Bug: 328495189
Test: manual
Change-Id: I53dc5045839b575e5fcaace39a435c28648010f6
2024-05-22 06:42:59 -07:00
Treehugger Robot
d7b71490ae Merge "Export release flag types to make/soong" into main 2024-05-22 02:26:00 +00:00
Treehugger Robot
423b8f6869 Merge "Better errors from build-flag" into main 2024-05-22 01:53:20 +00:00
Cole Faust
3b30067f88 Log warnings to stdout instead of stderr
Currently, both stdout and stderr are redirected to a file. We want
stderr to be visible on the terminal in case the release config
fails, but we don't want to see the spam of warnings release config
always produces.

Move the warnings to stdout so they stay in the file when we start
showing stderr.

Test: m nothing
Change-Id: Ic869675f917270a472142b6e3a4210acaad7499b
2024-05-21 18:17:47 -07:00
Cole Faust
751a4a5fa2 Export release flag types to make/soong
And use the types to appropriately type selects on the release
variables.

Bug: 323382414
Test: Presubmits
Change-Id: Ide7eca95662caaa7b4be42e20399d9fcd7fed35f
2024-05-21 18:09:05 -07:00
LaMont Jones
310ccc2ad2 Better errors from build-flag
When `get_build_var` fails, output the error.

Bug: none
Test: manual
Change-Id: If4dc13e0e895823f50de1f5c7e929bb05eac69a0
2024-05-21 17:52:48 -07:00
LaMont Jones
52df388f5a Minor flagging cleanup
Add an underscore to make the linter more happy.

Bug: 339672075
Bug: 328495189
Test: manual
Change-Id: I6b1d6dcd0aff3c82551021b3f4768a34f27d6fb2
2024-05-21 15:35:28 -07:00
LaMont Jones
fa4ba22a41 Add build-flag-declarations tool
This will be used to gather build flag declarations

Bug: 328495189
Test: manual, TH
Change-Id: I155c26b1442347c4d433c9cbf22b94d944636702
2024-05-21 15:34:11 -07:00
LaMont Jones
e3de5ac6d0 Add Factory methods, WriteFormattedMessage
Adds:
 - FlagArtifactFactory()
 - FlagArtifactsFactory()
 - WriteFormattedMessage()

Bug: 328495189
Test: manual
Change-Id: I8b3c1e1e7ea3e52e9e7e8b1f8162fedd3e83dd33
2024-05-20 13:43:20 -07:00
Yu Liu
f2615e923e Upload build.trace.gz for user builds.
Bug: 340206057
Test: Manually verified build.trace.gz was uploaded to build server.
Change-Id: I9c071188343baf7c11c30a5c4c1d1ca7bcaac06b
2024-05-16 23:15:49 +00:00
LaMont Jones
2efc8e2e82 rename workflow enum for lint
Bug: 339672075
Test: manual
Change-Id: I55f7fff9f1f367e13566fc23fb5379f6732a8e8d
2024-05-16 16:08:56 -07:00
LaMont Jones
693c703ab3 export list of files used by the release config
Also use a different name for the output.

Bug: 341117082
Bug: 328495189
Bug: 339707888
Test: manual, TH
Change-Id: Ib98d487f57cf8b55dff61a7969139a6e199fee90
2024-05-16 15:47:01 -07:00
LaMont Jones
ce599ef878 sort release configs when creating artifacts
Bug: 328495189
Test: manual
Change-Id: I0b579c6fdbee5bb09826854dadb9f89955980ca8
2024-05-15 15:48:35 -07:00
Treehugger Robot
0bcdc1f417 Merge "Don't panic when a map is included twice" into main 2024-05-15 00:20:01 +00:00
Treehugger Robot
ef71f7ad8c Merge "clean up RELEASE_ACONFIG_VALUE_SETS" into main 2024-05-14 23:54:01 +00:00
LaMont Jones
05d59c5905 Don't panic when a map is included twice
If a map was included twice, we had side effects when skipping the extra
inclusion.

Bug: 340659219
Test: manual, TH
Change-Id: I90c55a800ecad932f8f67cf6f9f60dba571f7c48
2024-05-14 15:59:45 -07:00
LaMont Jones
8e2a6b1fe9 clean up RELEASE_ACONFIG_VALUE_SETS
Only add a repository to the trace when it actually specifies
aconfig_value_sets.

Also default to only generating the release config .mk file for the
current TARGET_RELEASE (rather than all), to reduce kati reruns.

Bug: 340126861
Test: manual, TH
Change-Id: I671d4b5f57c9bdd252d98e048f16aa9c7b3b2ffa
2024-05-14 09:21:10 -07:00
Cole Faust
6bb2832c15 Fix a check for the ninja_log
soong_build uses / as it's cwd, so we need to specify the top directory
when checkign for files.

Test: add a printf in the if statement; touch out/soong/Android.bp && m nothing; ensure printf doesn't fire
Change-Id: Iba9773765547b22a03dbca33aa6b8c75359cb5ff
2024-05-13 11:57:16 -07:00
LaMont Jones
80ef5ce7bc sort _all_release_configs variable before we write it
Bug: 339707888
Test: manual, TH
Change-Id: Icbf9a8f84a62b60469ed636f69818c9179d2ddf6
2024-05-09 15:33:13 -07:00
LaMont Jones
6f3ca9eea1 crunch_flags: handle non-string ACONFIG_VALUE_SETS
If the default value for RELEASE_ACONFIG_VALUE_SETS is not a string,
the resulting value is the empty string.

Bug: 328495189
Test: manual
Change-Id: Ie8f262d6408b1564ec7a3918f8654ccfa9bc5940
2024-05-08 17:26:47 -07:00
LaMont Jones
992011ea77 Always write makefile for ${TARGET_RELEASE}
When writing all makefiles, we also need to write the makefile for
${TARGET_RELEASE}.  We can skip writing it a second time if it is not
an alias.

Bug: 328495189
Test: manual, TH
Change-Id: Ia5d1955f419312c76eb9c8a33b1c8a6bcc5efe0b
2024-05-08 09:16:44 -07:00
LaMont Jones
d6406171ae build_flag: improve default flag value directory
The default directory for flag values is the last of:
 - Where the flag is declared,
 - Where the release config is first declared,
 - Where the flag value is currently being set for this release config.

Bug: 328495189
Test: manual
Change-Id: Ida1f906b75704f658e7fa1de703e0c789dce06a6
2024-05-07 13:59:28 -07:00
LaMont Jones
897ab4e087 release-config: use ${TARGET_RELEASE} for output
When the passed release name is an alias, write
release_config-PRODUCT-RELEASE.mk using the alias, since that is where
core/release_config.mk is going to look for it.

Bug: 328495189
Test: manual
Change-Id: I4e6909f43bf136974323754e06fa538e39e0faab
2024-05-02 15:19:18 -07:00
LaMont Jones
6ff1ed4a92 RELEASE_ACONFIG_VALUE_SETS is a reserved flag
Disallow setting the flag via protobuf files, and adjust it internally
to be more like any other build flag.  This makes the generated output
more consistent.

Also default to TARGET_RELEASE if no release is given to `build-flag`.

Bug: 328495189
Test: manual
Change-Id: I9db57137fc4e5ed42a38adc939c430826afe4f63
2024-05-01 12:14:41 -07:00
LaMont Jones
15902f2f4c Guard with RELEASE_BUILD_FLAGS_IN_PROTOBUF
If false, then we output an empty file, which will cause
release_config.mk to do the old process.

Bug: 328495189
Test: manual
Change-Id: I4aa82301f3bbb29633a275a801431a6667feb48d
2024-05-01 12:14:41 -07:00
LaMont Jones
ff387eaacb release_config: various cleanup
- Allow scl and textproto data to coexist for now
- Print warnings to stderr instead of stdout.
- Improve formatting of output
- Set displays the new value for all configs, and what file changed.
- Use prettier error messages for better UX
- put build-flag on the path.

Bug: 328495189
Test: manual
Change-Id: I4c38860c2fb24db5111e0cecf790660a4ff2b8b2
2024-04-30 16:12:50 -07:00
LaMont Jones
dc86819307 Support release configs with only aconfig flags
Release configs with `aconfig_flags_only: true` can inherit build flag
values, but cannot set them.

Bug: 328495189
Test: manual
Change-Id: I2bdc88761d61fb20f10dc734f2ba87114f51b859
2024-04-30 15:38:11 -07:00
LaMont Jones
e41ea1e33e release_config: better default map paths
- Automatically determine the top of the workspace.
- build-flag defaults to using `get_build_var` to get product specific
  release config maps.
- release-config defaults to using PRODUCT_RELEASE_CONFIG_MAPS but does
  not use `get_build_var` unless the argument is given.

Bug: 328495189
Test: manual
Change-Id: I4ba3c5dfab43c4ebc3eeda13318f42e886dada4e
2024-04-29 14:43:09 -07:00
LaMont Jones
db600990a5 release_config: container is a repeated string field
Container is a string, and a flag can be in more than one container.

Bug: 328495189
Test: manual
Change-Id: I5a2a9855532027584d2b67f63f1b9584fce3d8d9
2024-04-26 14:56:58 -07:00
LaMont Jones
f4cc08e114 Write per-partition build_flags.json
Create build_flags_{partition}-{TARGET_PRODUCT}-{TARGET_RELEASE}.json
in {OUT_DIR}/soong/release-config.

Bug: 328495189
Test: manual
Change-Id: I708c37f9b1216b4283886c98cacaf66bfcd28143
2024-04-26 09:24:47 -07:00