Commit Graph

83625 Commits

Author SHA1 Message Date
Cole Faust
d65add2253 Tag resource_dirs as android:"path"
Resource_dirs is queried using PathsWithOptionalDefaultForModuleSrc,
which includes all the infrastructure to resolve module references,
but needs to be tagged android:"path" to be able to add the module
references as dependencies.

Test: Manually
Change-Id: Ie3f75332c9a4cc0ee4b4c93268188440ff7ce249
2024-07-31 16:42:33 -07: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
Jihoon Kang
7eaa83707e Merge "Convert imageMutator to TransitionMutator" into main 2024-07-31 20:39:16 +00:00
Treehugger Robot
043503e6aa Merge "fix soongdbg missing args" into main 2024-07-31 19:02:09 +00:00
Jihoon Kang
5402bbd8d7 Convert imageMutator to TransitionMutator
Replace android.imageMutator with a TransitionMutator

Test: diff out/soong/Android-<product>.mk
Bug: 319288033
Change-Id: Id6a50a2aacb32ecfadf7e45ada4956e85b55fef2
2024-07-31 18:53:06 +00:00
Taylor Santiago
60fa202bb5 Merge "Use consistent directory for source and output inside the build sandbox for ABFS." into main 2024-07-31 17:55:41 +00:00
Treehugger Robot
3cc8933133 Merge "Fix RBE tmp dir" into main 2024-07-31 15:28:12 +00:00
Jerome Gaillard
6524e1d51c Merge "Handle missing dependencies in ravenwood.go" into main 2024-07-31 11:02:10 +00:00
Jooyung Han
26ec8484e4 apex: respect PRODUCT_COMPRESSED_APEX for prebuilt APEXes
If a prebuilt APEX is compressed, it's installed without decompression
even when PRODUCT_COMPRESSED_APEX is false.

This change decompresses the prebuilt/compressed APEX.

Bug: 356533488
Test: OVERRIDE_PRODUCT_COMPRESSED_APEX=false m
Change-Id: Ifdde074e383837df92d172bc483bfca9a97cb6f8
2024-07-31 15:04:05 +09:00
Zijun
09fdda5b3b Turn on relaxed-template-template-args as a workaround
Update compiler to r536225 and the error: argument '-fno-relaxed-template-template-args' is deprecated arises.

Bug: b/341084395
Test: presubmit
Change-Id: If714f96e4537b5f8d695cd7c0d1cd0a8ddcbb96e
2024-07-31 05:12:41 +00:00
Maciej Żenczykowski
469b5a1236 Merge "Soong: BPF: Cflag and btf defaults" into main 2024-07-31 03:35:33 +00:00
Inseob Kim
bc4ef22b9b Revert^6 "Use Soong-built system/build.prop"
d5a12721b5

Change-Id: I6f4bf3043e73763b047bec3303f1547ec647d12b
2024-07-31 02:18:22 +00:00
Inseob Kim
2887482f0f Revert^6 "Sync gen_build_prop.py to sysprop.mk"
This reverts commit 7b7593968b.

Reason for revert: fixed breakage with aosp/3200730, verified with ABTD

Change-Id: I83a4cb1a39bce1a1da8fabd49c6c895862a6c686
2024-07-31 02:18:07 +00:00
Inseob Kim
6bd92d5924 Revert^2 "Conditionally pass kernel version to build.prop"
This reverts commit 29fed1efe8.

Reason for revert: Fixed breakage with aosp/3200730, verified with ABTD

Change-Id: I207abd188636673250eb9a070be95db0b82f39e7
2024-07-31 02:17:49 +00:00
Inseob Kim
d8538e5db0 Revert^6 "Add TARGET_SYSTEM_PROP to system build.prop"
530c32acbe

Change-Id: I9dc817855e3db7b96320a977b24b84d72e762893
2024-07-31 02:17:39 +00:00
Inseob Kim
88b109e6b4 Revert "Revert "Revert^2 "Set output for build_prop even on Soon..."
Revert submission 3200273-revert-3196490-revert-3195812-revert-3195644-revert-3195637-revert-3184480-system_build_prop_soong-BZIDUTEOOC-KRUETCBWUR-TUHZPHUVFJ-XYILSUPUOA-PCKYAVELZP

Reason for revert: fixed breakage with aosp/3200730, verified with ABTD

Reverted changes: /q/submissionid:3200273-revert-3196490-revert-3195812-revert-3195644-revert-3195637-revert-3184480-system_build_prop_soong-BZIDUTEOOC-KRUETCBWUR-TUHZPHUVFJ-XYILSUPUOA-PCKYAVELZP

