Commit graph

51 commits

Author SHA1 Message Date
LaMont Jones
c25b45164b Merge "Allow product-specific release configs." into main am: 6a39bb136e am: 358a84d714
Original change: https://android-review.googlesource.com/c/platform/build/+/3114502

Change-Id: I41bf51b17d2d9793b03cbd53e80f37c7be8db17c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-06-05 00:38:28 +00:00
LaMont Jones
358a84d714 Merge "Allow product-specific release configs." into main am: 6a39bb136e
Original change: https://android-review.googlesource.com/c/platform/build/+/3114502

Change-Id: I2bdfb6363ca1c7b60035fd2aa1dde7f5906918b9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-06-05 00:22:52 +00:00
LaMont Jones
0ca61ddb25 Allow product-specific release configs.
Bug: 343794062
Test: manual
Change-Id: Ieb47ce685c7f29c0e8afe8897f86ffebb6318396
2024-06-04 14:26:49 -07:00
LaMont Jones
391609c3bf Merge "Require protobuf for build flags" into main 2024-06-04 21:18:21 +00:00
Treehugger Robot
bd9e028af3 Merge "DO NOT MERGE ANYWHERE Revert "Require protobuf for build flags"" into main 2024-06-04 19:05:05 +00:00
LaMont Jones
2ef7438ff5 Require protobuf for build flags
This change forces build flags from .scl to .textproto format.

This change resubmits commit 8663122eac
such that it will merge downstream.

Bug: 328495189
Bug: 338450506
Test: manual, TH
Ignore-AOSP-First: DNMA in aosp-main to avoid aosp-main-future
Change-Id: I024f620b55e5e655f2b7b4764b217744334f7995
2024-06-04 11:45:53 -07:00
LaMont Jones
d0b3b82d20 DO NOT MERGE ANYWHERE Revert "Require protobuf for build flags"
This reverts commit 8663122eac.

Reason for revert: Was DNMA aosp/main with same ChangeId.  Will resubmit with new one, so that it actually merges.

Change-Id: Ifa1b3b3901b88882f5ea790b0cc582bd828a8619
2024-06-03 22:05:14 +00:00
LaMont Jones
c58de8fbb3 Merge "Require protobuf for build flags" into main 2024-06-03 20:37:27 +00:00
Joe Onorato
884f91d424 Merge "Rename _all_release_configs so it's more accessible for list_releases command" into main am: 4c825353f9
Original change: https://android-review.googlesource.com/c/platform/build/+/3109688

Change-Id: I6d908f2ae66c5f40b2801896edc544fdacab9f98
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-31 20:27:00 +00:00
Joe Onorato
4c825353f9 Merge "Rename _all_release_configs so it's more accessible for list_releases command" into main 2024-05-31 20:22:06 +00:00
LaMont Jones
8663122eac Require protobuf for build flags
This change forces build flags from .scl to .textproto format.

Bug: 328495189
Bug: 338450506
Test: manual, TH
Ignore-AOSP-First: DNMA in aosp-main to avoid aosp-main-future
Merged-In: Ia33aae158d62c12666d97449cea0c02b60550a21
Change-Id: Ia33aae158d62c12666d97449cea0c02b60550a21
2024-05-31 11:24:50 -07:00
LaMont Jones
ec11bca5c3 Merge "DO NOT MERGE ANYWHERE Require protobuf for build flags" into main 2024-05-31 16:10:37 +00:00
Joe Onorato
5f14162375 Rename _all_release_configs so it's more accessible for list_releases
command

Bug: 340648588
Test: list_releases
Change-Id: Id5397a0e06585897866b7497837e1a106ab0c28e
2024-05-30 15:48:07 -07:00
LaMont Jones
b324a11a6a DO NOT MERGE ANYWHERE Require protobuf for build flags
This change forces build flags from .scl to .textproto format.

Bug: 328495189
Bug: 338450506
Test: manual, TH
Change-Id: Ia33aae158d62c12666d97449cea0c02b60550a21
2024-05-30 13:49:10 -07:00
LaMont Jones
52f63ed170 Deliver inheritance_graph-$(TARGET_PRODUCT).dot
Bug: 328495189
Test: manual, TH
Change-Id: I9cf6a7e2eed173add02bfb8ccb10a3bf31e7812c
2024-05-29 14:59:28 -07:00
LaMont Jones
3b9a93512e Deliver all_release_configs.json as a build artifact
Bug: 328495189
Test: manual
Change-Id: Iebb07c303e6eae51d6c74dd80aa5ac2024b5629e
2024-05-24 13:12:14 -07:00
Cole Faust
50dc47d13a Show release-config's 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.

