Commit Graph

592 Commits

Author SHA1 Message Date
Cole Faust
b36d31d870 Add ctx argument to IDEInfo()
The IDEInfo() methods read properties. To make those properties
configurable, we need a context to evaluate them with.

Bug: 362579941
Test: m nothing --no-skip-soong-tests
Change-Id: I26d4b7084439b3006e50b02277298f74a929e1aa
2024-08-27 16:04:28 -07:00
Cole Faust
08c7f86575 Make IdeInfo into a provider
In order to keep the changes minimal, call the old IdeInfo method right
after GenerateAndroidBuildActions and then set the result of that
into a provider.

Test: Diff'd ninja files and saw no difference.
Change-Id: Ic706e7dbcb7c6e3d2a381ddae383eb87e105f385
2024-08-27 15:50:35 -07:00
Yu Liu
ec81054548 Remove licenseMetadataFile and installFiles from ModuleBase.
Bug: 358425833
Test: Manually verified all the generated ninja and mk files and CI.
Change-Id: I447ec74b7f9c3b8c686ed41511e2051f40ac88f8
2024-08-27 00:16:22 +00:00
Yu Liu
bad1eef6d8 Remove installFilesDepSet, packagingSpecsDepSet and licenseInstallMap
from ModuleBase.

The old packagingSpecsDepSet field is kept temporarily to bypass an
auto-merge issue, and will be removed in next change.

Bug: 358425833
Test: CI
Change-Id: I28b4933459c33224f756cc306cabc8088f9be862
2024-08-26 17:45:38 +00:00
Yu Liu
876b7ce263 Remove outputFiles from ModuleBase.
Bug: 358425833
Test: CI
Change-Id: I6c398fbdbc38b99fa62f8670baa44ffd51b5e6d3
2024-08-21 19:11:43 +00:00
Yu Liu
ddc2e1ac09 Remove build target related fields from ModuleBase.
Bug: 358425833
Test: CI
Change-Id: I2af6d0d2fd3be70594860a0e6d86179d5850eb07
2024-08-20 21:31:22 +00:00
Yu Liu
460c0fa8b4 Use namespace path instead of id in phonies.
Otherwise the phones' names depend on the sorting order of all the
namespaces, which add unnecessary dependencies.

Bug: 358425833
Test: CI
Change-Id: Ic88a329ff320e508ece8e3b20c7497a28a619276
2024-08-20 19:34:49 +00:00
Yu Liu
54513622f7 Add phonies as provider instead of updaing a global map.
Bug: 358425833
Test: Manually compare the generated mk and ninja files.
Change-Id: Ie74b620fc680ca2fc0d7836e88361ab3bdb87c49
2024-08-19 21:45:07 +00:00
Treehugger Robot
a5289ac9ef Merge changes Ia0e1b307,I63c7c33e into main
* changes:
  Define unstable container
  Define additional exception functions for container enforcement
2024-08-17 04:07:00 +00:00
Jihoon Kang
224ea08ee6 Define additional exception functions for container enforcement
These exception functions allow restriction to be loosened for some
inter-container dependencies.

Note that these functions are still no-op. Restriction enforcement will
be done in the child change.

Test: m nothing
Bug: 338660802
Change-Id: I63c7c33e33f271d4c2a84cc6070eb4896e030ab4
2024-08-16 22:57:39 +00:00
Yu Liu
fb995a1e3c Merge "Remove more internal fields from ModuleBase." into main 2024-08-16 22:14:01 +00:00
Kiyoung Kim
dd00f2de3c Merge "Introduce vintf_fragment module type" into main 2024-08-16 00:26:16 +00:00
Yu Liu
d46e5ae670 Remove more internal fields from ModuleBase.
Bug: 358425833
Test: Manual compare the generated ninja and mk files and CI.
Change-Id: I4edd0dc646ac035594f47cd9044cc4eb5f710e64
2024-08-16 00:20:27 +00:00
Yu Liu
ddc2833b7f Remove installFiles from ModuleBase.
This is to limit the direct accesses to the internal fields of a
module in order to better support incremental caching. To access
the install files data from singleton context or other modules'
context use providers thru the provided wrapper; to access it
from the same module inside GenerateBuildActions use ctx which is
short-lived only inside this method.

