Commit Graph

8694 Commits

Author SHA1 Message Date
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
Krzysztof Kosiński
28b806c9eb Merge "Add missing pieces of ARMv9.2-A support." into main 2024-09-11 16:04:44 +00:00
Neill Kapron
f1d63b8b6d Merge "SOONG: BPF: add libbpf_prog soong module" into main 2024-09-11 15:41:14 +00:00
Jim Tang
01c3234190 Merge "Support apk for product_variables.debuggable" into main 2024-09-11 02:56:11 +00:00
Cole Faust
dd46300414 Merge "Remove BUILD_BROKEN_USES_SOONG_PYTHON2_MODULES" into main 2024-09-10 19:33:04 +00:00
Jim Tang
914832444e Support apk for product_variables.debuggable
Bug: 365707065
Test: m FactoryOtaPrebuilt
Change-Id: I880b9d48b52d49cbf8c1eca6a67d3ffadc8ea0fc
2024-09-10 18:06:22 +08:00
Cole Faust
4ce4f8893e Remove BUILD_BROKEN_USES_SOONG_PYTHON2_MODULES
It's been available for over a year, lets progress the python3 migration
by removing it.

Bug: 203436762
Test: Presubmits
Change-Id: I46a6477ec65e98b7e6df5cc1359f676dcbd0f08e
2024-09-09 18:08:49 -07:00
Spandan Das
ca9ccec822 Remove extra space in error message
Change-Id: I45420afc37736ec8fecd0c489c35c14b377a71a5
Test: N/A
2024-09-09 22:58:11 +00:00
Krzysztof Kosiński
b8c5e95e26 Add missing pieces of ARMv9.2-A support.
aosp/3255916 didn't add all of the required infrastructure.
Refactor it to be more like x86_64 so it requires less
boilerplate code.

Bug: 364383722
Test: presubmit
Change-Id: Idc5279ffc5fe964bea9f98873c01468944d90091
2024-09-07 03:11:25 +00:00
Xin Li
aa8ceca851 Merge "Merge 24Q3 to AOSP main" into main 2024-09-07 01:12:30 +00:00
Treehugger Robot
f2c204c655 Merge "Remove asset dir glob files" into main 2024-09-06 16:22:06 +00:00
Colin Cross
399ff4019d Merge "Use transitive header jars in classpaths" into main 2024-09-06 16:19:41 +00:00
Treehugger Robot
fae5ec8bbc Merge changes I505a7ad8,I92d88199 into main
* changes:
  Disable source apex variant using apex_available_name
  Skip `contents` validation of source bootclasspath fragments
2024-09-06 06:07:42 +00:00
Spandan Das
003452ff9c Disable source apex variant using apex_available_name
There are two versions of aosp extservices - one for Tplus and one for
Sminus. When prebuilts are active, the `contents` validation of both
variants of extservices bootclasspath fragments should be disabled to
account for BCP jar skew.

This CL adds ApexAvailableName to ApexInfo to achive that. If an
api_domain matching the ApexAvailableName has been selected in
`all_apex_contributions`, the source apex variants will be disabled.

Bug: 361771739

Test: lunch cf_x86_64_phone-next-userdebug
Test: m nothing with ag/28851886
Change-Id: I505a7ad8295c258e2eeef7f183669f7a75a1c88e
2024-09-06 05:10:41 +00:00
Treehugger Robot
4301e29a02 Merge "Revert "Revert "Support BUILD_FRAMEWORK_COMPATIBILITY_MATRIX for..."" into main 2024-09-06 00:48:26 +00:00
Cole Faust
6265120cd2 Remove asset dir glob files
I'm rewriting how globs work in soong to make them compatible with
hash-based ninja implementations. As part of this, I'm removing this
unnecessary usage of globs to make them simpler.

In this case, since we're already globbing the directory at analysis
time and causing soong to rerun, we can ensure the aapt2 action also
reruns by putting a hash of the glob results onto the command line.

Bug: 364749114
Test: m framework-res, touch frameworks/base/core/res/assets/test1.txt, m framework-res rebuilt framework-res.apk, rm frameworks/base/core/res/assets/test1.txt, m framework-res rebuilt framework-res.apk again
Change-Id: I4f666367a9a0fd0dfa42dc51ef3a788a02b41747
2024-09-05 16:36:32 -07:00
Neill Kapron
41efab77d0 SOONG: BPF: add libbpf_prog soong module
This commit adds the libbpf_prog soong module which is heavily based on
the bpf soong module. Due to issues encountered and concerns around
compatibility and testability of mainlined bpf modules, support for
libbpf is added as a separate module.

Specifically, when changing the bpf module from
InitAndroidArchModule(... android.MultilibCommon) to MultilibFirst, the
soong apex bpfs functionality breaks. We have not identified a good
mechanism to fix this, and as we would then be creating architecture
specific bpf program binarys, additional testing and infrastructure
would be required.

