Commit Graph

83645 Commits

Author SHA1 Message Date
Yu Liu
663e4508dc Merge SingletonProviderContext with OtherModuleProviderContext
Bug: 358425833
Test: CI
Change-Id: I8e3f40dc3cfc5337008b419801f8e6bf2d48e8b2
2024-08-12 22:50:19 +00:00
Yi Kong
703c2e3d64 Merge "Bump pessimizing-move from -Wno to -Wno-error" into main 2024-08-12 18:31:42 +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
Spandan Das
9dfccb91a5 Merge changes Ib4581079,Ia3887bae into main
* changes:
  Make IdeInfo aware of jarjar-ing
  Add .internal modules to IDEInfo.deps of top-level java_sdk_library
2024-08-12 16:40:30 +00:00
Yi Kong
fd50d175ad Bump pessimizing-move from -Wno to -Wno-error
This is a useful warning that can point out lower performance code.

https://r.android.com/q/hashtag:pessimizing-move-cleanup cleaned up many
cases. Let's bump this up to a non-error warning while we fix up the
remaining cases.

The warning remains off for all external code.

Test: presubmit
Bug: 154270751
Change-Id: If6b69cbaa1384e81336b6842607a587bf6c7f38b
2024-08-12 17:51:38 +08:00
Kiyoung Kim
d0338d3565 Merge "Remove host_snapshot module" into main 2024-08-12 00:37:38 +00:00
Treehugger Robot
6f4d57a790 Merge "Build product/odm build.prop with Soong" into main 2024-08-12 00:08:32 +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
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
788f69722c Merge changes Iab6efe78,I73affae8 into main
* changes:
  Register versioned sdk dependency in module_bp_java_deps.json
  Add IdeInfo for java module types
2024-08-09 22:24:51 +00:00
Dan Albert
fbe5780312 Disable ABI tracking for bionic.
This is being done with a path-based filter rather than as a property
of ndk_library because there would be no way to prevent people from
disabling ABI tracking without API council review if it were a
property, since there's no per-module OWNERS.

Bug: http://b/358653811
Test: m ndk
Change-Id: If6af638accc917294eee18cb08551c5df25462ad
2024-08-09 21:16:56 +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
Yi Kong
c8b6feba4c Merge "Move -Wno-error=format from external NoOverride to external flags" into main 2024-08-09 13:50:03 +00:00
Ivan Lozano
3d46dc569a Merge "rust: Add dylib variants for bindgen modules." into main 2024-08-09 12:39:23 +00:00
Kiyoung Kim
ef693fc9bc Remove host_snapshot module
Remove host_snapshot implementation which is no longer in use.

Bug: 332986564
Test: soong build succeeded
Change-Id: I96ee4eb319f380d9f85de7f9716e63513838624c
2024-08-09 07:16:03 +00:00
Yi Kong
2e2d753760 Move -Wno-error=format from external NoOverride to external flags
Test: presubmit
Bug: 315250603
Change-Id: Ib1ed2aed52818e177c1b40da17e192606308243a
2024-08-09 14:56:58 +09:00
Jooyung Han
f826c99ec2 Merge "apex: rm $out before decompressing an apex." into main 2024-08-09 01:33:04 +00:00
Priyanka Advani (xWF)
d882a0c92d Merge "Revert "Verify that ndk_headers headers are valid C."" into main 2024-08-08 23:29:41 +00:00
Priyanka Advani (xWF)
181934cc26 Revert "Verify that ndk_headers headers are valid C."
Revert submission 3207854-ensure-c-ndk-headers

Reason for revert: Droidmonitor created revert due to b/358445530.

Reverted changes: /q/submissionid:3207854-ensure-c-ndk-headers

