Commit Graph

8646 Commits

Author SHA1 Message Date
Treehugger Robot
c59a128390 Merge "Restrict R8 -libraryjars refs for stable targets" into main am: 0fd3de6151
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3233562

Change-Id: I719d8ec110b692833aed69550f24eaa7159de6f7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-20 22:37:26 +00:00
Treehugger Robot
0fd3de6151 Merge "Restrict R8 -libraryjars refs for stable targets" into main 2024-08-20 22:31:28 +00:00
Jared Duke
2246844554 Restrict R8 -libraryjars refs for stable targets
The current R8 dex pipeline gathers transitive header jars to avoid
issues with missing class definitions. While this is benign for
platform targets not using a stable SDK, it can introduce issues
for stable targets (e.g., duplicate class defs for mainline framework
modules).

Bypass this transitive jar referencing for such targets that should
reference explicit, stable, stub API libraries. A follow-up change
will resolve specific issues with mainline system server targets.

Bug: 360905238
Test: m
Change-Id: I11a136d33ca9dd0dfff436c7045bf1807d17b1e7
2024-08-20 20:45:35 +00:00
Cole Faust
0821a8cf57 Merge "Only add deps on java_binary's jni_libs on host" into main am: b4cc88efef
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3230584

Change-Id: I5a6588ee4724f6b128e0e2ed5092b3f52c57996c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-20 20:13:16 +00:00
Cole Faust
3dac486013 Only add deps on java_binary's jni_libs on host
The jni_libs property of java_binary is documented to only install
the jni libraries on host. However, it was adding installable
deptag deps on those libraries, even if they were for device. This
caused soong to emit installation rules for the jni libraries, causing
them to be installed to the staging directory, but not emitting
proper information to make, so they wouldn't be included on the built
partitions.

Only install them if the module is built for host, so that they don't
erroneously appear in the staging directory.

Bug: 344695913
Test: Presubmits
Change-Id: Ic40b4fc6d7dbd51c03b08e28037be5428db49c33
2024-08-20 11:44:04 -07:00
Treehugger Robot
903a500065 Merge changes Ia0e1b307,I63c7c33e into main am: a5289ac9ef
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3216639

Change-Id: I5de31ae329756b4fd028e58e1bf9299eb3ad8347
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-17 04:43:09 +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
0f3b1a7288 Define unstable container
Unstable container marks modules that are static reverse dependencies of
"framework-minus-apex". These modules contain unstable implementation
details of the platform, and should not be accessed by the CTS tests.

Test: m nothing
Bug: 338660802
Change-Id: Ia0e1b3070f0f7b2c1b9c27306323e2428d9722ca
2024-08-16 22:57:57 +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
Colin Cross
11b14d2eda Merge "Track resources separately in java_import" into main am: 7c2af51a3d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3221407

Change-Id: Ib4bd8f81be30ef3c82244f24bf267bdbb7363c60
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-16 22:31:35 +00:00
Colin Cross
5e989b554c Merge "Convert more stored WritablePaths to Paths" into main am: 6ca3f758d0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3221406

Change-Id: I162b94190cb28fa7f74901557d9b45c313b1b66a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-16 22:30:59 +00:00
Colin Cross
7c2af51a3d Merge "Track resources separately in java_import" into main 2024-08-16 22:30:33 +00:00
Treehugger Robot
099f466484 Merge "Run "ravenizer" on ravenwood jars" into main am: 08e76d9591
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3225782

Change-Id: I1c9c6faadae080fd32d769b1acafc090ed1d85e4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-16 22:30:08 +00:00
Yu Liu
a5c0d1f355 Merge "Remove more internal fields from ModuleBase." into main am: fb995a1e3c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3221927