Bug: 358425833
Test: CI
Change-Id: I337b07a2ef95fb2a898ac2f9277160a3f76a603c
2024-08-14 22:56:30 +00:00
Kiyoung Kim
faf6af31cd Introduce vintf_fragment module type
Introduce a new vintf_fragment module type which handles vintf_fragment
files within Soong. This will help process to move vintf_fragment
handling logic from KATI to Soong. This change also introduces
vintf_fragment_modules property to mark dependency with vintf_fragment
modules.

Bug: 322089980
Test: m nothing --no-skip-soong-tests passed
Change-Id: I49607f42aeee3ded0ba7b078b903dc35f5d61637
2024-08-14 10:34:41 +09:00
Yu Liu
8bf4079e5f Merge "Skip writing ninja file for module with a cache hit during incremental build." into main 2024-08-13 17:00:55 +00:00
Yu Liu
663e4508dc Merge SingletonProviderContext with OtherModuleProviderContext
Bug: 358425833
Test: CI
Change-Id: I8e3f40dc3cfc5337008b419801f8e6bf2d48e8b2
2024-08-12 22:50:19 +00:00
Yu Liu
f072120c00 Skip writing ninja file for module with a cache hit during incremental build.
This is just the first change, many more will come to make this feature
really work. The main changes included here are:

1. Skip the writing of ninja file if a module has a cache hit.
2. Handle the case where a skipped module doesn't have the build defs
   info for the OrderOnlyStrings dedup logic to work by caching the
   missing info.

Bug: 335718784
Test: local manual tests
Change-Id: I32542bd1e7fd268113e072e7f68b51b293d83d03
2024-08-02 22:11:46 +00:00
Yu Liu
2800675b31 Rename ModuleId to ModuleCacheKey and call the same named method on moduleInfo
Bug: 335718784
Test: local manual tests
Change-Id: I364cd20281e52a1682f14a43c41bfe9993f04477
2024-07-31 21:38:15 +00:00
Cole Faust
bf1d92ad20 Cleanup configurable getter usages
You don't have to call module.ConfigurableEvaluator(ctx) if ctx is
already a ModuleContext, you only need to do that for more restricted
contexts like SingletonContext.

Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I7612290d43dae7decfae283a341882d9016c98a3
2024-07-29 12:24:25 -07:00
Inseob Kim
f223702f3f Make the vintf_fragments property configurable
This allows using select statements with it.

Bug: 354824866
Test: m
Change-Id: I9080c14b8342868d842670c65386582552b32d46
2024-07-23 14:03:12 +09:00
Treehugger Robot
00abdc02de Merge "Add 'use_debug_art' to product_variable" into main 2024-07-19 03:21:23 +00:00
Ivan Lozano
a0258d8b3f Merge "android: Add host_cross_supported prop" into main 2024-07-18 14:31:02 +00:00
Ivan Lozano
c7eafa7a41 android: Add host_cross_supported prop
Some modules are only intended to be build for the build host,
e.g. rust_library modules only used in rust_proc_macro or
code generators.

These should not be expected to be built for or supported on non-build
host platforms. Thus, add a host_cross_supported property to disable
the HostCross target.

Test: m blueprint_tests
Test: Modules with host_cross_supported: false don't build for HostCross
Change-Id: Ia15f55776e04d86aee19bb0dd0d27e1b985b2b75
2024-07-18 13:28:27 +00:00
Kiyoung Kim
881e465fda Add 'use_debug_art' to product_variable
Add 'use_debug_art' property to product_variable so it can be checked
from Android.bp whether ART debug APEX or ART APEX should be used.