It should be noted that libbpf_prog should not be used for features
which target 32bit kernel architectures at this point, as we do not
have a mechanism to identify the kernel arch at build time. I.E. 32bit
userspace could be on either 32bit or 64bit kernel arch, and we require
arch specific includes (vmlinux.h). Therefore, we default to 32bit
userspace on 64bit kernel to match the precedence set with the legacy
bpf programs.

Example use:
libbpf_prog {
    name: "xyz.o",
    srcs: ["xyz.c"],
    arch: {
        arm: {
            local_include_dirs: ["vmlinux/arm64"],
        },
        arm64: {
            local_include_dirs: ["vmlinux/arm64"],
        },
        x86: {
            local_include_dirs: ["vmlinux/x86_64"],
        },
        x86_64: {
            local_include_dirs: ["vmlinux/x86_64"],
        },
    },
}

Bug: 359646531
Test: manual
Change-Id: Ie58515d70abee061470cf4bb803228e00d496ac3
Signed-off-by: Neill Kapron <nkapron@google.com>
2024-09-05 22:37:19 +00:00
Krzysztof Kosiński
6126b6792f Merge "Add ARMv9.2-a arch option." into main am: b379955f0e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3255916

Change-Id: I38a8a9a214f4e3f22a9665591eb4f723f72889b3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-05 14:48:09 +00:00
Krzysztof Kosiński
b379955f0e Merge "Add ARMv9.2-a arch option." into main 2024-09-05 14:45:17 +00:00
Bill Yang
3b3aac0088 Revert "Revert "Support BUILD_FRAMEWORK_COMPATIBILITY_MATRIX for..."
Revert submission 3235656-revert-3195743-compatibility_matrix-KLJOLWYIMW

Reason for revert: The root cause of the break is already be merged. Related changes: ag/29139095, ag/29139608

Reverted changes: /q/submissionid:3235656-revert-3195743-compatibility_matrix-KLJOLWYIMW

Change-Id: Ie23bdd343bebbd077553dc25f0bfd13539daf57a
2024-09-05 09:22:10 +00:00
Yi Kong
c36f81ee41 Merge "Remove workaround for coverage boot failure" into main am: acde746439
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3239200

Change-Id: I78687e68c6fe24517c033bdda37035d1f3a160d5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-05 07:11:05 +00:00
Yi Kong
acde746439 Merge "Remove workaround for coverage boot failure" into main 2024-09-05 07:01:45 +00:00
Treehugger Robot
8a9aaa566b Merge "Add VINTF fragment modules into required libs of modules-info" into main am: a136147c9c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3249931

Change-Id: Ida2da7f30b8a438b599c938b1830969c8cc76e1b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-05 01:54:53 +00: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
Colin Cross
c9b4f6b502 Use transitive header jars in classpaths
Skip combining jars into turbine-combined, combined, and withres jars
and instead collect transitive jars to use in the classpath and to
produce the final dexed jar.

This reduces the size of a `m checkbuild` in git_main by 11%, from
1300 KiB to 1154 KiB.  It may also improve caching and reduce uplink
network bandwidth when building with RBE, as now the classpath inputs
to rules are themselves outputs of previous rules and so already in
the RBE CAS.

The downside is that the classpath inputs to each rule are now much
longer, increasing the Soong ninja file size 11%, from 4.6 GiB to
5.1 GiB.  This could be mitigated in the future by supporting something
like depsets in the generated ninja file to reduce duplication.

Bug: 308016794
Test: TestSimple, TestKotlin, TestClasspath
Flag: build.RELEASE_USE_TRANSITIVE_JARS_IN_CLASSPATH
Change-Id: I2b7b4261375494370da70f98597c8719f1d561cf
2024-09-04 16:13:46 -07:00
Yu Liu
246315e4fd Merge "Move the caching/restoring code from soong to blueprint to fully skip build actions." into main am: c55b25f125
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3249489

Change-Id: I43e2ee71097e95e313eab8631742acb8048e36d4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-04 22:07:50 +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
Krzysztof Kosiński
918d265a06 Add ARMv9.2-a arch option.
Bug: 364383722
Test: presubmit
Change-Id: Ica7266f6dbac490836f94f7e19685383aba2749f
2024-09-04 21:25:05 +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
Steven Moreland
092389231f Merge changes from topic "libbinder_ndk-remove-cpp-headers" into main am: 56aed2b0e8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3251042

Change-Id: Ib543856a377c18f68a8bb5cad585bc787b04e5c0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-04 18:33:08 +00:00
Steven Moreland
56aed2b0e8 Merge changes from topic "libbinder_ndk-remove-cpp-headers" into main
* changes:
  ndk_library: limit exports
  Reland "Truely re-export export_header_libs from ndk_library"
  ndk_library depends on the correct arch variant of cc_library_headers