Change-Id: Icafa7150b5320cbff6dffaef15453a078f39c9a8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-16 22:27:52 +00:00
Colin Cross
6ca3f758d0 Merge "Convert more stored WritablePaths to Paths" into main 2024-08-16 22:16:56 +00:00
Treehugger Robot
08e76d9591 Merge "Run "ravenizer" on ravenwood jars" into main 2024-08-16 22:16:41 +00:00
Yu Liu
fb995a1e3c Merge "Remove more internal fields from ModuleBase." into main 2024-08-16 22:14:01 +00:00
Colin Cross
45e2c9ba92 Merge "Move kotlin stdlib to normal dependency tag" into main am: f0df94a76d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3216738

Change-Id: Ib86bb51550db89f2e926229610b969fa98e2a79a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-16 21:19:48 +00:00
Colin Cross
f0df94a76d Merge "Move kotlin stdlib to normal dependency tag" into main 2024-08-16 21:01:23 +00:00
Colin Cross
53c33178d1 Merge "Use rsp files to pass turbine inputs to RBE" into main am: f330b3dc77
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3214560

Change-Id: Ib5d6c8c78d29a68414f2c5161a78047e37cc5d43
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-16 20:40:52 +00:00
Colin Cross
f330b3dc77 Merge "Use rsp files to pass turbine inputs to RBE" into main 2024-08-16 20:18:09 +00:00
Makoto Onuki
7ded3827a4 Run "ravenizer" on ravenwood jars
Ravenizer is a new tool to preprocess ravenwood tests.

It can optionally be applied to other java targets (for analyzing them,
etc).

The actual tool is being implemented internally, so in AOSP, we just
use a script that copies the jar file as a replacement.

Test: manual -- run `m RavenwoodBivalentTest` and make sure the ravenizer
    log message shows up.
Flag: EXEMPT host test change only
Bug: 360390999
Change-Id: I6d1f81e7c425397b16c37e7c30267957097387fd
2024-08-16 12:08:35 -07:00
Colin Cross
53529a9061 Track resources separately in java_import
java_import currently collects the "implementation and resource jar"
from each of its dependencies.  This results in different resource
conflict resolution than other java modules, which collect
implementation jars and resource jars separately.  Modify java_import
to match the other module types.

Flag: EXEMPT refactor
Test: all soong tests pass
Change-Id: I06134e2621582799b3a525d2c12b900b8d86d171
2024-08-16 11:56:19 -07:00
Colin Cross
77965d9bd4 Convert more stored WritablePaths to Paths
Similar to I40f28075ce151e4be80d6cfc7ec173dfa46f9bbf, convert
more long-lived WritablePaths to Paths.

Test: all soong tests pass
Flag: EXEMPT refactor
Change-Id: I9be448f811694fe0524fbbd7c5d4553cf69d533a
2024-08-15 20:43:39 -07: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
df8125ba55 Merge "Remove installFiles from ModuleBase." into main am: e89b6dd497
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3214788

Change-Id: I194534a60f18f2a2c0d8f2eac65cc400e50d927a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-15 17:45:56 +00:00
Yu Liu
e89b6dd497 Merge "Remove installFiles from ModuleBase." into main 2024-08-15 17:23:59 +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
Colin Cross
882d600d79 Move kotlin stdlib to normal dependency tag
The kotlin standard library was added with a custom dependency tag,
which then required special handling later.  We know up front whether
it will be treated the same as a static_libs or libs dependency, so
just reuse staticLibTag or libTag, and remove all the special handling.

Bug: 308016794
Test: TestKotlin
Flag: exempt REFACTOR
Change-Id: I2c5601faec284d88f28e13378d9cbffc24560efa
2024-08-14 15:28:34 -07:00
Jihoon Kang
ca43c1fe44 Correct the name of the android.car.builtin module that is instrumented am: 6de6d7267f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3219097

Change-Id: I5b6630e12c928dcd6134ddb12c4c51fcda93e940
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-14 18:51:53 +00:00
Jihoon Kang
6de6d7267f Correct the name of the android.car.builtin module that is instrumented
java_sdk_library is not instrumented as it does not perform any
compilation actions. Instead, its submodule impl lib (with .impl suffix)
is instrumented.

