Commit Graph

7745 Commits

Author SHA1 Message Date
Colin Cross
91d5251e24 Merge changes from topic "transition-mutator-config" into main am: c50999eb0a am: 038f35114a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2923151

Change-Id: I84c2a83b436d9e7b373104b49b04668c74600b61
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-24 21:16:05 +00:00
Colin Cross
c50999eb0a Merge changes from topic "transition-mutator-config" into main
* changes:
  Add ArchModuleContext to TransitionMutator contexts
  Split ArchMutatorContext out of BaseMutatorContext
2024-01-24 20:03:46 +00:00
Colin Cross
4aa3e0ab81 Add ArchModuleContext to TransitionMutator contexts
Converting coverageMutator to a TransitionMutator requires adding
the ctx.Device() and ctx.DeviceConfig() methods.

Bug: 319288033
Test: builds
Change-Id: I697b48eb89bc23800d2d3c62d68358769f0d1075
2024-01-24 10:17:10 -08:00
Colin Cross
1d3d9f13b8 Split ArchMutatorContext out of BaseMutatorContext
Split the context methods that are useful on anything visiting a
module that has arch variants into a separate ArchMutatorContext
for reuse by TranstitionMutators.

Bug: 319288033
Test: builds
Change-Id: Ifdc21983c6c79f22965a49f169812a8cc3ad975b
2024-01-24 10:17:10 -08:00
Ronald Braunstein
4464f03e19 Merge "Add team property to all modules." into main am: 43f3b601e2 am: 9a412422cc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2883106

Change-Id: I9d5928d72da59308a6b6bd0a93f6c03ff0c2e463
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-23 17:10:37 +00:00
Ronald Braunstein
43f3b601e2 Merge "Add team property to all modules." into main 2024-01-23 16:00:58 +00:00
LaMont Jones
54c20c7274 Merge "Add VisitDirectDepsIgnoreBlueprint" into main am: d19b214fa1 am: b242ed2eee
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2920271

Change-Id: Iffc947d8b3db558fa84c835ec269ee04caccaf90
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-22 23:47:35 +00:00
Cole Faust
7d1e80d607 Merge "Remove SymlinkOutputs" into main am: b64c070edf am: 534ca54383
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2918066

Change-Id: Ifde0e2504bc2989416909c09ea2fbb49c4b16397
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-19 20:40:43 +00:00
LaMont Jones
34314b7d15 Add VisitDirectDepsIgnoreBlueprint
This method allows dependencies on non-Android modules, which it ignores
in strict mode, rather than flagging the dependency as an error.

Bug: none
Test: manual
Change-Id: I9575e46638fa8ffc69c8935b1b65aab37ceab3c3
2024-01-19 20:22:10 +00:00
Cole Faust
b64c070edf Merge "Remove SymlinkOutputs" into main 2024-01-19 19:38:55 +00:00
Paul Duffin
e5d89e4da1 Merge "Pretty print SBox manifest files to make them easier to read" into main am: 169cffe526 am: ba810e39c7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2786461

Change-Id: I0d501dcde64a6572aab90af0d8872508a27cc68c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-19 11:25:29 +00:00
Paul Duffin
169cffe526 Merge "Pretty print SBox manifest files to make them easier to read" into main 2024-01-19 10:09:11 +00:00
Colin Cross
ab5df974bd Disable TestVariantSingletonModule when go test -short is used am: 74dc598a71 am: 23084506c2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2913033

Change-Id: Ic0dda836a823b4972d4382847c0c6c4613a14dae
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-19 01:08:44 +00:00
Paul Duffin
4a3a0a5412 Pretty print SBox manifest files to make them easier to read
When debugging problems with, or just modifying a ninja rule that uses
the SBox it is often necessary to read the manifest file. This change
makes them easier to read by pretty printing them onto multiple lines
with a small but clear indent.

This increased the size of the following file by abot 6% from 66K to
70K bytes:
    out/soong/.intermediates/packages/modules/Wifi/framework/framework-wifi.stubs.source.system/android_common/metalava.sbox.textproto

Test: m out/soong/.intermediates/packages/modules/Wifi/framework/framework-wifi.stubs.source.system/android_common/metalava.sbox.textproto
      less out/soong/.intermediates/packages/modules/Wifi/framework/framework-wifi.stubs.source.system/android_common/metalava.sbox.textproto
Change-Id: Icfadeaad1c6334bd0010128f4437669f35822850
2024-01-19 00:57:16 +00:00
Colin Cross
23084506c2 Disable TestVariantSingletonModule when go test -short is used am: 74dc598a71
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2913033