2024-09-04 18:23:19 +00:00
Colin Cross
5f0561e24d Merge "Move checkbuild targets of Soong modules into Soong" into main am: ca3bf2be39
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3237626

Change-Id: Id72a093f81785ece92211cc63a73c0a53576fb7b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-04 17:15:12 +00:00
Colin Cross
ca3bf2be39 Merge "Move checkbuild targets of Soong modules into Soong" into main 2024-09-04 17:12:03 +00:00
Cole Faust
dcb8494f44 Merge "Add tests for configurable PostProcessors" into main am: b9e7915f6f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3247538

Change-Id: I4803d6148c6ed949a2b5a1c7aecf79fc80ec2a49
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-04 17:00:58 +00:00
Cole Faust
b9e7915f6f Merge "Add tests for configurable PostProcessors" into main 2024-09-04 16:49:32 +00:00
Treehugger Robot
cc0bc1b3f9 Merge "Sandbox environment variables" into main am: 2f33c04a97
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3245994

Change-Id: I2af033a7fbbef8928553efffe79b26d55d36e96a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-04 02:31:56 +00:00
Treehugger Robot
2f33c04a97 Merge "Sandbox environment variables" into main 2024-09-04 02:26:58 +00:00
Jiyong Park
c299c20911 Merge "Make overrides work in Soong" into main am: b11c99d084
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3241433

Change-Id: Idff2325ba6387c43ffcfc2ec1403d2ec9f782aae
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-04 00:07:03 +00:00
Jiyong Park
b11c99d084 Merge "Make overrides work in Soong" into main 2024-09-04 00:03:20 +00:00
Cole Faust
63ea1f966e Sandbox environment variables
So that the build can't access extra information unintentionally.
Particuarly ANDROID_BUILD_TOP is dangerous.

In the future PATH should be locked down as well.

Bug: 307824623
Test: Added a all_genrules target and built that
Change-Id: I88bb0efb0a82529a1c85875a53cf20c8384d07fe
2024-09-03 16:38:28 -07:00
Steven Moreland
0db999c45e ndk_library: limit exports
The NDK should stand alone, and the libbinder_ndk case
is created because libbinder_ndk in the NDK used to
contain extra C++ headers, but these were moved into
the SDK to be next to AIDL. Since many modules depend
on these headers, exports are only allowed for this case.

Bug: 357711733
Test: build with neverallow breaking, for instance:

error: frameworks/wilhelm/Android.bp:56:1: module "libOpenSLES.ndk" variant "android_x86_64_silvermont_sdk_shared_21": violates neverallow requirements. Not allowed:
        module types: ["ndk_library"]
        properties matching: "Export_header_libs" matches: .is-set
        EXCEPT in dirs: ["frameworks/native/libs/binder/ndk/"]

Change-Id: I9a32d3cb7f644fb5dbc1e8072894f2f585b2cd6d
2024-09-03 23:03:37 +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
Spandan Das
ed93a620c6 Merge "HideFromMake in apexTransitionMutator should respect special cases" into main am: c965be6ca2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3249488

Change-Id: I4911340085cb4e41229a81875ff27c24c61a04ac
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-03 16:38:07 +00:00
Spandan Das
c965be6ca2 Merge "HideFromMake in apexTransitionMutator should respect special cases" into main 2024-09-03 16:32:29 +00: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
Yi Kong
0111a27449 Remove workaround for coverage boot failure
Bug: 269981180
Change-Id: I81399836b588b7a579174b1b6700341d7108d49e
2024-09-02 07:32:41 +00:00
Spandan Das
afa3add57e HideFromMake in apexTransitionMutator should respect special cases
At ToT, platform variants of modules are hidden from make, unless the module
has `//apex_available:platform` in its Android.bp file. However, there
are special cases which always require the platform variant to be
visible to make - e.g. bootstrap bionic libraries.

`markPlatformAvailability` handles these special cases. This CL updates
the subsequent apexTransitionMutator to hide the platform variant when
module.NotAvailableForPlatform is true in addition to the existing
module type specific `AvailableFor` check

Test: no diff in file_list.txt
Bug: 281077552
Change-Id: Ie9d7341e206276ff96d3d64fec21b8f5dcfd6ceb
2024-08-31 02:26:35 +00:00
Jihoon Kang
9e40f8f9b4 Merge "Revert^4 "Implement detecting container violations."" into main am: 7344482ff3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3248019

Change-Id: I440053bd684fa56172b82b4012348bd0a93e84c5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-30 20:21:28 +00:00
Jihoon Kang
7344482ff3 Merge "Revert^4 "Implement detecting container violations."" into main 2024-08-30 20:18:53 +00:00
Cole Faust
b93f7fe73c Add tests for configurable PostProcessors
Bug: 362579941
Test: m nothing --no-skip-soong-tests
Change-Id: Iaaff66844ebe0b2fb19148bd07562785b12cd7e9
2024-08-30 13:04:37 -07:00