Change-Id: I649941a4d063d76a1c6a8e58fb885da2c44331c0
2024-08-08 22:49:18 +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
Treehugger Robot
894a93840d Merge "Verify that ndk_headers headers are valid C." into main 2024-08-08 21:37:29 +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
Inseob Kim
01d4f8b823 Build product/odm build.prop with Soong
Bug: 322090587
Test: compare build.prop before and after, boot
Change-Id: I7a7dc785030a0c17e5c09b7f65c978fe9bbcb7a7
2024-08-08 18:13:08 +09:00
Yi Kong
9b94da79cd Re-enable -Wformat warning
Change-Id: I9af8606a1e782dfb809d7f4df7b043d53ea7ba9f
Test: presubmit
Bug: 315250603
2024-08-08 15:12:42 +09:00
Yi Kong
375aba8cf1 Merge "Do not enable AFDO for coverage builds" into main 2024-08-08 06:10:33 +00:00
Jooyung Han
8fa6116aca apex: rm $out before decompressing an apex.
Otherwise, incremental build fails with "already exists".

Bug: 357916000
Test: incremental build with PRODUCT_COMPRESSED_APEX=false and prebuilt
  compressed APEXes
Change-Id: If2a0be735e3710afd1d40b16b43608028eb95c5a
2024-08-08 10:45:48 +09: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
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
Spandan Das
b08bf77438 Add IdeInfo for android_library_import
The information will be used for IDE autocompletion.

Test: {
  "jars": [
    "out/soong/.intermediates/prebuilts/misc/common/androidx-test/androidx.test.core-nodeps/android_common/turbine-combined/androidx.test.core-nodeps.jar",
    "out/soong/.intermediates/prebuilts/misc/common/androidx-test/androidx.test.core-nodeps/android_common/busybox/R.jar"
  ],
  "path": [
    "prebuilts/misc/common/androidx-test"
  ]
}

Bug: 356572093

Change-Id: I62166c6d5cfa1cf0c49adf42d5d8b4ca40ab5a11
2024-08-08 00:06:23 +00:00
Colin Cross
8c844e0b8f Merge changes I2b182cd3,Ibf6d9b79 into main
* changes:
  Split jarjarIfNecessary out of compileJavaHeader
  Convert JavaInfoProvider to *JavaInfo
2024-08-07 23:48:01 +00:00
Ronald Braunstein
79a10d90a3 Merge "Add some verification on test_suite for test_module_config" into main 2024-08-07 22:45:44 +00:00
Ronald Braunstein
a186ac04bb Add some verification on test_suite for test_module_config
During some migration, I created some modules where the derived module
and base module were in different suites (one was in general-tests, one
was in base-tests).
This had the potential to create dangling symlinks for partial downloads
from the test suites in tradefed.

Bug: b/357880359
Test: go test ./
Test: m nothing
Test: modified a Android.bp with test_module_config to change the suite
to "device-tests" from "general-tests" and got the error as expected:
   error: cts/tests/libcore/luni/Android.bp:70:1: module "CtsLibcoreTestCases_dalvik_system" variant "android_common": Suite: [device-tests] listed but does not exist in base module: CtsLibcoreTestCases

Change-Id: Ia8fa991914a47336fc2d0148f066824433db2ecd
2024-08-07 14:41:02 -07:00
Colin Cross
1f75cdf980 Use rsp for kotlin classpath
Support long classpaths by passing the classpath in a file to the script
that generates build.xml.

Bug: 308016794
Test: builds
Flag: EXEMPT refactor
Change-Id: Ib238a83a26acba7ede8e55298397dbeb9a57a866
2024-08-07 14:11:43 -07:00
Colin Cross
edec77c453 Split jarjarIfNecessary out of compileJavaHeader
A future CL is going to change transitive classpath behavior when
jarjar is enabled.  In preparation, split the jarjar rules out
of compileJavaHeader into a separate jarjarIfNecessary method, and
use it on the classes and resource jars too.

Also tweak the naming of the output files in repackageFlagsIfNecessary
to be prettier.

Bug: 308016794
Test: all soong tests pass
Flag: EXEMPT refactor
Change-Id: I2b182cd30631f2bd7925341b9171e6b3c0e8d450
2024-08-07 14:11:43 -07:00
Colin Cross
d1d8f17e9e Move kotlin stdlib after javac jars
A future CL is going to treat local jars separately from dependency
jars.  Rearrange the order of the kotlin standard library jars to
come after the local jars produced by javac, which will better match
the future ordering and ease ninja file comparisions.