Test: m nothing
Change-Id: I1337718fe8f9394be3017cc8b6d76f8dc1a94ef0
2024-05-21 18:16:21 -07:00
LaMont Jones
052282b731 Mark files used in release configs as kati dependencies
Bug: 341117082
Bug: 328495189
Bug: 339707888
Test: manual, TH
Change-Id: I4377846844ad172a2760de309ee343b980e893f1
2024-05-16 15:21:29 -07:00
LaMont Jones
dd2f3ec91f Revert "Avoid re-running kati unnecessarily."
This reverts commit 3f0eba2bdc.

Reason for revert: Causes build flag changes to be ignored sometimes.  Better fix is in progress.

Merged-In: Ic85be1da3765656cef8da4ec03d0b1ca7d5d625e
Change-Id: I2c06770b2ff86c69a5de89962ab9bf48bedfe6fe
2024-05-16 18:24:41 +00:00
LaMont Jones
3f0eba2bdc Avoid re-running kati unnecessarily.
Bug: 339707888
Test: manual
Change-Id: I0447a127aee7e5ef34d7ae81a3b8bead7c7bc95b
2024-05-09 15:33:01 -07:00
LaMont Jones
20dd4c2360 Enable build flags in protobuf
If RELEASE_BUILD_FLAGS_IN_PROTOBUF is False, then the results from
out/release-config are ignored and we do the old processing.

The following additional logic all goes away once the migration to protobuf
is finished.

- If we found .textproto files that don't have corresponding .mk files,
  we require protobuf.
- If we found .mk files that don't have corresponding .textproto files,
  we require legacy (make) processing.
- If PRODUCT_RELEASE_CONFIG_MAPS specifies .textproto files, we require
  protobuf.

In order to further isolate migration, the choice can be determined on a
release-config by release-config basis.  in each release config
directory, we look for:
 - `build_config/DEFAULT=proto`
 - `build_config/DEFAULT=make`
 - `build_config/${TARGET_RELEASE}=proto`
 - `build_config/${TARGET_RELEASE}=make`
The last such file found determines which code path is used.

Bug: 328495189
Test: manual, TH
Change-Id: I1d84db76b157082fc7db1b3cb7c9afe8cdf46cbf
2024-05-02 08:07:30 -07:00
LaMont Jones
91fa4323c8 Do not use build/trunk_release/release_config_map.mk
We won't be adding build/trunk_release to the manifest.

Bug: 328495189
Test: TH
Change-Id: I0ef2a900568daccfbd2ef1d8949674e6f2a63e00
2024-03-29 14:50:50 -07:00
LaMont Jones
76452d8b40 Defer "no such release config" error
This allows product-specific release config maps to declare release
configs.

Bug: 328495189
Test: manual
Change-Id: I862f167062ee647af00a4ec7d4af2966c6be44a8
2024-03-20 12:24:21 -07:00
LaMont Jones
451abd6a06 Allow duplicate release config maps and build flag declarations
Only include a release_config_map.mk file the first time it appears in
the list.

If the flag declaration is identical to one already declared, do not
raise an error.

This eases the process of migrating where flags are declared.

Bug: b/328781415
Bug: b/328495189
Test: manual, TH
Change-Id: I18316e769438f62071723771762d6e89be98b813
Merged-In: I18316e769438f62071723771762d6e89be98b813
2024-03-18 07:43:04 -07:00
LaMont Jones
318dafeca0 Look for release_config_map.mk in more projects
This allows us to split up build/release for better clarity.

Bug: b/328495189
Test: manual
Change-Id: If810780de164b74c3e3ebc35260384843de2c084
2024-03-08 12:02:15 -08:00
LaMont Jones
61b0f799e2 Add alias-release-config function
This should be used to declare that a release config is an alias for
another one.  Aliases have no release config files of their own, and are
primarily used to simplify continuous integration as releases happen.

Bug: None
Test: manual
Change-Id: Ife5eb1f8f4bf8e06832dc55bbc390ce2f741ebb8
2024-01-30 23:07:15 +00:00
LaMont Jones
55d5fc504b Override release configs in depth
When overriding a release config, make sure that the overriden config is
fully present (by processing any of its overrides) before overriding it.

Bug: None
Test: manual
Change-Id: I8d29c7ee7208acf7fe63876f617c5b9e2c26c434
2024-01-30 23:06:08 +00:00
LaMont Jones
a6b6e67e3b Allow overrides in declare-release-config
A release config declaration may indiciate that one or more other
release configs should be applied before this one overrides them, so
that we don't have to manually keep common flags in sync.

