Commit Graph

8707 Commits

Author SHA1 Message Date
mrziwang
2aafdc5f9c Create a singleton that generates an empty bp file
This singleton will be used to generate a bp file based on
make-based product config later.

Test: m and CI
Bug: 367418637
Change-Id: I98caea5419f1facd3fa9ca5c6389d16a7aa2ce5d
2024-09-17 14:56:43 -07:00
Cole Faust
d706709bf0 Prevent evaluating configurable properties before the defaults mutator
So that we can change the configuration after the defaults mutator
has run.

Bug: 361816274
Test: Presubmits
Change-Id: I550088b2555d275a86b5dd4d57e85a9ece859233
2024-09-13 13:37:59 -07:00
Dennis Shen
01efb83420 Treat system_ext as system container
Bug: b/365135457
Test: m
Change-Id: Ic8fd60c0e1045f190b6608931ca1d65a784026f0
2024-09-12 23:31:49 +00:00
Cole Faust
8eeae4bbbe Don't evaluate the enabled property in a defaultable hook
So that we can decide the configuration after defaults are evaluated.
Instead, pass the enabled property on to submodules.

Bug: 361816274
Test: m nothing --no-skip-soong-tests
Change-Id: I853d557ed022f7434287cea0a2a19e684b59e145
2024-09-12 11:51:04 -07:00
Treehugger Robot
167230037c Merge "Introduce a util method PrettyConcat" into main 2024-09-12 17:10:11 +00:00
Colin Cross
1496fb1675 Wrap blueprint_go_binary and bootstrap_go_package into android.Modules
Depending on a blueprint_go_binary from a Soong module requires hacks
that allow Soong to support both blueprint.Module and android.Module.
Wrap the blueprint Go module types with ones that implement
android.Module, and delete all the related hacks.

Bug: 319288033
Test: m checkbuild
Flag: EXEMPT refactor
Change-Id: I9b62b450de09bd10288333fbc66aa71c867ae0b3
2024-09-11 21:16:25 -07:00
Treehugger Robot
6fab06d56b Merge "Soong system image may update the $PRODUCT_OUT" into main 2024-09-12 00:25:21 +00:00
Jihoon Kang
6e0280d795 Introduce a util method PrettyConcat
The method can be used when printing string list in a well-formated way
in user-facing messages.
This will be used in a follow up change.

Test: m nothing --no-skip-soong-tests
Change-Id: I77e3445a5333f82067dd8f1bb6ad892c69754ece
2024-09-12 00:11:34 +00:00
Cole Faust
7351875acb Merge "Add HasMutatorFinished" into main 2024-09-12 00:02:10 +00:00
Zi Wang
6ad2e30de3 Merge "Add framework for using provider on AndroidMKEntries" into main 2024-09-11 23:02:33 +00:00
Cole Faust
4e2bf9fb2d Add HasMutatorFinished
To enforce that selects are only evaluated after a certain point
in a followup cl.

Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: Ib215fedb904aa2e5f4d65cfd26a23f527eb4983e
2024-09-11 14:48:50 -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
mrziwang
1842097928 Add framework for using provider on AndroidMKEntries
In the context of incremental soong, the inter-module communication
through AndroidMkEntries and AndroidMkData should be changed to
through the real provider.

This change adds the framework for the provider(AndroidMkInfoProvider).
A module will set its AndroidMkInfoProvider, which includes what's
in its AndroidMkEntries method, to be used in translateAndroidMkModule.

This change also changes module type vbmeta to use
AndroidMKInfoProvider.

The next step is to replace the AndroidMkEntries methods of all the
other module types to set the AndroidMkInfoProvider.

Test: m with tests and CI
Bug: 357907638
Change-Id: Icfd1363f97d31548bb78c6615e0f7076b22dcbe4
2024-09-11 10:38:41 -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
Justin Yun
2cc42505d9 Soong system image may update the $PRODUCT_OUT
A target must define "USE_SOONG_DEFINED_SYSTEM_IMAGE := true" and
"PRODUCT_SOONG_DEFINED_SYSTEM_IMAGE := <name of soong system image>"
to use the soong defined system image.
The system image must install the files to $PRODUCT_OUT for adb sync
and build verification. Instead of using 'update_product_out'
property in Android.bp, copy the files only if the name of the image
matches with PRODUCT_SOONG_DEFINED_SYSTEM_IMAGE.

Bug: 350599535
Bug: 365700376
Test: lunch aosp_x86_64-trunk_staging-userdebug && m &&
      m aosp_cf_system_x86_64
Test: lunch aosp_cf_x86_64_phone_soong_system-trunk_staging-userdebug
      && m
      and adb sync on the cf device
Change-Id: If8673ba2855a753a5559a588bd83068d950fd7e4
2024-09-11 14:34:44 +09: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