Bug: 351698657
Test: AOSP CF eng build succeeded
Test: AOSP CF userdebug build succeeded
Change-Id: I01cd80f0d899c55828ecb05fdafdc9bb05fd8200
2024-07-18 13:25:18 +09:00
mrziwang
7a47bd3a81 Return error for unsupported context in outputFilesForModuleFromProvider
Test: CI
Change-Id: I42d2341ea2613a28d403615f3ebccd0067d5501f
2024-07-17 11:11:05 -07:00
Zi Wang
03b228e725 Merge "Remove OutputFileProducer" into main 2024-07-16 15:58:46 +00:00
Treehugger Robot
9678733731 Merge changes I861a60e1,I01bf99fa,I9d16dfec into main
* changes:
  Add util method HasIntersection(...)
  Implement InstallableModule for Java modules
  Collect container informations
2024-07-16 00:43:04 +00:00
Jihoon Kang
c3d4e115af Collect container informations
This change introduces a method to collect the information of what
containers (i.e. api domain, partition, or any custom defined boundaries
of interest) the module belongs to. The method is called in
`ModuleBase.GenerateBuildActions`.

Each container objects defines the following:
- name of the container
- list of "restrictions", which are the containers that a module that
  belongs to this container is not allowed to depend on. Each
  "restrictions" also defines custom rules which allow bypassing the
  restricted dependency. Each rules are an enum that are mapped to a
  function, given that functions are not hashable and thus cannot be set
  as a value in a provider.

Note that this change is a no-op, as the container information is only
collected for modules that implement the "InstallableModule" interface,
which is not implemented by any other module types in this change. This
will be utilized in the follow-up changes.

Test: m nothing --no-skip-soong-tests
Bug: 338660802
Change-Id: I9d16dfec0dcf06da464aa49ee7b23f46f1da236a
2024-07-15 23:43:36 +00:00
mrziwang
d38e63d474 Remove OutputFileProducer
All the module types that were using OutputFileProducer
are using OutputFilesProvider now. This CL removes the
remaining OutputFileProducer code.

Test: CI
Bug: 339477385
Change-Id: I3c29785a59b907117b16ca2d0e56ef846adfb228
2024-07-15 13:50:18 -07:00
Zi Wang
2dbf71fed8 Merge "Use OutputFilesProvider in module_test" into main 2024-07-12 20:39:09 +00:00
mrziwang
1ea01e3c59 Use OutputFilesProvider in module_test
In the context of incremental soong, the output files
inter-module-communication will be through OutputFilesProvider.
The OutputFileProducer interface will be deprecated.

Test: CI
Bug: 339477385
Change-Id: Iaf0b039b17d34e1a696f2c87df2f0db39307fc6d
2024-07-12 12:26:34 -07:00
Colin Cross
e1a8555581 Add IsAddingDependency to IncomingTransitionContext
Add an IsAddingDependency method to IncomingTransitionContext that
returns true if IncomingTransition is called after the transition
has already won while adding a new dependency.  This will be used
as part of the transition mutators to support an apex use case where
incoming dependencies during the initial apex mutator need to be
rewritten onto the platform variant for modules that don't support
the apex, but a later call to OtherModuleDependencyVariantExists
must not rewrite the requested apex variation onto the platform
variant.

This should be used sparingly, all uses will have to be removed in
order to support creating variants on demand.

Bug: 319288033
Test: TestIsAddingDependency
Flag: EXEMPT refactor
Change-Id: Ib8e419d35ff8f7cbff9667c1cd40d05ccfacab8b
2024-07-11 16:59:34 -07:00
mrziwang
68b2594524 Fix typo in outputFilesForModule error message
Test: CI
Change-Id: I41f28a0412613458a0dad132006adfbc9fbbce2c
2024-07-11 09:58:30 -07:00
mrziwang
9f7b9f4a9a Use OutputFilesProvider on java modules
In the context of incremental soong, the output files
inter-module-communication will be through OutputFilesProvider.
The OutputFileProducer interface will be deprecated.

Test: CI
Bug: 339477385
Change-Id: I3c9f0b766325dd490bc903dc65259c3953d34606
2024-07-10 12:18:06 -07:00
Inseob Kim
f58d7efa29 Merge "Revert "Use hashed subdir for soong_config modules"" into main 2024-06-27 04:30:30 +00:00
mrziwang
abdb293492 Update outputFilesForModuleFromProvider
This CL includes following changes:
1. Added the ability to differentiate the cases that module never
   sets OutputFilesProvider and that module sets the provider with
   a nil value.