Bug: b/313479515
Test: manual
Merged-In: Ib7350500ae44adf4767aa7f9dbb8e71609fdd8c0
Merged-In: Ida444a5dbba578a36bd3607246fa14fc73b3f923
Change-Id: Ida444a5dbba578a36bd3607246fa14fc73b3f923
2023-11-27 22:02:56 +00:00
Greg Kaiser
2c8ece0b25 Merge "Reland: Require TARGET_RELEASE for builds" into main 2023-11-15 13:42:18 +00:00
Greg Kaiser
0229ecfae5 Reland: Require TARGET_RELEASE for builds
Relanding because we've fixed a number of the broken build
setups this change exposed.  We will push to fix forward broken
build setups instead of reverting this change again.


Rather than use an unsupported flag setting that the user likely
doesn't even realize is being used, we immediately stop the build.

This error message is more verbose, mentioning 'lunch', because
it's anticipated a lot more users will hit this issue when first
switching to trunk stable, and more details will hopefully help
them out.

We have some complication in that some internal commands set
TARGET_RELEASE to an empty string.  We put in logic to allow
that path.

Since $(error) immediately stops the build, we also get rid of
some 'else' logic and indentation, to hopefully offset some of
the complication we've added.

Bug: 307946156
Change-Id: I0fa4a1c876e607401f4c7f945b9971cfb8db71a0
Test: 'lunch' (still) works; A build attempt without `TARGET_RELEASE` set (now) fails
2023-11-09 20:28:55 +00:00
Robin Lee
092c6b68b8 Merge "Revert "Require TARGET_RELEASE for builds"" into main 2023-11-09 08:49:25 +00:00
Robin Lee
50fe46c1d3 Revert "Require TARGET_RELEASE for builds"
This reverts commit 24366c842b.

Reason for revert: b/309900087

Change-Id: I36550cbb0ae21a9c4f783f8a2fcd08ade2707f68
2023-11-09 08:01:06 +00:00
Treehugger Robot
1f94a3d547 Merge "Require TARGET_RELEASE for builds" into main 2023-11-09 04:23:37 +00:00
Greg Kaiser
24366c842b Require TARGET_RELEASE for builds
Rather than use an unsupported flag setting that the user likely
doesn't even realize is being used, we immediately stop the build.

This error message is more verbose, mentioning 'lunch', because
it's anticipated a lot more users will hit this issue when first
switching to trunk stable, and more details will hopefully help
them out.

We have some complication in that some internal commands set
TARGET_RELEASE to an empty string.  We put in logic to allow
that path.

Since $(error) immediately stops the build, we also get rid of
some 'else' logic and indentation, to hopefully offset some of
the complication we've added.

Bug: 307946156
Test: 'lunch' (still) works; A build attempt without `TARGET_RELEASE` set (now) fails
Change-Id: I2f667668c6688e501a3536981b7bae5fdbf962a0
2023-11-08 11:20:28 -07:00
Cole Faust
9a106f3ebb Remove release_config.bzl
The internal usages have been switched to release_config.scl.

Bug: 309686282
Test: Presubmits
Change-Id: If8e5a5b94a47474f5e76cf189c41980402f31085
2023-11-08 10:11:03 -08:00
Cole Faust
a44c7bd1ca Rename bzl files to scl
These files don't have anything to do with bazel, they just use starlark as a configuration
language. Bazel recently introduced the scl file extension to use for this format, which doesn't
have any bazel-specific symbols. Use that extension for our pure starlark files as well.

Bug: 309686282
Test: Presubmits
Change-Id: I7b08f342e7fb94405a52af0918ae6a7d542f3282
2023-11-07 15:30:39 -08:00
LaMont Jones
38b195ea7e Reapply "Add support for product-specific build flags"
1. release config maps now specify where the flag definitions are found.
2. PRODUCT_RELEASE_CONFIG_MAPS specifies additional release config map
files to use.

This allows product config to specify build flags, which can then be
specified by users of that product.

Bug: b/302593603, b/309477343
Test: manual
Change-Id: Ic1f0512ec4b06ac94dd3f29eadd6a03ba8ebf6d2
2023-11-06 22:15:19 +00:00
Colin Cross
671bc15286 Revert "Reapply "Add support for product-specific build flags""
Revert submission 2815850-product-flags

Reason for revert: b/309477343

Reverted changes: /q/submissionid:2815850-product-flags

Bug: 302593603
Bug: 309477343
Change-Id: I6294609d4c60973fceba567e37a6bc3b89239e42
2023-11-06 21:39:40 +00:00
LaMont Jones
df398d19d4 Reapply "Add support for product-specific build flags"
1. release config maps now specify where the flag definitions are found.
2. PRODUCT_RELEASE_CONFIG_MAPS specifies additional release config map
   files to use.