Change-Id: If9e6841bb915a79d9817838a1657017ddee9c1a7
2024-07-31 02:16:54 +00:00
Liana Kazanova
530c32acbe Revert^5 "Add TARGET_SYSTEM_PROP to system build.prop"
26756a86c1

Change-Id: Iad186b283ea78477c33bfc4519b9a27395557b55
2024-07-31 08:26:38 +09:00
Liana Kazanova
7b7593968b Revert^5 "Sync gen_build_prop.py to sysprop.mk"
2c7e13ea37

Change-Id: Ic1fd9ec4d65b657fb80a3849539e286934111d3c
2024-07-30 23:23:28 +00:00
Liana Kazanova
d5a12721b5 Revert^5 "Use Soong-built system/build.prop"
45ed4c2f9c

Change-Id: I574f29539d58239cd3f0e1ba6ae86e1b5d0f55ea
2024-07-30 23:22:51 +00:00
Liana Kazanova
a11ab980b8 Revert "Revert^2 "Set output for build_prop even on Soong only b..."
Revert submission 3196490-revert-3195812-revert-3195644-revert-3195637-revert-3184480-system_build_prop_soong-BZIDUTEOOC-KRUETCBWUR-TUHZPHUVFJ-XYILSUPUOA

Reason for revert: DroidMonitor: Potential culprit for b/356297315 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Reverted changes: /q/submissionid:3196490-revert-3195812-revert-3195644-revert-3195637-revert-3184480-system_build_prop_soong-BZIDUTEOOC-KRUETCBWUR-TUHZPHUVFJ-XYILSUPUOA

Change-Id: I40f63fdc0c25c37a7193ec09407498e707a55a37
2024-07-31 08:08:55 +09:00
Inseob Kim
60f2636903 Fix build thumbprint in gen_build_prop.py
Bug: 356297315
Test: TH and ABTD
Change-Id: I28bccbbafbf9bcdf45a58361e37435b8d74d7464
2024-07-31 08:00:34 +09:00
Liana Kazanova
2426d49060 Merge "Revert "Conditionally pass kernel version to build.prop"" into main 2024-07-30 22:53:16 +00:00
Jihoon Kang
062eb663c5 Enable from-text stub generation in non-sdk java_sdk_library
This change allows from-text stubs to be generated for all
java_sdk_library modules, unlike how it is currently limited to the
modules that contribute to the api surfaces (i.e. the SDK).

This change accomplish this by modifying the dependency of the
from-text stubs generation, so that the sdk_library generated from-text
stubs generating java_api_library modules no longer depend on the full
api surface stubs, but generate the stubs in the module level, and
combined later to generate the full api surface stubs.

This change also removes the java_api_library modules defined in
core-libraries/Android.bp, which are passed to generate the system
modules. Given that the from-text vs from-source toggle is done within
the java_sdk_library stubs level, these modules no longer need to exist.

Implementation details:
- Allow sdk_version to be specified in java_api_library modules. For
  java_sdk_library-generated java_api_library modules, they inherit that
  of the sdk_library module. Some java_sdk_library modules that do not
  contribute to the api surface are allowed to set sdk_version to
  something other than "none" or "core".
- Implement java_api_library to implement `SdkContext`. This allows
  java_api_library to collect required deps from sdk_version (classpath,
  bootclasspath, system modules), and pass the collected jars when
  generating the stubs srcjar in metalava and compiling the stubs srcjar
  in javac.
- Remove hardcoded list of sdk_library modules that are allowed to
  genereate stubs from the api signature files, and allow from-text
  stubs generation by default. Modules that are not able to generate
  stubs from the api signature files are specified by setting the newly
  introduced `Build_from_text_stubs` property to `false`.

Test: ENABLE_HIDDENAPI_FLAGS=true m
Bug: 327507877
Change-Id: Ia35d2f3cf9fae48fc8c4bd99a84ae18d7c0e7bee
2024-07-30 22:35:06 +00:00
Yu Liu
8975548e9c Merge "Only add darwin specific rules/variables when building on mac." into main 2024-07-30 22:18:01 +00:00
Neill Kapron
50a7bf8610 Soong: BPF: Cflag and btf defaults
Currently, all bpf programs require a cflags field which defines -Wall
and -Werror. This change enables this by default, and also enables
-Wextra. This removes boilerplate required for every bpf program, and
improves code quality.

Additionally, this change enables the default of 'btf: true' further
reducing the boilerplate required for most bpf programs in their
Android.bp file. BTF should be enabled by default, with only limited
mainlined bpf programs requiring BTF being disabled for compatibility
with older bpfloader releases.