2. Updated GenerateTaggedDistFiles to use outputFilesForModuleFromProvider.
3. Updated on cc module to use OutputFilesProvider.

Test: CI
Bug: 339477385
Change-Id: Ib5663a947315f6a90a81b7f073cf8dd22fbb1e05
2024-06-25 15:37:09 -07:00
Treehugger Robot
51fc67bd20 Merge "Cleanup more bazel code" into main 2024-06-25 19:24:12 +00:00
Cole Faust
487b144fe0 Cleanup more bazel code
Bug: 315353489
Test: m nothing --no-skip-soong-tests
Change-Id: I6c6b4fcd559f4a45b1a96c70cbb5d6d1a615ccff
2024-06-25 11:02:38 -07:00
Inseob Kim
b7e9f5f035 Revert "Use hashed subdir for soong_config modules"
This reverts commit 81b00a8db7.

Reason for revert:
* select() will supersede Soong config modules.
* A tiny change can make hundreds of gigabytes rebuilt.
* Hashed out/ directories are not cleaned.
* Even without this trace, AB build time is fast enough, thanks to
  product-specific ninja files and so on.

Bug: 348548855
Test: m --no-skip-soong-tests
Change-Id: If9a97df1e161a9ef0fb1b801f9e129b71b11d1ac
2024-06-25 17:39:52 +09:00
Wei Li
a1aa297518 Export Soong modules and build a database from metadata from Make and Soong.
Bug: 324465531
Test: CIs
Test: m compliance-metadata.db
Change-Id: Ia1c9ab0ae874dd47969555ddbfb93405b57a651f
2024-06-24 17:20:59 -07:00
Zi Wang
b651aaaf9e Merge "Add OutputFilesProvider support for singleton" into main 2024-06-24 22:13:42 +00:00
mrziwang
0cbd3b0e79 Add OutputFilesProvider support for singleton
This CL also changes to use OutputFilesProvider on rust module, which
has singleton involved.

Test: CI
Bug: 339477385
Bug: 348494466
Change-Id: Idc5c0fb9f8425f09184d5b73531ee3052e5a076c
2024-06-24 11:55:47 -07:00
Cole Faust
1c74ac54a8 Merge "Allow soong config variables to be boolean-typed" into main 2024-06-21 01:21:25 +00:00
Cole Faust
46f6e2f1aa Allow soong config variables to be boolean-typed
So that you can use `true` instead of `"true"` in select expressions.

Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I950bd8e04f8fab5187ea5075514d476227943f33
2024-06-20 14:59:10 -07:00
mrziwang
4295359c12 Allow module gets its own output files using non-empty-string tag
Test: CI
Bug: 339477385
Change-Id: I332c377ad59d9355cb44ee18b85a56e37580e7b6
2024-06-20 10:02:26 -07:00
Yu Liu
88f4e331cc Merge "Experimental code to support build action caching." into main 2024-06-19 01:57:12 +00:00
Yu Liu
fa29764f9f Experimental code to support build action caching.
Bug: 335718784
Test: build locally
Change-Id: Icc1f1fb15f9fe305e95dd51e2e7aff1e9cbf340c
2024-06-19 00:09:32 +00:00
Cole Faust
43ddd08bd2 Make required a configurable property
So that users can use select statements with it.

Fixes: 347605145
Bug: 342006386
Test: m nothing --no-skip-soong-tests
Change-Id: Ica0ca6d1725b000b3748c0293e5a9f9b38ed87f9
2024-06-17 12:32:40 -07:00
mrziwang
e6c8581fbe Use OutputFilesProvider on bpf
This changes makes bpf module type uses OutputFilesProvider,
instead of current OutputFileProducer for inter-module-
communication.

Test: CI
Bug: 339477385
Bug: 342406930
Change-Id: I85d1141e9f6583cc5427756107da99f56b0c7ea1
2024-06-04 22:09:13 -07:00