Change-Id: Id49d4173e658e2188d4a4f9fdc5b70c3da67f6cb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-19 00:26:29 +00:00
Colin Cross
1b1b9a937b Merge changes from topic "soong-tests-presubmit" into main
* changes:
  Add script to run Soong tests with go tools
  Disable TestVariantSingletonModule when go test -short is used
  Fix data race in propagateRROEnforcementMutator
  Fix data race in finder_test.go
  Fix data race in dex_bootjars
  Fix race CommonGlobalCflags when running tests in parallel.
  Fix data race in snapshot singletons when running parallel tests
2024-01-18 23:58:45 +00:00
Ronald Braunstein
73b08ffd0d Add team property to all modules.
This allows vendors (like google) to specify which team owns the test
module and code.

Team is a commonProperty on modules and points to the designate "team"
module.  The DepsMutator adds the dependency on the "team" module and
"GenerateBuildActions" write the team data to intermediate files.

A new singleton rule, all_teams visits all modules and writes out
the proto containing the team for each module.
If a module doesn't have a team, then it finds the package in the
blueprint file and parent directory blueprint files that have a
default_team and uses that team.

Test: m all_teams
Test: go test ./python ./java ./cc ./rust ./android
Test: added team to HelloWorldHostTest and built the new asciiproto target
Test: added package default_team and checkout output proto.
Change-Id: I5c07bf489de460a04fc540f5fff0394f39f574a7
2024-01-18 14:16:06 -08:00
Colin Cross
74dc598a71 Disable TestVariantSingletonModule when go test -short is used
TestVariantSingletonModule tests that an error is produced when a
mutator creates variants of a SingletonModule.  It also triggers
a data race when cloneLogicModules copies the properties, as the
ModuleFactory of a SingletonModule always returns the same module
with the same property structs.  The build is about to fail with an
error anyways, so hopefully the data race isn't a problem.  There
is no way to disable the test when the data race detector is enabled,
so disable it when -short is enabled, which is the case for all of
our CI testing.

Test: go test -race -short ./...
Change-Id: I944a4901acb60df8e590270f178961d95095a7e9
2024-01-18 13:23:06 -08:00
Cole Faust
9a346f6da3 Remove SymlinkOutputs
symlink_outputs was added so bazel could run ninja files, but we
abanoned that approach in roboleaf, and then roboleaf was cancelled
entirely. Remove this feature so we're more compatible with upstream
ninja / n2.

Bug: 160568334
Test: Presubmits
Change-Id: Ic368c48dd01b68e51c471c3fe90d0c02c55956e9
2024-01-18 12:43:24 -08:00
Treehugger Robot
5c798af3b5 Merge "Allow to change static_libs for variant" into main am: 2f08cfc77e am: beae0739cc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2912388

Change-Id: I84f2f9290bd07a5c93fec5e65d10f27dbdd3932f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-17 04:15:39 +00:00
Treehugger Robot
2f08cfc77e Merge "Allow to change static_libs for variant" into main 2024-01-17 02:54:48 +00:00
Treehugger Robot
a6ba24bcfe Merge "Remove HideFlaggedApi() related logic and the related product variables" into main am: c0412f5d31 am: bd44b17537
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2911028

Change-Id: I1b06464b5784e64825ffa81209971ba944b4be8c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-17 01:42:48 +00:00
Florian Mayer
ca2854e708 Allow to change static_libs for variant
This will be used to have different static_libs if we build with scudo.

Bug: 309446525
Change-Id: I5f755dd768975a1dff403bffa92cd5dbc3b9f573
2024-01-16 16:42:34 -08:00
Treehugger Robot
c0412f5d31 Merge "Remove HideFlaggedApi() related logic and the related product variables" into main 2024-01-17 00:20:54 +00:00
Treehugger Robot
b31d06a669 Merge "Disable prebuilt apps without an apk later" into main am: 535f739153 am: 731c981258
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2909137

Change-Id: I92c58414ee2825f327c3f5475d1216e497272490
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-16 21:50:25 +00:00
Jihoon Kang
78b6b30aec Remove HideFlaggedApi() related logic and the related product variables
With the recent build changes to support generating mainlin module sdk
with flagged apis, the build no longer depends on the values of these
product variables in exposing the flagged apis, but these are determined
by the aconfig flags. Given that these variables are no longer used,
this change removes these variables and the variables dependent code.