Test: CI
Bug: 355514682
Bug: 339901608
Change-Id: I2f7b4a8cf14a592d268b6f5d44f72e43700b4907
2024-08-14 16:39:57 +00:00
Colin Cross
2fcc48e4a3 Use rsp files to pass turbine inputs to RBE
Turbine rules that run in RBE fail when they have long lists of
flags.  They work locally because the list of flags is placed in
an RSP file, but the list of inputs still appears on the command
line when RBE is enabled to pass them to rewrapper.

When the list of srcjars or classpath arguments are too long,
move the list of files into an rsp file, and pass the rsp file to
RBE instead of the list of files.

Bug; 308016794
Test: builds
Flag: EXEMPT refactor

Change-Id: I5ee610a91302ce94ec77b6f13b28a29bc63fd962
2024-08-13 14:07:47 -07:00
Yu Liu
73282e8129 Merge "Merge SingletonProviderContext with OtherModuleProviderContext" into main am: 246b43049c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3216676

Change-Id: Ib0d8eb66616fa4775e3827b4956ad19034bf1cc8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-13 16:15:51 +00:00
Yu Liu
663e4508dc Merge SingletonProviderContext with OtherModuleProviderContext
Bug: 358425833
Test: CI
Change-Id: I8e3f40dc3cfc5337008b419801f8e6bf2d48e8b2
2024-08-12 22:50:19 +00:00
Colin Cross
6bdec0cbe6 Merge changes If313580b,I68d50d68 into main am: 08b6061539
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3214342

Change-Id: I301643cc587ff80e243115b8f729eba4e0cd3e02
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-12 17:37:42 +00:00
Spandan Das
9b5740ceeb Merge changes Ib4581079,Ia3887bae into main am: 9dfccb91a5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3214336

Change-Id: I03e42b30ce41cdadee05041afc717bf8fee36d8d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-12 17:37:24 +00:00
Colin Cross
08b6061539 Merge changes If313580b,I68d50d68 into main
* changes:
  Use a provider for systems modules
  Add PrepareForTestWithBuildFlag
2024-08-12 16:53:42 +00:00
Colin Cross
b61c226943 Use a provider for systems modules
Replace the SystemModulesProvider interface with Provider

Test: all soong tests
Flag: EXEMPT refactor
Change-Id: If313580b28094d55b71f1635259bafa850ef7af5
2024-08-09 16:47:45 -07:00
Colin Cross
a66b4630f6 Add PrepareForTestWithBuildFlag
Add a helper function that creates a test fixture preparer that
sets a build flag, and use it everywhere that was setting build flags
manually.

Test: all soong tests
Flag: EXEMPT refactor
Change-Id: I68d50d68787a30d091f0827e8caa51f5c5a762ef
2024-08-09 16:47:45 -07:00
Spandan Das
b4cd5df573 Make IdeInfo aware of jarjar-ing
jarjar can be used to repackage a java_library. e.g. Foo.java in package
com.android might get repackaged to prefix.com.android.Foo in the
resultant jar. To allow code completion of rdeps, we should use the
repackaged jar instead of the src files.

This CL sets dpInfo.Jars to the header jar _only_ when jarjar_rules is
not empty. We could probably set `Jars` to the header jar even for non
jarjar-d libraries and get rid of `Srcs`, `SrcJars` altogether, but that
would likely slow down any tools that index
out/soong/module_bp_java_deps.json for code completion.

Test: go test ./java
Bug: 356572093
Change-Id: Ib45810799a479cb315aed011a34351d386a21357
2024-08-09 22:37:33 +00:00
Spandan Das
742394d3e6 Merge changes Iab6efe78,I73affae8 into main am: 788f69722c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3214777