This allows product config to specify build flags, which can then be
specified by users of that product.

This reverts commit 75bfc37ef4.

Bug: b/302593603
Test: manual
Change-Id: I031a00459893644d7f67b63b982db9ae9015ae4d
2023-11-02 15:56:03 +00:00
Colin Cross
75bfc37ef4 Revert "Add support for product-specific build flags"
Revert submission 2787001-product-build-flags

Reason for revert: Possible cause of b/308849337

Reverted changes: /q/submissionid:2787001-product-build-flags

Bug: 302593603
Bug: 308849337
Change-Id: I01b5905a0a20a1401dcc1267e7fafc893e57d637
2023-11-02 00:13:30 +00:00
LaMont Jones
c6631fed48 Add support for product-specific build flags
1. release config maps now specify where the flag definitions are found.
2. PRODUCT_RELEASE_CONFIG_MAPS specifies additional release config map
   files to use.

This allows product config to specify build flags, which can then be
specified by users of that product.

Bug: b/302593603
Test: manual
Change-Id: I660a3d88c2aaecc14d6f370bebb0d05a8cc224f2
2023-10-30 23:40:04 +00:00
Greg Kaiser
6c1723254e Revert "Give an error when trying to build "next" targets"
This reverts commit f5eaf3cff3.

Reason for revert: -next targets are now healthy
Bug: 294161396

Change-Id: Idd61fd65d59a90057db9d6909267f5550cd5b2fe
2023-09-15 14:46:54 +00:00
Greg Kaiser
f5eaf3cff3 Give an error when trying to build "next" targets
The "next" targets aren't supported yet, so we want to fail
immediately.

If the environment variable TESTING_TARGET_RELEASE_NEXT is
set, then we'll allow a "next" build, so folks can work on
fixing this in the meantime.

Bug: 294161396
Test: "lunch mokey-next-userdebug" with and without TESTING_TARGET_RELEASE_NEXT set
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:f40be02ee51dec1bd5cdf88a4419684585ef6ef3)
Change-Id: If478a4efef937a0a986bfefdb61cc25921863b25
2023-08-10 16:26:12 +00:00
Joe Onorato
6aa48f8c5f Rename device_config --> aconfig and definitions --> declarations
Bug: 285303012
Test: for x in next trunk trunk_food trunk_staging ; do lunch aosp_panther-$x-eng ; m nothing ; done
Change-Id: I174ce3e609fa9077ea6bc61679ddb83e8efe57c8
2023-06-21 15:18:15 -07:00
Joe Onorato
1f6555151e Allow and merge multiple release configs with the same name
For now (to prevent build breakages when this is submitted), duplicate
flag values are allowed, but that will be disallowed once this change
automerges everywhere.

Bug: 286689485
Test: Treehugger
Change-Id: I723340ff9751b61d33c4108b0cc2f90702a116c9
2023-06-12 23:29:25 -07:00
Joe Onorato
d6df20a058 Clean up the API for release config in starlark
Also gets the json summaries working again.

Bug: 283477392
Test: Manual
Merged-In: Iaeb840e96bd7fef2fa1492cb55d9688f7ca75858
Change-Id: I05d9b816ad7ad30c1d238d01df811426d9aeddcb
2023-06-11 07:58:22 -07:00
Cole Faust
386b3746ce Define release flags in starlark instead of make
So that we have a more restricted enviornment for this new configuration
axis that can also be imported into other tools more easily.

Test: Manually (this time also tested setting OUT_DIR outside of the tree)
Change-Id: I01d90e06e45cba756156af16f63e04f575877263
2023-06-09 13:10:05 -07:00
Joe Onorato
7b578d32f9 Revert "Define release flags in starlark instead of make"
This reverts commit c113a70221.

Doesn't work with OUT_DIR hard coded outside the tree.

Test: OUT_DIR=/source/whatever m
Bug: 283278495
Change-Id: I8cc74a9ec936b9c7502b97b9b7a4fd731988c407
2023-05-19 09:22:42 -07:00
Cole Faust
c113a70221 Define release flags in starlark instead of make
So that we have a more restricted enviornment for this new configuration
axis that can also be imported into other tools more easily.

Test: Manually
Change-Id: Iabce1919f6d6f57a256ae144784af7c47622b54d
2023-05-16 15:46:55 -07:00
Joe Onorato
0d1a98106a Add aconfig rules
Test: treehugger
Change-Id: I456f87894926287a91d42e738016ca8052cd5039
2023-05-15 15:38:49 -07:00