Test: Treehugger
Change-Id: I8efd0f63115030d40c0ff7fe81d5345ff3436e5a
Signed-off-by: Neill Kapron <nkapron@google.com>
2024-07-30 22:03:27 +00:00
Colin Cross
7707b246ef Don't hold on to WritablePath
Since only a single rule can write to a given WritablePath, it is
unecessary to hold on to the WritablePath once the rule has been
created.  Keeping a WritablePath causes complications, as it
prevents using the input Path as the output when no modifications to
the input file are necessary.  The normal pattern should be to create
a WritablePath using PathForModuleOut, build the rule that writes to
the WritablePath, and then store the WritablePath as a Path for use
as an input to any future rules.

WithoutRel previously only existed on OutputPath, which required
keeping the output path of the module as an OutputPath for as long
as possible in order to call WithoutRel on it at the end of the module.

Add WithoutRel to Path, make it always return a Path type, and implement
it on all the types that implement Path by using a helper in basePath.

Replace long-lived WritablePaths with Paths.

Test: all soong tests pass
Flag: EXEMPT refactor
Change-Id: I40f28075ce151e4be80d6cfc7ec173dfa46f9bbf
2024-07-30 14:46:13 -07:00
Treehugger Robot
6ae6f35d6c Merge "Make the prefer property configurable" into main 2024-07-30 21:46:07 +00:00
Ryan Prichard
d49f0868c3 Merge "Revert "Revert "Switch NDK libc++ from prebuilts/ndk to prebuilt..."" into main 2024-07-30 21:42:23 +00:00
Treehugger Robot
33128360bc Merge "Make stub_libs property configurable" into main 2024-07-30 21:34:47 +00:00
Taylor Santiago
ca30e08b9d Use consistent directory for source and output inside the build sandbox
for ABFS.

A consistent source directory addresses problematic full path inputs and
outputs, which can manifest as cache misses or build failures after an ABFS
patch application.

Bug: 347704053
Change-Id: Ib2297bb0b904b1b490e83c22fd468eee928e53fe
2024-07-30 13:52:31 -07:00
Cole Faust
12ff57d61c Make the prefer property configurable
To replace soong config modules with selects.

Bug: 342006386
Test: m nothing --no-skip-soong-tests
Change-Id: I56080c9a1647a072836d4e4e50d6a5d2c1a69d28
2024-07-30 13:17:28 -07:00
Cole Faust
aaff782cd6 Make stub_libs property configurable
To replace soong config module types with selects.

Bug: 342006386
Test: m nothing --no-skip-soong-tests
Change-Id: I76394c0c8e2bc98ec03a3a9d8cff0ba2af4ab0d1
2024-07-30 12:59:44 -07:00
Yu Liu
2c0327695c Only add darwin specific rules/variables when building on mac.
To support skipping ninja file writing during incremental build, we
add all the global rules/variable/pools from static sources because
when we restore from cache we don't have the build defs available to
build the globals. This means all the global rules and variables are
added blindly, so we need to exclude these darwin specific ones since
they will fail due to they depends on the tool that only exists on MAC.

Bug: 335718784
Test: local tests and CI
Change-Id: Ife835545f0f76ffaec77e48bdd89ab7384a1b995
2024-07-30 18:22:43 +00:00
Liana Kazanova
29fed1efe8 Revert "Conditionally pass kernel version to build.prop"
This reverts commit 036d9e6744.

Reason for revert: DroidMonitor: Potential culprit for b/356297315 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Change-Id: I58f1e43978eb812004d2e46fa7ce402e164d2800
2024-07-30 17:58:19 +00:00
Jerome Gaillard
44fc5bf548 Handle missing dependencies in ravenwood.go
This otherwise causes a crash when attempting any build
on macOS.

Test: build on macOS
Change-Id: Ib69160cd798091ae5f45416f332a0ea9927e1e50
2024-07-30 17:11:42 +00:00
Colin Cross
be891d5a52 Merge changes I5f2fd123,Ie8d8e229,Id2194f6b into main
* changes:
  Move RelativeToTop out of basePath
  Make PathForArbitraryOutput return an OutputPath
  Run TestClasspath subtests in parallel
2024-07-30 16:30:54 +00:00
Yaowen Mei
d4da266b35 Fix RBE tmp dir
The RBE tmp dir holds all the re-client logs and socket files.

Currently, it is being created as the `out/soong/.temp/` dir, which is auto deleted by Soong. This is causing problems because while a build is running, user cannot open a second terminal and run `lunch`.

This CL fixes the issue by creating the RBE tmp dir in the `out/soong/rbe/` directory. The next RBE build will clean this folder.


