Commit Graph

621 Commits

Author SHA1 Message Date
Colin Cross
8bbc3d5a30 Convert arch and os mutators to TransitionMutators
Replace archMutator and osMutator with TransitionMutators.

Bug: 319288033
Flag: EXEMPT refactor
Test: all soong tests pass
Test: no change to out/soong/*.ninja
Change-Id: I92a4d7c895dd79f1dd8064d0ca90e7010b563525
2024-09-16 17:00:39 -07:00
Cole Faust
e8a8783154 Rename ConfigAndErrorContext to ConfigurableEvaluatorContext
I'm going to be adding some methods to this interface, give it
a name based on how it's going to be used, not based on what methods
it contains.

Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I9bba04ba756c4dbe00625e2d04af81e78a11cae9
2024-09-11 11:35:46 -07:00
Treehugger Robot
a136147c9c Merge "Add VINTF fragment modules into required libs of modules-info" into main 2024-09-05 01:46:19 +00:00
Yu Liu
c55b25f125 Merge "Move the caching/restoring code from soong to blueprint to fully skip build actions." into main 2024-09-04 22:01:33 +00:00
Yu Liu
26a716d5e5 Move the caching/restoring code from soong to blueprint to fully skip build actions.
Bug: 358425833
Test: Manually verified the generated ninja and mk files and CI.
Change-Id: Ieebb822c46f37c0ff55fad08531e9870a76cbd7b
2024-09-04 19:59:55 +00:00
Colin Cross
ca3bf2be39 Merge "Move checkbuild targets of Soong modules into Soong" into main 2024-09-04 17:12:03 +00:00
Jiyong Park
b11c99d084 Merge "Make overrides work in Soong" into main 2024-09-04 00:03:20 +00:00
Colin Cross
a6182ab2fa Move checkbuild targets of Soong modules into Soong
Pass the name of Soong's checkbuild target for each module to
Make so that it can depend on it from the main checkbuild rule.
This will give better control over which files get built, allowing
checkbuild to skip the jar combining step when transitive classpath
jars are enabled.  The per-module checkbuild targets are passed to
make instead of added directly as a dependency of checkbuild in order
to maintain the existing behavior of only building modules exposed
to make in checkbuild.

Also tweak the existing calls to CheckbuildFile and add
InstallFileWithoutCheckbuild to match the files that are
in the Make-based checkbuild.

Bug: 308016794
Test: m checkbuild
Change-Id: Ic5140819381d58f4d00f23a7a12447950c4cf268
2024-09-03 14:52:19 -07:00
Jiyong Park
a574d535b5 Make overrides work in Soong
This change adds `overrides` property to all module types. It is used
to prevent another module (or modules) from being installed or packaged.

Bug: 330141242
Test: go test ./...

Change-Id: I4f05c603f0c5dbb699d00327882c7498472b59de
2024-09-02 19:58:38 +09:00
Jihoon Kang
7344482ff3 Merge "Revert^4 "Implement detecting container violations."" into main 2024-08-30 20:18:53 +00:00
Jihoon Kang
85bc193805 Revert^4 "Implement detecting container violations."
This change introduces a method to detect violating inter-container
dependencies between modules. The method is run in
`ModuleBase.GenerateBuildActions`, after the container info provider is
set. Given that the provider of the direct dependencies would have been
set at this time, the method utilizes this information to determine
the violations, which are introduced in https://r.android.com/3141104.

Note that this enforcement does not turn all inter-container
dependencies as errors. Instead, it will only turn dependencies that
matches the pre-defined violations into errors. Even if the dependency
matches the violation, an error will not be thrown if the dependency
satisfies any of the exception functions (e.g. the dependent module is
stubs, or the two modules belong to the same apexes).

Test: m nothing --no-skip-soong-tests
Bug: 338660802
Change-Id: Ib9ddc0761fa46f1309b1a1a4f759d9a4e04fd70e
2024-08-29 17:55:00 +00:00
Yu Liu
11d8b6e8d3 Merge "Remove containersInfo, complianceMetadataInfo and aconfigFilePaths from ModuleBase." into main 2024-08-29 17:07:05 +00:00
Kiyoung Kim
74408202e3 Add VINTF fragment modules into required libs of modules-info
Currently modules-info.json misses modules from vintf_fragment_modules
because it was not handled from Soong. This change adds
vintf_fragment_modules as part of required modules of modules-info.json
so it can be handled from any other logic handles build information with
the json file.

Bug: 322089980
Test: An artifact depends on the modules-info.json handles
vintf_fragments modules properly.

Change-Id: I09a61b2ed201099a9d3b05dbed061d0366bb9255
2024-08-29 17:46:44 +09:00
Priyanka Advani (xWF)
88a8daf8ca Merge "Revert^3 "Implement detecting container violations."" into main 2024-08-28 23:20:03 +00:00
Priyanka Advani (xWF)
33b3a638a5 Revert^3 "Implement detecting container violations."
2a88491afc

Change-Id: Iba4527f391a093703978fe01177b56fec4604b28
2024-08-28 23:10:29 +00:00
Jihoon Kang
c14be38f1a Merge changes Ia693c4a5,I8e5620d2 into main
* changes:
  Revert^2 "Implement detecting container violations."
  Define additional container violations
2024-08-28 21:35:16 +00:00
Jihoon Kang
2a88491afc Revert^2 "Implement detecting container violations."
This change introduces a method to detect violating inter-container
dependencies between modules. The method is run in
`ModuleBase.GenerateBuildActions`, after the container info provider is
set. Given that the provider of the direct dependencies would have been
set at this time, the method utilizes this information to determine
the violations, which are introduced in https://r.android.com/3141104.

Note that this enforcement does not turn all inter-container
dependencies as errors. Instead, it will only turn dependencies that
matches the pre-defined violations into errors. Even if the dependency
matches the violation, an error will not be thrown if the dependency
satisfies any of the exception functions (e.g. the dependent module is
stubs, or the two modules belong to the same apexes).

Test: m nothing --no-skip-soong-tests
Bug: 338660802
Change-Id: Ia693c4a53369c757a3e96656a769405c759b111c
2024-08-28 18:01:25 +00:00
Yu Liu
b41b74fa2c Merge "Remove packagingSpecsDepSet from ModuleBase." into main 2024-08-28 17:12:07 +00:00
Satish Yalla
f2d6e5004f Merge "Revert "Implement detecting container violations."" into main 2024-08-28 05:48:21 +00:00
Satish Yalla
b2b1ef63e2 Revert "Implement detecting container violations."
This reverts commit bb678f82d6.

Reason for revert: Droidmonitor created revert due to b/362639013. Will be verifying through ABTD before submission.

Change-Id: I1dcb71672eeb44a17cf176d3731bcaf9aaf81edf
2024-08-28 05:10:31 +00:00
Treehugger Robot
26f071db92 Merge "Implement detecting container violations." into main 2024-08-28 04:39:12 +00:00
Treehugger Robot
9cbbafe300 Merge changes from topic "ctx_in_ideinfo" into main
* changes:
  Add ctx argument to IDEInfo()
  Add configurable property support to neverallow
2024-08-28 00:49:13 +00:00
Yu Liu
713f415cde Merge "Remove moduleInfoJSON from ModuleBase." into main 2024-08-28 00:32:50 +00:00
Yu Liu
9a99313ac6 Remove containersInfo, complianceMetadataInfo and aconfigFilePaths from ModuleBase.
Bug: 358425833
Test: Manually verified all the generated ninja and mk files and CI.
Change-Id: I896659491e75bb2eacca93d2e4a83ead50e218d2
2024-08-28 00:02:48 +00:00
Treehugger Robot
78a3761bde Merge "Make IdeInfo into a provider" into main 2024-08-27 23:49:10 +00:00
Yu Liu
eb6d705d1f Remove packagingSpecsDepSet from ModuleBase.
The external code that depends on this field has been changed to use the
new interface, this field can be removed now.

Bug: 358425833
Test: Manually verified all the generated ninja and mk files and CI.
Change-Id: I12cb6e22c091bc90d3a3cbbf554e81b8dc27e264
2024-08-27 23:26:28 +00:00
Yu Liu
4297ad9046 Remove moduleInfoJSON from ModuleBase.
Bug: 358425833
Test: Manually verified all the generated ninja and mk files and CI.
Change-Id: I145272636b87b20e49c05e847336737cccc20f79
2024-08-27 23:23:26 +00:00
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
82a6d1464d Remove 6 install related fields from ModuleBase.
Bug: 358425833
Test: Manually verified all the generated ninja and mk files and CI.
Change-Id: If2c3417781953a1eef2b07a241424157fd73abff
2024-08-27 19:03:35 +00:00
Jihoon Kang
bb678f82d6 Implement detecting container violations.
This change introduces a method to detect violating inter-container
dependencies between modules. The method is run in
`ModuleBase.GenerateBuildActions`, after the container info provider is
set. Given that the provider of the direct dependencies would have been
set at this time, the method utilizes this information to determine
the violations, which are introduced in https://r.android.com/3141104.

Note that this enforcement does not turn all inter-container
dependencies as errors. Instead, it will only turn dependencies that
matches the pre-defined violations into errors. Even if the dependency
matches the violation, an error will not be thrown if the dependency
satisfies any of the exception functions (e.g. the dependent module is
stubs, or the two modules belong to the same apexes).

Test: m nothing --no-skip-soong-tests
Bug: 338660802
Change-Id: I36e9cd956c5a076a53635be0c6ff27f77725516e
2024-08-27 17:30:42 +00: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