Bug: 308016794
Test: all soong tests pass
Flag: EXEMPT refactor
Change-Id: I9ed6a649350451bf1788077752db5222f50c0247
2024-08-07 14:11:43 -07:00
Colin Cross
7727c7f096 Convert JavaInfoProvider to *JavaInfo
Convert JavaInfoProvider to return a *JavaInfo instead of a JavaInfo.
This will reduce copying when reading the provider, and also allows
JavaInfo to recursively contain a depset of JavaInfos from
dependencies.

Bug: 308016794
Test: go test ./java/...
Flag: EXEMPT refactor
Change-Id: Ibf6d9b797f760ad1fe815d59839839fdfad91733
2024-08-07 14:11:43 -07:00
Treehugger Robot
d40aac1340 Merge "Don't hold on to WritablePath" into main 2024-08-07 20:48:50 +00:00
Treehugger Robot
d6358b6a9b Merge "Remove the hardcoded list of api libraries" into main 2024-08-06 23:37:54 +00:00
Jihoon Kang
463893917c Remove the hardcoded list of api libraries
The list no longer need to be maintained given that `java_sdk_library` modules generate from-text stubs by default.

Change-Id: I18c94731d0a337c8815fd589868377fc8933437c
Test: m nothing
Bug: 276958307
2024-08-06 22:39:16 +00:00
Treehugger Robot
6fb39c1fce Merge "Annotate Set property as android:Path" into main 2024-08-06 22:37:14 +00:00
Spandan Das
7811e46669 Annotate Set property as android:Path
This allows use of filegroups as inputs.

Test: go build ./java
Change-Id: Ibe8634b49c30dcf62f80dfa89875c43ad741eaff
2024-08-06 21:28:33 +00:00
Zi Wang
f5bf74f35d Merge "Remove unused tagSplitter function" into main 2024-08-06 19:36:03 +00:00
Treehugger Robot
4f18cfdd7d Merge "Revert "Revert "Enable from-text stub generation in non-sdk java..."" into main 2024-08-06 18:50:04 +00:00
Wei Li
b320ab283c Merge "Switch SBOM generation of products to Soong." into main 2024-08-06 18:17:36 +00:00
mrziwang
d9279cd476 Remove unused tagSplitter function
Test: CI
Bug: 357675466
Change-Id: I844476e8afbf9f3cc9f4556ba27ea62f9262cb0c
2024-08-06 10:47:03 -07:00
Treehugger Robot
72ae33f6fa Merge "Disable ResourceProcessorBusyBox in kythe builds" into main 2024-08-06 17:34:36 +00:00
Ivan Lozano
d8f64ec810 rust: Add dylib variants for bindgen modules.
Provide dylib variants for bindgen modules. This avoids issues where
bindgen modules being rlib-only results in a dependency tree
containing the same crate with two different linkages.

Bug: 294698705
Test: Example with binder and fmq crates builds.
Change-Id: Ia72f573db3c232c97276038e4315134d90033e10
2024-08-06 14:22:20 +00:00
Spandan Das
29207b57cf Move the installation rules of boot images to soong
This CL adds moves the installation rules of boot images to soong. This
will eventually allow us to build devices by skipping `katiBuild` and
moving straight to `katiPackaging`

Details
1. Drop `no_full_install` from dex_bootjars singleton. This ensures that
   the files installed by this singleton module does not get skipped
when generating the soong installs file (out/soong/installs-*)
2. Replace PackageFile with InstallFile. This registers the installation
   rules for both make-built and soong-built images (e.g.
aosp_cf_system_x86_64)
3. Implement `AndroidMkEntries` for dex_bootjars singleton. OutputFile
   needs to be non-nil so that this module does not get elided when
generating out/soong/Android-*. `OutputFile` was abritrarily set to one
of the many files installed by this singleton.

Test: no diff in
target/product/vsoc_x86_64/obj/PACKAGING/system_intermediates/file_list.txt
(top of stack)
Bug: 355700341
Bug: 355703904

Change-Id: I3531defa6bba58ef78f6d66e881502a8222fc229
2024-08-06 02:27:17 +00:00