Test: m nothing --no-skip-soong-tests
Bug: 320515715
Change-Id: I6af94da73cc7fc7ffce670928aad81cec5d383b4
2024-01-16 20:20:27 +00:00
Treehugger Robot
535f739153 Merge "Disable prebuilt apps without an apk later" into main 2024-01-16 18:25:30 +00:00
Jihoon Kang
4243511709 Enable hiddenapi check for exportable stubs am: bd093457e2 am: c32db5a7ad am: e1678131d3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2889892

Change-Id: Idb07d662b8e37dcd0138f4e7d086ef2eefb9d23b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-13 03:27:21 +00:00
Treehugger Robot
83bc6838be Merge "Allow value variables to set pointer properties" into main am: 404fb4e40b am: adc4caf2cd am: a870d1b210
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2908797

Change-Id: If48bb5d602a114622eec946e4b817849fcfca800
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-13 03:26:48 +00:00
Jihoon Kang
c32db5a7ad Enable hiddenapi check for exportable stubs am: bd093457e2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2889892

Change-Id: If6c32bbf60f9105164e145ee186247de779c26eb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-13 01:33:10 +00:00
Cole Faust
97494b197e Disable prebuilt apps without an apk later
Currently, android_app_import modules get disabled during their load
hook if they don't have a set `apk` property. This causes them to be
disabled before soong config variables can be applied, which would've
set the apk property.

Move the disabling into a DefaultableHook, which will run after the
soong config variables.

Bug: 319897584
Test: m nothing --no-skip-soong-tests
Change-Id: Ia0f6a39c35b3b11249bfa74ad532858189be24b1
2024-01-12 17:02:58 -08:00
Jihoon Kang
7e9343b889 Merge changes from topic "hiddenapi_exportable" into main
* changes:
  Copy exportable artifacts to module sdk snapshot
  Enable hiddenapi check for exportable stubs
  Add defaults support for bootclasspath_fragment module type
2024-01-12 23:50:37 +00:00
Cole Faust
a03ac3a75a Allow value variables to set pointer properties
Non-null pointers were always leading to an "unsupported property type"
error due to not updating the kind field.

Bug: 319897584
Test: Presubmits
Change-Id: I058ab8d153d9507f9037d699acf6e1fe4f08f538
2024-01-12 14:28:53 -08:00
Jihoon Kang
bd093457e2 Enable hiddenapi check for exportable stubs
This change modifies the dependencies of the hiddenapi to always depend
on the exportable stubs, instead of the currently utilized everything
stubs.

To support this, the full api surface exportable stubs are defined in a
separate change at the `frameworks/base` project. Note that the full api
surface exportable stubs are only used for the hiddenapi purpose, and
`sdk_version` continues to utilize the currently existing everything
stubs.

Currently, this feature is hidden behind the build flag
"RELEASE_HIDDEN_API_EXPORTABLE_STUBS". This feature will be fully
enabled once metalava fully supports handling of the flagged apis.

Test: ENABLE_HIDDENAPI_FLAGS=true m
Bug: 317426356
Change-Id: I109b7cd27b20ceffcdf1766ab8106b0c276be2b3
2024-01-12 01:03:10 +00:00
Treehugger Robot
cc6ad12920 Merge "Handle installation rules for co-existing prebuilts" into main am: 744a2a6b7d am: 055d4a728b am: 38bbc18c99
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2901309

Change-Id: Ic1bb89aa5ae41bbba4bc0d4d4d44b316c6fdd573
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-11 20:03:32 +00:00
Yu Liu
289657936a Merge "Add container to the path of the merged aconfig files." into main am: e92e561460 am: 4e0a860ac7 am: 35c1227174
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2904949

Change-Id: Ia2acb8572d3eda950d1001fdc19a4cfd3849e4c3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-11 20:03:10 +00:00
Treehugger Robot
744a2a6b7d Merge "Handle installation rules for co-existing prebuilts" into main 2024-01-11 18:46:58 +00:00
Spandan Das
3576e769a4 Handle installation rules for co-existing prebuilts
Every module belonging to a single mainline module family will be
hidden from make, except the one which has been flagged using
apex_contributions

Details
- Introduce a new `source_apex_name` property to prebuilt_apex and
  override_apex. This property will be used to identify the source
  equivalent of a prebuilt soong apex module.
- Create an N-ary tree from source to prebuilt(s). The tree wil be
  rooted at the source module.
- In a subsequent mutator, visit every node in the tree(s). Query
  apex_contributions and store the handle of the node which is "active"
  (if any)
- In the same mutator, do another pass over the tree. Invoke
  `HideFromMake` on every node which is not "active". The two-pass
  approach is needed PrebuiltSelectionInfoProvider does not know about
  the inter source-prebuilt dependency, this dependency can only be
  known by doing a graph walk of the N-ary tree.