Change-Id: I6ea2dc099a65c623271f3abe4eb9f76db7f38aac
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-09 22:36:25 +00:00
Spandan Das
dee1a7419f Add .internal modules to IDEInfo.deps of top-level java_sdk_library
libraries and apps can depend on the top-level java_sdk_library like
such
```
java_library {
  name: "mylib",
  libs: ["somesdklib"],
}
```
and soong will automatically resolve mylib's classpath to either the
stub or impl library based on the api container these libraries are in.

Since the top-level java_sdk_library has no compilation actions, code
completion of `mylib` is not feasible today via
`module_bp_java_deps.json`. This CL adds support for this code
completion by registering the .impl (or public stubs) as a transtive
dependency of `mylib`.

The implication of this change is that implementation symbols of the sdk
library will be surfaced during code-completion of mylib, even when
mylib is in a different container. Long term, this should go away when
all the library dependencies are made explicit in Android.bp files.

Test: go build ./java
Test: verified that symbols of android.car.builtin (a java_sdk_library)
can be resolved with the repro instructions in b/356572093#comment5

Bug: 356572093
Bug: 358613520
Change-Id: Ia3887bae34bbd25b8c6346f43602835da32af84a
2024-08-09 22:27:47 +00:00
Spandan Das
6e8bd1cc37 Register versioned sdk dependency in module_bp_java_deps.json
java modules that link against a versioned sdk (sdk_version: <num>) get
the appropriate stub jar on its classpath, but the dependency is not
registered in its build graph. This CL registers this dependency for
module_bp_java_deps.json. Ideally, we should move this to `decodeSdkDep`
so that this dependendency becomes known to other tools that analyze
soong's module graph (e.g. soongdbg)

Test: go test ./java
Bug: 358608607
Bug: 356572093
Change-Id: Iab6efe7826d18dedfadbe4d34d78e7eb2888bd8d
2024-08-09 17:16:23 +00:00
Spandan Das
f5ee86c46f Add IdeInfo for java module types
This CL adds support for
1. java_system_modules
2. java_system_modules_import
3. java_device_for_host
4. java_host_for_device

Bug: 356572093
Test: cat out/soong/module_bp_java_deps.json | jq
'."core-all-system-modules"' is no longer null

Change-Id: I73affae834df7f6ed961fa757585242f6d388395
2024-08-08 22:38:27 +00:00
Colin Cross
5866fc2d42 Merge changes Ib238a83a,I9ed6a649 into main am: 82201c2db1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3212336

Change-Id: I3499299e5069555bb3b7df1fcd712fc4aea7e3f7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-08 18:26:02 +00:00
Colin Cross
82201c2db1 Merge changes Ib238a83a,I9ed6a649 into main
* changes:
  Use rsp for kotlin classpath
  Move kotlin stdlib after javac jars
2024-08-08 18:11:59 +00:00
Treehugger Robot
8ab67df967 Merge changes Ifc905b14,I62166c6d into main am: edcbad4054
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3212518

Change-Id: I80d58e2d6dd31b2b3909c3e6d16a88333c7fcb5f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-08 01:40:47 +00:00
Treehugger Robot
edcbad4054 Merge changes Ifc905b14,I62166c6d into main
* changes:
  Fix IDEInfo for java_import
  Add IdeInfo for android_library_import
2024-08-08 01:24:10 +00:00
Colin Cross
151156760c Merge changes I2b182cd3,Ibf6d9b79 into main am: 8c844e0b8f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3198494

Change-Id: If9cd85e3ae2c51007a0884ada2dfe9207208f242
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-08 00:09:42 +00:00
Spandan Das
6d26f80c6c Fix IDEInfo for java_import
`Jars` property in module_bp_java_deps.json should be relative to the
android build top, and not relative to the Android.bp file

Bug: 356572093
Test: m out/soong/module_bp_java_deps.json and verified that `jars` in
an arbitrary java_import module is relative to android top

Change-Id: Ifc905b14500dfa4254b27505fcc8af8f18349587
2024-08-08 00:06:29 +00:00