Bug: 349664018
Change-Id: Ib238e48f5b19755b016263b45f02b1be3e8efb35
2024-07-30 14:21:04 +00:00
Inseob Kim
e1234e51b8 Merge changes from topic "revert-3195812-revert-3195644-revert-3195637-revert-3184480-system_build_prop_soong-BZIDUTEOOC-KRUETCBWUR-TUHZPHUVFJ-XYILSUPUOA" into main
* changes:
  Conditionally pass kernel version to build.prop
  Revert^4 "Use Soong-built system/build.prop"
  Revert^4 "Sync gen_build_prop.py to sysprop.mk"
  Revert^4 "Add TARGET_SYSTEM_PROP to system build.prop"
  Revert^2 "Set output for build_prop even on Soong only build"
2024-07-30 03:51:03 +00:00
Ryan Prichard
2a69eb6573 Revert "Revert "Switch NDK libc++ from prebuilts/ndk to prebuilt..."
Revert submission 3198506-revert-3195358-ndk-libcxx-UOZAIZERUU

Reason for revert: reland topic

Reverted changes: /q/submissionid:3198506-revert-3195358-ndk-libcxx-UOZAIZERUU

Bug: http://b/332594828
Test: treehugger
Change-Id: I9c11fd697cd35bdd1d6b679cb2e2fff239de272c
2024-07-30 02:07:15 +00:00
Treehugger Robot
77cd0a0080 Merge "Introduce build_from_text_stubs property in java_sdk_library" into main 2024-07-29 23:13:52 +00:00
Liana Kazanova
8effb623fd Merge "Revert "Switch NDK libc++ from prebuilts/ndk to prebuilts/clang"" into main 2024-07-29 23:05:00 +00:00
Liana Kazanova
08d5d260db Revert "Switch NDK libc++ from prebuilts/ndk to prebuilts/clang"
Revert submission 3195358-ndk-libcxx

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

Reverted changes: /q/submissionid:3195358-ndk-libcxx

Change-Id: Ic9cd3d30637d5ac187d3fc80b34d45083f37064e
2024-07-29 22:58:39 +00:00
Jihoon Kang
48e2ac926b Introduce build_from_text_stubs property in java_sdk_library
Note that this property is currently a no-op. This change is submitted
separately in order to prevent submitting the entire topic in git_main
to mark a main-only module with this property.

Test: m nothing
Bug: 327507877
Change-Id: I62c2e3522bf9d0c5f7955e7c9bd2e0f66458e48c
2024-07-29 21:38:11 +00:00
Colin Cross
bd73d0db41 Move RelativeToTop out of basePath
RelativeToTop is documented as returning the same concrete type that was
passed in, which wasn't true for SourcePath.  Implement it in SourcePath
and delete it from basePath.

Test: all soong tests pass
Flag: EXEMPT refactor
Change-Id: I5f2fd1237b964aa10565f7c6b34122dd6972fda9
2024-07-29 14:00:46 -07:00
Colin Cross
3b1c6847c4 Make PathForArbitraryOutput return an OutputPath
The only place basePath is used as a Path is when being returned from
PathForArbitraryOutput.  Using it as a Path requires implementing the
RelativeToTop() method on it, which then allowed that method to be
inherited by SourcePath, breaking the contract on RelativeToTop that
specifies that the returned Path is of the same concrete type as the
input Path.

Make PathForArbitraryOutput return an OutputPath, and update OutputPath
to support base paths that are not out/soong.  This also fixes
RelativeToTop, which was previously not working for PathForArbitraryOutput
paths.

Test: all soong tests pass
Flag: EXEMPT refactor
Change-Id: Ie8d8e2290961f35280e97137d2bd641c4d57ab87
2024-07-29 14:00:46 -07:00
Colin Cross
e0aa52f6c7 Run TestClasspath subtests in parallel
Call t.Parallel() to make the subtests of TestClasspath run in
parallel, which drops the runtime from 12 seconds to 1.7 seconds.

Test: TestClasspath
Flag: EXEMPT refactor
Change-Id: Id2194f6b5f925b480280e9cf8da5d5767a467430
2024-07-29 14:00:46 -07:00
Treehugger Robot
ea6451a03a Merge "Fix run_tool_with_logging_test in CI" into main 2024-07-29 20:57:46 +00:00
Treehugger Robot
c6f1fe0861 Merge "Cleanup configurable getter usages" into main 2024-07-29 20:49:06 +00:00
Ryan Prichard
02d80236a3 Merge "Switch NDK libc++ from prebuilts/ndk to prebuilts/clang" into main 2024-07-29 20:46:39 +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