Some tangential implementation details
- Each prebuilt apex has an internal deapxer module that is responsible
  for generating the deapex ninja rules. The name of this internal
  module uses the BaseModuleName (without the prebuilt_ prefix). Since
  we can have multiple prebuilt soong modules in trunk stable, change
  this to follow the name of the prebuilt module in order to avoid name
  collisions. Update existing unit tests accordingly

Bug: 316179314
Test: go test ./apex -run TestInstallationRulesForMultipleApexPrebuilts
Test: m nothing --no-skip-soong-tests
Test: presubmits

Change-Id: I58aa99d5e6a9859954614e6db9a8e9e2e581642d
2024-01-11 02:02:59 +00:00
Yu Liu
edeadbfdcf Add container to the path of the merged aconfig files.
Bug: 312769710
Test: CI
Change-Id: I4b8a71cf86a3bcefc4a41360a241aa14b798f6e8
2024-01-10 23:38:09 +00:00
LaMont Jones
ed89443a0f Merge changes Iaf6d45a4,Ic56e8ef3,I11f0a0b5 into main am: 15b031e10e am: 0f2753094a am: 82cf614b7e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2901516

Change-Id: Iafb7bcff23771b8342fc9adb99f679645f83b83c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-10 21:14:15 +00:00
LaMont Jones
afe7baf47d Propagate aconfig providers for more modules.
Bug: 308625757
Test: manual
Change-Id: Iaf6d45a4259f1c6c34476c34c431344283ae2830
2024-01-10 14:03:30 +00:00
LaMont Jones
acae2d7656 move SetAconfigFileMkEntries to android
This will need to be called by some modules handled in android.

Bug: 308625757
Test: manual
Change-Id: Ic56e8ef3a453c59866aab6d39a21108cf8536b56
2024-01-10 14:03:29 +00:00
LaMont Jones
1e0a69a02e aconfig: harden dependency collection
To prevent errors, when we collect dependencies for a module, walk the
blueprint modules, and ignore blueprint and disabled modules.

This avoids errors in validateAndroidModule when a android.Module (such
as a genrule) depends on a blueprint.Module, and strict checking is
enabled.

Bug: 308625757
Test: manual

Change-Id: I11f0a0b504aa18d6d786cc91319b9d1d9497c04f
2024-01-10 14:02:47 +00:00
Treehugger Robot
6fa5af612e Merge "Replace panic with ModuleErrorf" into main am: ec3887ad2f am: db7220eb70 am: 1ef21535e7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2901513

Change-Id: I3e894707ca4a3866046de2f53d7c8c1ebd59477b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-10 02:17:46 +00:00
Treehugger Robot
4d904444ec Merge ""master" was renamed "main"." into main am: b087a04583 am: 9aa0db9fb9 am: eef86c6e51
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2902135

Change-Id: I9369ae07a9800e141c3d85dd909de4129430430e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-10 00:40:04 +00:00
Treehugger Robot
ec3887ad2f Merge "Replace panic with ModuleErrorf" into main 2024-01-10 00:16:52 +00:00
Spandan Das
59a4a2b8d2 Replace panic with ModuleErrorf
This is a followup cleanup for aosp/2876754 and replaces panic with
ctx.ModuleErrorf. The latter creates a more expressive build error.

Implementation details
- export moduleErrorf interface from build/soong/android. This minimal
  interface will be used as a parameter for `DexJarBuildPath`
- Add ModuleErrorf to the function signature of DexJarBuildPath. This
  parameter only gets used for Import and SdkLibraryImport structs.
  These two can have duplicate deapexer definitions, and ModuleErrorf
  will be used to report that error
- Create a minimal implementation of `ModuleErrorf` in tests of java and
  apex

Test: m nothing --no-skip-soong-tests
Change-Id: I0febec651f40c3f04deb957e64133c94b80fbd78
2024-01-09 22:53:52 +00:00
Elliott Hughes
10363161e7 "master" was renamed "main".
Test: N/A
Change-Id: I86d5578eaac260e55a9583db7ab49812b4ba1f5d
2024-01-09 22:09:07 +00:00
Colin Cross
c0df117bb4 Merge "Remove more bp2build" into main am: 8460fab92d am: e8abefc8fc am: 23eaf43d3f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2898911

Change-Id: I96ed0eb7461faf32b83c30206a80bc9796ab34f3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-08 22:18:39 +00:00
Colin Cross
8460fab92d Merge "Remove more bp2build" into main 2024-01-08 20:26:14 +00:00