Commit graph

5179 commits

Author SHA1 Message Date
Paul Duffin
2178762a8a Remove SdkAware.SdkMemberComponentName
That method was provided to allow a java_sdk_library_import that was
part of a versioned sdk snapshot to create the name of its component
modules consistent with the way in which modules were named within the
sdk snapshot. As versioned sdk snapshots have all been removed this is
no longer necessary.

Bug: 260237150
Test: m nothing
Change-Id: Iee35abd6d210d9a33dfd8ef2f9c77a53329fda24
2022-12-12 17:33:06 +00:00
Paul Duffin
5e71e68a82 Replace usages of SdkAware in sdk module with Module
Previously, the sdk snapshot code used SdkAware instead of Module to
ensure that all its members had implemented SdkAware. However, it never
used any of the methods provided by SdkAware, or if it did it no longer
does. So, this change replaces usages of SdkAware with Module in
preparation for deleting it completely.

Bug: 260237150
Test: m nothing
Change-Id: Ia89e02394f27b2da776f0cf0f0bc86835a03433a
2022-12-12 17:33:06 +00:00
Paul Duffin
458a15bd8a Remove IsModuleInVersionedSdk
Previously, as all versioned sdk snapshots have been removed from
Android.bp files this method would always return false. This change
effectively replaces all calls to it with false, and then optimizes
away any unused code.

Bug: 260237150
Test: m nothing
Change-Id: I1b717ee8345e807bd888451f6e7e3c3a0d391ee2
2022-12-12 17:33:05 +00:00
Cole Faust
8ec823cba1 Allow adding extra tradefed options in the Android.bp file
Some tests need to add custom tradefed options, but still want to
keep most of the soong autogenerated tradefed xml file.

Expose a test_options: { tradefed_options: [...] } property that
will allow tests to add more options to the autogenerated xml file.

Fixes: 184895128
Test: go test, and verified that the ninja files did not change for aosp_arm64
Change-Id: I75f7eb002c8325ce7cdc76e12e76e16195320620
2022-12-09 15:23:26 -08:00
Colin Cross
20c89f1adf Add external/musl to the bp2build allowlists
Add external/musl to the bp2build allowlists.  Disable libc_musl_sysroot,
which fails due to a $(locations) reference to a glob that is
unsupported in bazel.

Bug: 259266326
Test: //external/musl:libc_musl builds
Change-Id: Icf0ea2f89854ba3605096dcaa95c1c829af34dc3
2022-12-09 13:58:58 -08:00
Treehugger Robot
b8422f4223 Merge "Add adbd to staging allowlist" am: 3784d14404 am: b0208fb5c7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2336162

Change-Id: If61f121e0b5428bea8d2b0801b66ee4c00449d4d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-08 22:48:59 +00:00
Chris Parsons
9f0e552bb9 Add adbd to staging allowlist
Bug: 254081374
Test: lunch aosp_arm64 && m --bazel-mode-staging
Test: Manual inspection of `ninja -f out/combined-aosp_arm64.ninja -t commands com.android.adbd | grep "bazel"` after the above command
Change-Id: Ic5a553e1442b22ad2a57456d34cbec6a14e8a950
2022-12-08 14:34:32 -05:00
Treehugger Robot
70d9855cfb Merge "Streamline NewBazeContext code" am: 41ec4e6548 am: 17d64e538a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2331702

Change-Id: Ib96d53bdafc5ac2eba7c0e60bc3f35095bfd2d0c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-07 19:41:19 +00:00
Treehugger Robot
41ec4e6548 Merge "Streamline NewBazeContext code" 2022-12-07 19:11:49 +00:00
Sorin Basca
bc1cb99891 Merge "Remove unused rules for platform-robolectric-4.5.1-prebuilt" am: 50e007643b am: 7e05636029
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2329898

Change-Id: Ieeecd4e0758c593e5c5812ebd5833f5d64fbe926
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-07 12:40:57 +00:00
Sasha Smundak
dc87f2db0e Streamline NewBazeContext code
Test: treehugger
Change-Id: I707636fef70d35dcb29796d3faed2168bf5adb15
2022-12-06 20:29:28 -08:00
utzcoz
682bc9d4c9 Remove unused rules for platform-robolectric-4.5.1-prebuilt
platform-robolectric-4.5.1-prebuilt was removed by
https://android-review.googlesource.com/c/platform/prebuilts/misc/+/2314082,
and soong's special rules for platform-robolectric-4.5.1-prebuilt
is not needed anymore.

Test: m

Signed-off-by: utzcoz <utzcoz@gmail.com>
Change-Id: I953ec775505ccd0924f5a3f7fc29bdc7e573d335
2022-12-06 21:43:17 +08:00
Spandan Das
09ccdb9eaa Merge "Register singletons in api_bp2build" am: c74bf95708 am: 16909873a3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2322299

Change-Id: I95683c6dc38f95fcfbf99abded5df482c4dac144
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-06 02:03:50 +00:00
Spandan Das
c74bf95708 Merge "Register singletons in api_bp2build" 2022-12-06 00:57:06 +00:00
Spandan Das
bd7850f20e Create a new product variable to gate blueprint files am: c576383336 am: ff5b89e55d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2297118

Change-Id: I2da17a8f4c06a4b1bd3b1a124006ecaa1fb53b20
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-06 00:50:21 +00:00
Spandan Das
75e139b50e Register singletons in api_bp2build
Singleton modules are not used in this workspace (they do not implement
`ConvertWithApiBp2build`). However, we still need to add them since
there is a check in `SingletonModuleFactoryAdaptor` that depends on the
singletons being registered. We do this for bp2build as well (see
`RegisterForBazelConversion`)

This was probably always an issue in api_bp2build, but became
incompatible as a side-effect of the refactoring in aosp/2287719
that removed ctx.Register() from the newContext function.

Test: m api_bp2build --skip-soong-tests
Change-Id: I9ba1df2cc1e8ec916635e5280c66f8df68d7e79b
2022-12-05 22:27:06 +00:00
Spandan Das
c576383336 Create a new product variable to gate blueprint files
Users can use this feature by
1. Setting PRODUCT_INCLUDE_TAGS += <val> in their product mk files
2. Set
```
blueprint_packge_includes {
  match_al: ["<val>"],
}

other_module_type {name: foo}
other_module_type {name: bar}
```

bar and foo will be included if and only if <val> is set

Test: Unit tests in blueprint
Test: TH

Change-Id: I32eed4e3b5ac47fb565c62d13d8881fa984c86f4
2022-12-05 19:15:06 +00:00
MarkDacek
fe065a19f4 Add command line flag for extra bazel-built modules am: d06db5dd5b am: ad4560237e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2320576

Change-Id: Icbdd13a5676a4ba2681af32413e5b06eeb1f8bde
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-02 23:00:02 +00:00
MarkDacek
d06db5dd5b Add command line flag for extra bazel-built modules
Test: m libcore --bazel-mode-staging --bazel-force-enabled-modules=libcore and find out/bazel/ -name libcore*

Change-Id: I065696d06ce07e05300a41e133867a6e7a891b5e
2022-12-02 21:16:11 +00:00
Paul Duffin
a59846ccbd Merge "Support running bp2build tests in fixtures" am: de47ec777f am: b4c2b782d0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2281252

Change-Id: I74ee5cddc1dbe4b20fc7580c801f6e3feb48e1f1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-02 17:04:08 +00:00
Treehugger Robot
f4c850bb1a Merge changes Ia4016240,Iba586155 am: a36589c4ca am: 1ed3a7a0f7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2309617

Change-Id: I43eb1f0948db5b3de6bdc3a593549df206718f7c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-02 11:49:46 +00:00
Paul Duffin
4c0765a669 Support running bp2build tests in fixtures
Previously, the fixture test infrastructure was hard coded to
initialize itself in preparation for invoking the PrepareBuildActions()
method. That meant it could not be used for testing the bp2build and
apiBp2build modes which required different initialization and called a
different method.

This change extracts that behavior into a FixtureTestRunner and adds an
implementation that allows it to test the above two modes. It then uses
that to implement the runBp2BuildTestCaseWithSetup method.

The TestPrebuiltLibraryAdditionalAttrs was the only test which broke as
it supplied an invalid path to the MockFS (it does not support using a
trailing / to represent an empty build directory). So, it was modified
to add a couple of files inside those directories instead.

Test: m nothing
Change-Id: I6798a4f761160af8d1bfed81d46de9628bda3eb9
2022-12-02 11:14:17 +00:00
Treehugger Robot
a36589c4ca Merge changes Ia4016240,Iba586155
* changes:
  Allow choosing which soong_build invocations to run in the debugger
  Show module type in a module section of the Android-TARGET.mk
2022-12-02 10:36:07 +00:00
Jingwen Chen
73c3171859 Merge "Convert apex_available (for supported modules) to bazel tags." am: 8ec23f846d am: 9867290c71
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2321580

Change-Id: I5755b47b6d486b137da60d1f2251d48737d1b49e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-02 08:12:33 +00:00
Jingwen Chen
8ec23f846d Merge "Convert apex_available (for supported modules) to bazel tags." 2022-12-02 07:22:10 +00:00
Sasha Smundak
5c4729df93 Show module type in a module section of the Android-TARGET.mk
The first line of each section will be
```
include $(CLEAR_VARS)  # <module type>
...
```

Bug: 257037252
Test: treehugger
Change-Id: Iba586155b682fe4e1e5817d8397eda8f9d9c8789
2022-12-01 21:12:11 -08:00
Treehugger Robot
d405dffd7c Merge "Print error code when bazel invocation fails" am: 591c5ee0fb am: 33738d9c0e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2323957

Change-Id: Iccc71f415493bcd8dce337c1c6a48769e6f32828
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-02 01:18:36 +00:00
Treehugger Robot
591c5ee0fb Merge "Print error code when bazel invocation fails" 2022-12-02 00:10:02 +00:00
Liz Kammer
8532b38022 Merge changes Ia165e4be,I63fe74fb am: f843436455 am: f9420ac643
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2260886

Change-Id: I7cb7bdd7d7f315741f070ec4457e6a78b8079173
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-01 23:05:24 +00:00
Liz Kammer
f843436455 Merge changes Ia165e4be,I63fe74fb
* changes:
  Update sanitize to not modify user properties
  Extend sanitize_test.go
2022-12-01 22:10:18 +00:00
Sasha Smundak
0e87b186cb Print error code when bazel invocation fails
Also, fix compiler warnings about deprecated ioutil.WriteFile/ReadFile
and about redundant variables

Test: treehugger
Change-Id: Iaf8f89b0e991dae8c5da403d4a1ec3a270f1ae29
2022-12-01 13:37:48 -08:00
Kevin Dagostino
e8b08ce5e3 Merge "Use existing BUILD files for test-related tools." am: dfc72a8ca2 am: 2090f1104c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2309887

Change-Id: I94b0128f2d992842f51bc8676cc16b3c8ab68000
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-01 08:32:58 +00:00
Kevin Dagostino
dfc72a8ca2 Merge "Use existing BUILD files for test-related tools." 2022-12-01 07:32:59 +00:00
Jingwen Chen
c4c34e1eab Convert apex_available (for supported modules) to bazel tags.
The tags will then be read by an aspect applied from apex attributes to
validate that the deps are explicitly opt-in to the appropriate apex.

The semantics of this is the same as the Soong apex_available property.

This also adds the "base_apex_name" attr to override_apex conversion so
that apex_available checks continue to work on the non-Google and non-Go
apex names.

Test: presubmits
Fixes: 218841706
Change-Id: I19b3637da9aa47573b252d74f62b601fbdc3784d
2022-12-01 06:25:25 +00:00
Christopher Parsons
d7e43c20d6 Merge "Revert "Revert "Add tzdata do the Bazel mixed build prod mode allowlist.""" am: e2da96f892 am: 2487ea1f52
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2320454

Change-Id: Icd43930bb3de3e33571ad12d22a0fe6d90806643
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-30 20:57:11 +00:00
Sam Delmerico
043565cbde Merge "fallback to nonmixed builds for unsupported builds" am: d0b3cd0733 am: 350f6df957
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2302774

Change-Id: I17a5db3ff57e8ed188f909ce453c52f361194ff9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-30 20:24:29 +00:00
Christopher Parsons
e2da96f892 Merge "Revert "Revert "Add tzdata do the Bazel mixed build prod mode allowlist.""" 2022-11-30 20:02:52 +00:00
Sam Delmerico
d0b3cd0733 Merge "fallback to nonmixed builds for unsupported builds" 2022-11-30 19:40:59 +00:00
Yu Liu
d88efc5548 Merge "Support abi check in bazel." am: 734fefdf90 am: 67841b7226
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2300265

Change-Id: I89680dfd0aa497c74eb483ca403967dccdfcaaea
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-30 18:45:27 +00:00
Treehugger Robot
f9e5636c1b Merge "Add more cases to vendor-installed module" am: d0cd326415 am: 92b787bb3f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2319850

Change-Id: If84c80687f795067fa6609d21f014e14f84f27ed
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-30 18:13:36 +00:00
Yu Liu
734fefdf90 Merge "Support abi check in bazel." 2022-11-30 17:57:42 +00:00
Treehugger Robot
d0cd326415 Merge "Add more cases to vendor-installed module" 2022-11-30 17:19:25 +00:00
Christopher Parsons
ff4cceb7bc Revert "Revert "Add tzdata do the Bazel mixed build prod mode allowlist.""
This reverts commit f8ab0321e3.

Reason for revert: Fixed underlying bugs (aosp-riscv and llvm breakages)

Change-Id: Ib7fe8e39af5bbe40bac615c815307ad9f05e83d3
2022-11-30 15:44:15 +00:00
Sam Delmerico
5150d0d309 fallback to nonmixed builds for unsupported builds
Bug: 253664931
Change-Id: I8026d0412b8dd62f55edf776f72747209ce2e955
2022-11-30 10:36:48 -05:00
Treehugger Robot
68c6270955 Merge "Revert "Allowlist build files in external/python/absl-py"" am: f219c0fc87 am: 7f61a3b638
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2322224

Change-Id: I3825bcb5fc27cadf98174eb3a0e72c3f49455eed
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-30 08:50:23 +00:00
Treehugger Robot
f219c0fc87 Merge "Revert "Allowlist build files in external/python/absl-py"" 2022-11-30 07:47:26 +00:00
Kevin Dagostino
3e2da94e2d Use existing BUILD files for test-related tools.
Allowlist BUILD files of test-related tools so that they appear in the final bp2build workspace. This is required for Bazel test rules that are dependent on these projects.

Test: b build //prebuilts/runtime/... //tools/asuite/atest:atest-tradefed  //tools/asuite/atest/bazel/reporter/...
Change-Id: Ie34658706efe6ca7657c935528df8daef61bfc0c
2022-11-30 06:07:59 +00:00
Cole Faust
762c2def20 Revert "Allowlist build files in external/python/absl-py"
Revert submission 2308141-colefaust_run_b_from_out_folder

Reason for revert: Breaks CI due to more instances of the bazel shutdown issue
Reverted Changes:
I51c28e232:Allowlist build files in external/python/absl-py
I9e6530d95:Cd into the bazel workspace instead of using --pac...

Change-Id: Ice47ef2baaef9976546f9562dc7dd9b19b383d59
2022-11-30 05:16:30 +00:00
Krzysztof Kosiński
4e7442326d Merge "Revert "Add tzdata do the Bazel mixed build prod mode allowlist."" am: b35b88ee82 am: d867b39f76
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2321954

Change-Id: I5f1ab496e51c4f20df88f721712f48878357279a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-30 01:09:23 +00:00
Krzysztof Kosiński
b35b88ee82 Merge "Revert "Add tzdata do the Bazel mixed build prod mode allowlist."" 2022-11-30 00:19:17 +00:00
Treehugger Robot
8594199a11 Merge "Disable bazel for riscv_64" am: 00652e7570 am: acf6f6e606
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2322093

Change-Id: I4165f4414f82fea05adb4b84a930f0c5a7e78b41
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-30 00:04:42 +00:00
Krzysztof Kosiński
f8ab0321e3 Revert "Add tzdata do the Bazel mixed build prod mode allowlist."
This reverts commit ff387e55fc.

Reason for revert: breaks aosp-riscv target
https://android-build.googleplex.com/builds/submitted/9347261/aosp_riscv64-userdebug/latest/view/logs/build_error.log

Change-Id: I789d0af91ab18185fbbe68616c6e10f59be4169c
2022-11-29 23:16:13 +00:00
Treehugger Robot
00652e7570 Merge "Disable bazel for riscv_64" 2022-11-29 22:58:59 +00:00
Cole Faust
2db7d85bcd Merge "Allowlist build files in external/python/absl-py" am: 5d4f066ec9 am: 59e28e489a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2308367

Change-Id: Ie9f33cb39b049ece57609bbe7e6e73f7febd2fd4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-29 20:51:46 +00:00
Chris Parsons
428c30f89a Disable bazel for riscv_64
This product is experimental and unsupported for Bazel at this time

Test: lunch aosp_riscv64-userdebug && m nothing
Test: lunch aosp_arm64-userdebug && m nothing
Change-Id: I761afb9524f1008f9d5472d2de19bb84342e9e29
2022-11-29 15:35:56 -05:00
Cole Faust
5d4f066ec9 Merge "Allowlist build files in external/python/absl-py" 2022-11-29 20:03:20 +00:00
Yu Liu
56ccb1aecd Support abi check in bazel.
Bug: 253498204
Test: Manual and unit test.
Change-Id: Id23c4f772f67c4ba05704eaad77322133474b42b
2022-11-29 11:25:10 -08:00
Igor Foox
85e3a9f7d4 Merge "Add tzdata do the Bazel mixed build prod mode allowlist." am: 6463871fd9 am: 3e98a65694
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2298640

Change-Id: I68d33a57813850227d7433e746ad06ea1ebea5ae
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-29 19:14:19 +00:00
Igor Foox
6463871fd9 Merge "Add tzdata do the Bazel mixed build prod mode allowlist." 2022-11-29 18:09:23 +00:00
Kiyoung Kim
f160f7ffa8 Add more cases to vendor-installed module
Current InstallInVendor only checks vendor property, but there are more
properties to check if the module will be installed in the vendor. This
change adds two more cases (soc_specific and proprietary) to the
function.

Bug: 233294155
Test: N/A
Change-Id: Ic3cb4c52f5097cdcc6231c0e85a62ce3ad6094b3
2022-11-29 10:58:08 +09:00
Treehugger Robot
32a3dbc860 Merge "Improve mixed builds error messages" am: efc1bc7f2f am: c0eb594bcc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2313738

Change-Id: I82f93ffefd012c5238e5beb20b5e7ecb50c3d4a1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-28 23:05:15 +00:00
Treehugger Robot
efc1bc7f2f Merge "Improve mixed builds error messages" 2022-11-28 22:06:21 +00:00
Cole Faust
93dc19d39d Allowlist build files in external/python/absl-py
Needed because we import absl-py in our bazel.workspace file.
It only worked before in b, not mixed builds, because b was
run from the real android tree instead of out/soong/workspace.

Bug: 234449134
Bug: 249685973
Test: Presubmits
Change-Id: I51c28e23260bed7ca7d4968fd823f52f0d26a0ab
2022-11-28 12:00:00 -08:00
utzcoz
5c528597e9 Remove unused rules for platform-robolectric-4.4-prebuilt am: 4283bf300b am: 3d282865c4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2314978

Change-Id: I73c436aa94fa70e60d6bcd048bb594ebcbceb9b5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-28 17:23:29 +00:00
utzcoz
4283bf300b Remove unused rules for platform-robolectric-4.4-prebuilt
platform-robolectric-4.4-prebuilt was removed by
https://android-review.googlesource.com/c/platform/prebuilts/misc/+/2298317,
and soong's special rules for platform-robolectric-4.4-prebuilt is not
needed anymore.

Test: m

Signed-off-by: utzcoz <utzcoz@gmail.com>
Change-Id: I3304aa1061d8b945b03cfe1a91f466ceb6ca1260
2022-11-28 07:53:20 +00:00
Igor Foox
ff387e55fc Add tzdata do the Bazel mixed build prod mode allowlist.
Bugs:  b/258504104
Test: Ran a local build and checked build metrics and ninja file,
presubmits.

Change-Id: Ifdefdaebc13188e036b0b9cd55fbdcdfbdc8e11f
2022-11-27 21:48:40 -05:00
Treehugger Robot
08c6c4c354 Merge "Allow stubs implementation to be omitted" am: 378124baf1 am: 6ba2a5b746
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2301917

Change-Id: I586a02cd61b25390152dfa804ffe1d649f0e527c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-24 12:11:52 +00:00
Treehugger Robot
378124baf1 Merge "Allow stubs implementation to be omitted" 2022-11-24 11:12:18 +00:00
Usta (Tsering) Shrestha
fdfda6f69d Merge "volatile-status.txt to be translated to an order-only dep in build.ninja" am: 3caa38827c am: 91621346e3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2313559

Change-Id: If455b6edd91ae38be5a4ce816be88bd9c293ed54
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-23 16:27:54 +00:00
Usta (Tsering) Shrestha
3caa38827c Merge "volatile-status.txt to be translated to an order-only dep in build.ninja" 2022-11-23 15:31:16 +00:00
Cole Faust
f4591fe5c4 Prevent duplicated license_kinds am: 2ced8c8a57 am: 655af89517
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2313938

Change-Id: Ica42441b87d5d977797c6aadeb248ce6a619b4a8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-23 08:57:31 +00:00
Cole Faust
2ced8c8a57 Prevent duplicated license_kinds
Bazel fails when there are duplicate license_kinds.

Bug: 260148018
Test: go test
Change-Id: I47a27d37d66be947e4a744cd04a3cdcc0b000de4
2022-11-22 17:43:40 -08:00
Cole Faust
97d1527dd2 Improve mixed builds error messages
When a target does not have a certain provider we need,
currently we just fail at the dictionary lookup. Change
it so that we fail with a message that tells us what
target had the issue.

Bug: 260131489
Test: Presubmits
Change-Id: I99fd018835c14eba0d4db54ba2769b2da1b278f6
2022-11-22 14:38:24 -08:00
usta
fdb3e34df7 volatile-status.txt to be translated to an order-only dep in build.ninja
Bug: b/260092986
Test: 1. `out/soong/build.ninja` has `bazel-out/volatile-status.txt` as order-only dep 2. `touch Android.bp && m --bazel-mode-staging aapt2` updates bazel-out/volatile-status.txt but aapt2 is not rebuilt

Change-Id: I1fa23437fea14e0d25b68d75010e964dff34766d
2022-11-22 17:12:30 -05:00
Liz Kammer
92c725994f Extend sanitize_test.go
Test: go test soong cc tests
Change-Id: I63fe74fb837e25f63074fb918a573f8b421562f1
2022-11-22 11:46:34 -05:00
Treehugger Robot
81718c7af9 Merge "use CommonAttributes for Tags in protos filegroups" am: dd33a493fb am: 1833a022c9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2310794

Change-Id: I0cba674c0a56fe8e76d5a9050d3d9d5e19dd02e7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-22 16:21:01 +00:00
Alan Stokes
73feba3330 Allow stubs implementation to be omitted
When defining a stubs library, allow specifying that the
implementation library does not need to be installed. This allows for
cases where the implementation is deployed in some non-standard way -
e.g. inside a Microdroid virtual machine.

Without this, we get build errors like: "TARGET module
com.android.compos requires non-existent TARGET module: libvm_payload".

Default behavior is unchanged. The change is protected by an allowlist
to limit usage to the immediate use case.

Bug: 243512108
Test: builds; soong tests pass
Test: Remove allowlist, see build failure
Change-Id: Iaae75f2e93b842f5944a7518cc95069d62c5a638
2022-11-22 16:00:02 +00:00
Treehugger Robot
dd33a493fb Merge "use CommonAttributes for Tags in protos filegroups" 2022-11-22 15:46:59 +00:00
Spandan Das
d7891842ad Add jarjar's deps to bp2build allowlist am: 6960ac12ac am: 1251969d6d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2310383

Change-Id: I438970232a8e15802c509c973ab15b457011c3c6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-22 11:07:38 +00:00
Spandan Das
6960ac12ac Add jarjar's deps to bp2build allowlist
jarjar switched its deps from prebuilts to source (aosp/2305413). Add
the source directory to the allowlist. This should fix broken bp2build
presubmits

Test: b build //external/jarjar
Change-Id: Ic7f37ea0ac167dc3b0f605ca0e67f8740652e0b1
2022-11-22 04:58:06 +00:00
Sam Delmerico
e9b33f70ae use CommonAttributes for Tags in protos filegroups
The Tags attribute is now available in CommonAttributes, and if we use
that one, we won't get errors with conflicting definitions of the
attribute if a global Tags value is added via CommonAttributes.

Test: m bp2build
Change-Id: I422ed817b84e6808ef60fe3599fe84332bc51d8e
2022-11-21 16:25:20 -05:00
Paul Duffin
7e6afb8759 Merge "Revert "Improve error reporting when depending on prebuilt implementation jar"" am: 6fcb32258a am: e32be9356e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2309604

Change-Id: Ifc68fece37e9137a85d690b181912f3d3c4d2de4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-21 18:22:17 +00:00
Paul Duffin
6fcb32258a Merge "Revert "Improve error reporting when depending on prebuilt implementation jar"" 2022-11-21 17:20:03 +00:00
Paul Duffin
7ed6ff8c76 Revert "Improve error reporting when depending on prebuilt implementation jar"
This reverts commit c61783b20d.

Bug: 257969510
Reason for revert: b/255275437 - breaks checkbuild target

Change-Id: I01f88053cc24dbc1a4eb5c009f15473bdff3d565
2022-11-21 10:57:30 +00:00
Usta (Tsering) Shrestha
9f639521e0 Merge "ShouldKeepExistingBuldFileForDir look up by dir" am: 1ad62c7073 am: 5daaffb9db
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2301544

Change-Id: I89fe23c1923093498d53147b9242a3c980a39474
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-19 04:44:18 +00:00
Usta (Tsering) Shrestha
1ad62c7073 Merge "ShouldKeepExistingBuldFileForDir look up by dir" 2022-11-19 03:55:46 +00:00
Treehugger Robot
e7bb0b8dcf Merge "Provide Bazel timing breakdown for the mixed builds" am: 0351be5adc am: d96ff0d685
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2299299

Change-Id: Idd0420635184f66038193465480439184075940c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-18 01:07:46 +00:00
Sasha Smundak
4975c82666 Provide Bazel timing breakdown for the mixed builds
Instead of single event in the build metrics
```
| soong_build.mixed_build.bazel          | 1:17.1 |
```
it will now show:
```
| soong_build.mixed_build.bazel          | 1:17.1 |
| soong_build.mixed_build.bazel.cquery   |   51.9 |
| soong_build.mixed_build.bazel.aquery   |   23.1 |
| soong_build.mixed_build.bazel.symlinks |    2.1 |
```

Test: treehugger
Change-Id: I84a7dda6e3122860da9aaa98bfa6afe33d392dcf
2022-11-16 18:44:08 -08:00
Wei Li
24dc16fcef Merge "Fix the following issues in bazel_handler:" am: c33c2e732a am: 667f8e8e61
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2304953

Change-Id: I92801944a8f71ed24de5a180fc84b0d69e3fe2a4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-17 00:15:12 +00:00
Wei Li
c33c2e732a Merge "Fix the following issues in bazel_handler:" 2022-11-16 23:45:47 +00:00
Sam Delmerico
222d112fbc Merge "export neverallow include dir list to Bazel" am: 775f2cb3cd am: c4366480fd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2302771

Change-Id: I11d6f39cf1021eca92802ed4135bc80c62d20617
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-16 21:42:34 +00:00
Sam Delmerico
775f2cb3cd Merge "export neverallow include dir list to Bazel" 2022-11-16 20:52:17 +00:00
Wei Li
cbd181c8e8 Fix the following issues in bazel_handler:
1) Convert coverage path wildcard to regex values for --instrumentation_filter to Bazel.
2) Handle the error properly when aquery commmand returns error.

Bug: 258397103
Test: CIs
Change-Id: Ie7485c2c45f2eb0e1ca0dc60478aae04ab151b61
2022-11-16 08:59:23 -08:00
Alix Espino
99dbfe5b34 Merge "bp2build for java_library with .kt srcs or common_srcs" am: 3044987181 am: 65d96e5423
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2302599

Change-Id: I7eddaee6e8b8a4fc9e231ce71e1211acf5a5f980
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-16 16:17:43 +00:00
Alix Espino
3044987181 Merge "bp2build for java_library with .kt srcs or common_srcs" 2022-11-16 15:40:55 +00:00
Ryo Hashimoto
f68c18f710 Add arch variants for Intel Atom CPUs
Bug: 259201836
Test: Build aosp_x86_64-eng with modified build/make/target/board/generic_x86_64/BoardConfig.mk
Change-Id: Ic7410d6874c17af0e4492bf7704066ae9af1a531
2022-11-16 17:26:53 +09:00
Usta Shrestha
ea9996411d ShouldKeepExistingBuldFileForDir look up by dir
instead of scanning every entry in the map for prefix-match, search each ancestor of the dir

Bug: N/A
Test: bazel_test.go#TestShouldKeepExistingBuildFileForDir()
Change-Id: I7c9afa456cca5a70624ae1e9c9b96c43b0110c1e
2022-11-15 21:39:37 -05:00
Sam Delmerico
46d08b4e39 export neverallow include dir list to Bazel
Bazel needs to recreate the neverallow behavior for absolute includes,
so export the list of include dirs to soong_injection.

Bug: 250931909
Test: aosp/2302925
Change-Id: I3bd345ea4cfb3181f07e4570466f2fc8c5fe32da
2022-11-15 17:33:21 -05:00
Alix
8062f4dee7 bp2build for java_library with .kt srcs or common_srcs
java_library modules with .kt srcs or common_srcs will be converted into
module type kt_jvm_library

Test: m bp2build, manually inspected build files for allowlisted modules
Bug: 258688914
Change-Id: I8293a11c8247b4b76358d0991f82c6b61b58adc3
2022-11-15 20:01:29 +00:00
Treehugger Robot
b775c15ec5 Merge "Only generated notices for built variants." am: c8a06ca8c8 am: d84901ed2c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2302372

Change-Id: I1e1e78fae50c3505e05adf5fd427e3e7be679d4d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-15 01:49:53 +00:00
Bob Badour
3800b5a787 Only generated notices for built variants.
Test: banchan dcla-notice mainline_modules_arm64; m apps_only dist
Change-Id: I6b0e2eb64f2f3db87dfed68affb44fe141da3eaa
2022-11-14 14:17:55 -08:00
Paul Duffin
f70992ef8c Merge "Improve error reporting when depending on prebuilt implementation jar" am: 280765acc4 am: 3a185bd70e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2289734

Change-Id: I949092a5b3186c60d589e238e0c733f0e2b191b3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-14 17:22:37 +00:00
Treehugger Robot
9c81789039 Merge "Export ndk/aml arches to Bazel" am: 4d87828d15 am: 165e0d4b46
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2300579

Change-Id: Ic9e3762d63c897fd868fc3a94df79d3c3745464a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-14 17:21:30 +00:00
Paul Duffin
280765acc4 Merge "Improve error reporting when depending on prebuilt implementation jar" 2022-11-14 16:38:11 +00:00
Treehugger Robot
4d87828d15 Merge "Export ndk/aml arches to Bazel" 2022-11-14 16:17:41 +00:00
Paul Duffin
74bd800c1b Merge "Allow namespace config to be tested properly" am: 73d394dec2 am: 38a5a9e80e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2292017

Change-Id: I6e071ee574a1b268fc262a68a278cb2f7398bd67
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-14 15:04:48 +00:00
Paul Duffin
73d394dec2 Merge "Allow namespace config to be tested properly" 2022-11-14 14:08:40 +00:00
Paul Duffin
c61783b20d Improve error reporting when depending on prebuilt implementation jar
The sdk snapshot must not be including implementation code for boot
libraries, the implementation is provided by dex jars within the
corresponding APEX. However, the snapshot does need a module for each
boot library so that the build can seamlessly access the dex files from
the APEX.

A java_library boot library (like core-oj) is represented in the
snapshot by a java_import module which requires a jar file to be
provided, otherwise it is disabled. However, that is provided purely
to keep Soong happy and should never be used.

Previously, the snapshot would contain an empty file for the jar. As
an empty file is an invalid jar any tool (like compiler) that tried
to consume it would fail which was the correct behavior. Unfortunately,
the error message that was produced was not very helpful, it was just
some variant on `invalid file` which lead to a lot of bugs being
raised.

This change replaces that empty file with a reference to the output
from a genrule which runs a script which produces a more useful error
message, with information on how to fix the issue, and fails the build.

It also adds a Name() method to the SdkMemberProperties type as that is
needed in AddInternalModule() to construct the name of the additional
module.

Tested as follows:

In AOSP/master make the following changes:
1. Temporarily set visibility on core-oj and core-libart to
   //visibility:public.
2. Run packages/modules/common/build/mainline_modules_sdks.py to create
   the snapshots.

For each of the S, T and latest snapshots I did the following in the
s-aml-prebuilt-test, t-aml-prebuilt-test and aosp/master branches:

1. Created an Android.bp file containing the following:
  java_library {
    name: "broken",
    static_libs: [
      "prebuilt_core-libart",
      "prebuilt_core-oj",
    ],
  }

2. Fix the visibility issues and run `m broken` where it fails with an
   invalid file.

3. Delete the contents of the prebuilts/module_sdk/art/current/sdk
   directory.

4. Unpack the relevant version of the art-module-sdk snapshot into the
   directory.

5. Run `m broken` where it fails with the helpful message.

6. Test the instructions on how to use the ninja -t path tool to
   identify the cause of the problem and fix it.

Bug: 257969510
Test: See above.
Change-Id: I125bde2d7202afff84c97daebcef37e21c548a3a
2022-11-14 10:14:10 +00:00
Kevin Dagostino
6413e4c5d6 Add tools/asuite/atest/ to keep existing BUILD file list am: 92f33d91f3 am: feec939161
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2283141

Change-Id: I04f9dffc506ffe3ba473897c8ab5399f88170086
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-13 07:24:38 +00:00
Kevin Dagostino
92f33d91f3 Add tools/asuite/atest/ to keep existing BUILD file list
Test:  b build tools/asuite/... && b cquery tools/asuite/...
--output=files

Change-Id: I2696327a60e770d0929ccc1baa3b4af703a2269d
2022-11-12 04:43:17 +00:00
Liz Kammer
992918d21f Export ndk/aml arches to Bazel
Test: lunch ndk-eng; b build //bionic/libc --config=android
Change-Id: I1ec6f7d0f084aafe948f27111275537b6d9e9637
2022-11-11 15:27:56 -05:00
Vinh Tran
fbab01aaff Merge "Remove AfdoAdditionalProfileDirs product variable" am: 59834cc56d am: a5dc2c61f3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2280499

Change-Id: Ic6f8f37580a190372779ba27511ff4afd879dfc4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-11 14:27:31 +00:00
Vinh Tran
7a8362c252 Remove AfdoAdditionalProfileDirs product variable
AfdoAdditionalProfileDirs is unconnected to build/make/core/soong_config.mk and is currently unused. Removing AfdoAdditionalProfileDirs will cut down on complexity when we migrate the support of auto-fdo profiles to Bazel cc rules.

b/258684450 proposes an alternative to support the use cases that were meant to be supported by AfdoAdditionalProfileDirs.

Test: existing go tests
Bug: 253540178
Change-Id: I024e48598a560717a1d6c19b16bde3fe65ff1961
2022-11-11 03:29:31 +00:00
Liz Kammer
c9a5956299 Merge "Increase testing of request_type" am: dbb9fe8e92 am: 210a0fec14
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2295498

Change-Id: Ie83e70ebdef3638b4636045606b044db3768b7c1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-10 14:26:18 +00:00
Liz Kammer
dbb9fe8e92 Merge "Increase testing of request_type" 2022-11-10 13:30:58 +00:00
Sam Delmerico
bd9dd9cbd4 add --norun_validations to bazel build action am: 658a4da53b am: 129ca36465
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2285613

Change-Id: Ic35af1b5af657834b4482630f0c43ad7e43b1871
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-10 02:02:38 +00:00
Sam Delmerico
129ca36465 add --norun_validations to bazel build action am: 658a4da53b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2285613

Change-Id: I6ad7d6283203adfc33484989cbcd7b023904fafe
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-10 01:32:52 +00:00
Treehugger Robot
01dd619766 Merge changes from topic "clang-tidy-mixed-builds"
* changes:
  add tidy files to mixed builds
  add --norun_validations to bazel build action
2022-11-10 01:00:15 +00:00
Treehugger Robot
e7c27be299 Merge "Add com.android.tzdata to AOSP staging allowlist." am: b7c01a261d am: af11f89f41
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2294457

Change-Id: I2a8fe6b8ab88ba30348654c0899f8c017c297f44
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-09 20:50:59 +00:00
Liz Kammer
1b7ed9bcbc Increase testing of request_type
Test: go test soong tests
Change-Id: Iacb773a91a4cc097320f06ea1d1669c5923f8076
2022-11-09 11:22:11 -05:00
Jingwen Chen
264f631a6c bazel apex: Add mixed builds support for <module>_using.xml file. am: 1ec7785ec5 am: 112492c0ba
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2290033

Change-Id: I3e2cf964542dbfe25fe02337cd0922dfabf525e8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-09 10:22:27 +00:00
Jingwen Chen
dece457443 Add com.android.tzdata to AOSP staging allowlist.
Test: presubmits
Change-Id: I7d9edb56273375579edf3b8a5466570df6073668
2022-11-09 09:30:03 +00:00
Jingwen Chen
1ec7785ec5 bazel apex: Add mixed builds support for <module>_using.xml file.
This file contains the java APIs parsed by the 'dexdeps' tool within the gen_java_usedby_apex.sh.

Bug: 239084755
Fixes: 239084755
Test: presubmits
Change-Id: Ia271783a6be3ea3a343481306cde1aaba2166e88
2022-11-09 06:30:03 +00:00
Romain Jobredeaux
f2e561a1de Merge "Sort allowlist ascii-betically" am: 64340c0539 am: 8f837dd07a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2289840

Change-Id: Iedc083919f8242fd357236bee4dca2836c4c9f2f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-08 22:59:00 +00:00
Romain Jobredeaux
64340c0539 Merge "Sort allowlist ascii-betically" 2022-11-08 21:57:45 +00:00
Paul Duffin
3f7bf9fa0d Allow namespace config to be tested properly
Previously, the NewTextContext created a context that always called
NewNameResolver with a export filter that always returned true.

This change fixes that by:
1. Changing NewNameResolver to take a Config parameter instead of a
   filter parameter and pushing the code to create the filter from the
   Config from newNameResolver() in cmd/soong_build/main.go into the
   NewNameResolver function.

2. Extracting a newTestContextForFixture that does not create a
   NameResolver or set it on the context. That avoids creating a
   NameResolver before the test has prepared the config.

3. Modify the fixture to create and set the NameResolver in the Context
   after the config has been prepared by the test.

4. Added test to verify that it all works.

Bug: 234825639
Test: m nothing
Change-Id: Ie4b13f18093dc01a0ab65a9ecfd143585d843b55
2022-11-08 17:38:56 +00:00
Chris Parsons
9ae89243b5 Refactor "staging dep on prod" allowlist dep am: 66fc74509f am: 0adc255647
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2288153

Change-Id: Iaf0a7986117efba27acfca543434bf55442af690
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-08 17:07:42 +00:00
Chris Parsons
66fc74509f Refactor "staging dep on prod" allowlist dep
This allows branch-specific plugins to more easily add modules to
staging or prod mode allowlists (they need not separately ensure that
staging mode is a superset of prod mode)

Bug: 254447469
Test: TH
Test: Verified that adding tzdata modules via plugin (not part of
this CL) causes many outputs under bazel-out directories

Change-Id: I5d543e262a42cce324c59e3f9880b57ca209c13c
2022-11-08 05:54:19 +00:00
Jingwen Chen
c56789eaee Merge "Call rm -rf in mixed build build statement preamble." am: 1214001184 am: 6fbdd21df0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2290034

Change-Id: I5014cda9bb3b7bd202daa5fe123a79992f392175
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-08 00:23:38 +00:00
Jingwen Chen
1214001184 Merge "Call rm -rf in mixed build build statement preamble." 2022-11-07 23:03:43 +00:00
Liz Kammer
564a28313d Merge "Add apex_test for mixed builds" am: f1c70ed5ad am: 22f7ad00ef
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2288161

Change-Id: Ib075a6e3c8ab03d3ab197574f89a198a297ccfc7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-07 22:56:10 +00:00
Liz Kammer
f1c70ed5ad Merge "Add apex_test for mixed builds" 2022-11-07 21:56:02 +00:00
Sam Delmerico
658a4da53b add --norun_validations to bazel build action
Validation actions were being run before the build environment was set
up and causing build errors. Turn off validation actions in this phase
because they will be run later in the Ninja invocation.

Bug: 195029134
Test: build/bazel/ci/mixed_libc.sh
Test: verify that Ninja build file contains commands to generate tidy
  files that are generated by these validation actions
Test: delete a tidy file in mixed builds mode, and verify that it is
  rebuilt
Change-Id: I371572d5662913c5637e39c8894eeb6ee53d00ac
2022-11-07 15:58:19 -05:00
Paul Duffin
88d96be91a Avoid loss of ninja_deps events am: 780a185ede am: bd0b8f72c5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2287715

Change-Id: I7f5be19e1c4cb3d85c1acacf47e6bae32a9da956
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-07 19:16:50 +00:00
Romain Jobredeaux
77488afdc1 Sort allowlist ascii-betically
Change-Id: I49b62fdc2446bd0a88305ce1243c80cc8b7bc680
2022-11-07 16:56:12 +00:00
Liz Kammer
0e255ef6e6 Add apex_test for mixed builds
Test: go test soong tests
Change-Id: I33327e1fe7d6a4bbf32890d9fbd5453c28a9c5b1
2022-11-07 11:11:37 -05:00
Jingwen Chen
f3b1ec39eb Call rm -rf in mixed build build statement preamble.
https://android-review.git.corp.google.com/q/topic:bazel_using_txt added
a tree artifact output for an action. This CL adds "-r" to the rm calls
to support deleting the old tree artifact outputs.

Test: presubmits
Fixes: 257956807
Change-Id: Ia44b1bef4f8031fe75a239fb162972e8827e3c19
2022-11-07 15:10:04 +00:00
Paul Duffin
780a185ede Avoid loss of ninja_deps events
Previously, writeDepFile was passed a copy of the main EventHandler to
which it then added an event. Adding an event requires appending
information to slices in the EventHandler structure. As the slices are
a copy the addition only affects the copy and are not present in the
EventHandler which is written out as part of the metrics.

This change fixes that by passing a pointer to an EventHandler into
writeDepFile. For consistency it also replaces a few other uses of
EventHandler with *EventHandler instead.

Bug: 257590265
Test: m nothing
      # Check generated text metrics to make sure they don't contain ninja_deps.
      # Apply this change.
      m nothing
      # Check generated text metrics to make sure they do contain  ninja_deps.
Change-Id: I0fa0f2b08844cb7c7b4e99b37602703deb43ad20
2022-11-07 14:12:11 +00:00
Treehugger Robot
853775f23c Merge "Rename ApexCqueryInfo to ApexInfo" am: d6dec6f51e am: 0b320cfe37
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2288160

Change-Id: I6046ba4b8ece0f31fad1155ba2af9aa1f82de3b7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-05 02:01:08 +00:00
Treehugger Robot
223fd02f39 Merge "Add missing t.Helper() to androidmk functions" am: 17d0a8509b am: 410ca59d64
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2288159

Change-Id: I02f4316a2429837434c8e5911502ba4d6267669d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-05 02:01:00 +00:00
Treehugger Robot
d6dec6f51e Merge "Rename ApexCqueryInfo to ApexInfo" 2022-11-05 00:36:45 +00:00
Treehugger Robot
17d0a8509b Merge "Add missing t.Helper() to androidmk functions" 2022-11-05 00:34:42 +00:00
Treehugger Robot
b722151544 Merge "Make PackageVarContext implement PathGlobContext" am: 979c953ac0 am: 24ac949eba
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2285524

Change-Id: Id8be5ba19fd69128a54db15280168650b668e380
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-04 22:44:45 +00:00
Treehugger Robot
979c953ac0 Merge "Make PackageVarContext implement PathGlobContext" 2022-11-04 20:50:04 +00:00
Liz Kammer
be6a712767 Rename ApexCqueryInfo to ApexInfo
cquery is redundant given this is in the cquery package.

Test: go test soong tests
Change-Id: Ib38794b712f548129eec964b8fd85bf8401a5f86
2022-11-04 16:24:37 -04:00
Liz Kammer
6be6906429 Add missing t.Helper() to androidmk functions
Test: go test soong tests
Change-Id: I534aef51afa91a0942f58b3987e9c1cb3f3c75cb
2022-11-04 16:24:32 -04:00
Colin Cross
662d61430f Make PackageVarContext implement PathGlobContext
Make PackageVarContext implement PathGlobContext by implementing
GlobWithDeps.  This will allow calls to ExistentPathForSource
inside a VariableFunc to use optimized glob dependencies instead of
falling back to AddNinjaFileDeps, which is resulting in extra
dependencies from soong_build on top level directories, triggering
extra Soong regenerations.

Remove the fallback path in ExistentPathForSource by making it take
a PathGlobContext, which is now a superset of PathContext.

Rewrite TestNinjaDeps to not rely on the unoptimized glob dependencies
in VariableFuncs and instead call ctx.Config().AddNinjaFileDeps
directly.

Bug: 257079828
Test: test_create_global_include_directory
Change-Id: I48cf189157d78b9252d339dbc9baeb27e4694807
2022-11-04 09:04:02 -07:00
Usta (Tsering) Shrestha
de430d1d4d Merge "add test for ShouldKeepExistingBuldFileForDir()" am: 9478303673 am: 6d7aded12e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2283373

Change-Id: Ibcd32ff90dec16cddf822cf2a7aaf351dee5ff11
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-03 03:56:58 +00:00
Usta (Tsering) Shrestha
9478303673 Merge "add test for ShouldKeepExistingBuldFileForDir()" 2022-11-03 02:44:08 +00:00
Ibrahim Kanouche
72f4247f43 Merge "Export SBOM utility to make" am: 2d1eb1238d am: 8cd8989284
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2283139

Change-Id: Id1148e354a82cd9e3b005ced7d0070e5a4a7d01b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-03 01:00:03 +00:00
Ibrahim Kanouche
2d1eb1238d Merge "Export SBOM utility to make" 2022-11-03 00:03:21 +00:00
Usta Shrestha
342f28f9bf add test for ShouldKeepExistingBuldFileForDir()
Bug: N/A
Test: Added
Change-Id: I15dc543f65bffdd745ecfe5c8fe521723eeffbc0
2022-11-02 17:21:41 -04:00
Ibrahim Kanouche
5797d8c7f5 Export SBOM utility to make
Bug: 257094286

Test: m compliance_sbom
Change-Id: I2a8de6350c3a5b24cd3b3fd03312955ce1a3dba9
2022-11-02 19:17:30 +00:00
Cole Faust
aea1011a24 Merge "Revert^4 "Prevent unspecified values in soong_config_string_variables"" am: acf417b085 am: a7ed7193ec
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2280937

Change-Id: I493c3ea79ccf6b7ec925863bfc160d47c43993c3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-02 18:10:26 +00:00
Cole Faust
acf417b085 Merge "Revert^4 "Prevent unspecified values in soong_config_string_variables"" 2022-11-02 16:56:45 +00:00
Steve Elliott
8a35f07280 Add kotlinx.coroutines to "neverallow" allowlist am: 8053f82697
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/20224345

Change-Id: I95d2ea15334461c52491f2df8d092fc7576b2c12
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-01 21:23:59 +00:00
Cole Faust
b0a91330bb Revert^4 "Prevent unspecified values in soong_config_string_variables"
This reverts commit b7b2e12475.

Reason for revert: Issues on -plus-aosp branches have been fixed

Change-Id: Ie2f7ce45502b999280e099d9c0f9d0f7d6b7ba08
2022-11-01 17:10:23 +00:00
Treehugger Robot
0b2788e833 Merge "Skip the noop Soong dep edge for api_domain and contributions" 2022-11-01 03:07:14 +00:00
Sam Delmerico
8604df6fb1 Merge "export clang-tidy variables to soong_injection" 2022-10-31 17:23:19 +00:00
Alix
b4e09a0ada Bp2build Java libs for java_binary -> java_import edge
Since Bazel's java_import requires a jars attribute to be specified,
the generated neverlink-duplicated module is of type java_library

Change-Id: I14a866dfc583507a9462add50d95060cbfe540c5
Bug: 244210934
Test: m bp2build, go test ./bp2build, manual inspection of generated Build and jar files
2022-10-28 20:26:38 +00:00
Christopher Parsons
057ad009c7 Merge "Remove adbd from bazel prod allowlist" 2022-10-28 16:19:35 +00:00
Jason Wu
1cb6739c01 Merge "Rollforward "Use proto output instead of jsonproto output for aquery""" 2022-10-28 14:47:52 +00:00
Steve Elliott
8053f82697 Add kotlinx.coroutines to "neverallow" allowlist
Bug: 239834928
Test: manual -- all existing tests and builds should pass
Change-Id: Ie5fb0d6cbd8d624f71b80bb1afe003917410aa3d
2022-10-28 10:08:22 -04:00
Lukács T. Berki
4bb30b59a9 Merge changes from topic "separate-symlink-forest-invocation"
* changes:
  Build the symlink tree on multiple threads.
  Create Bazel symlink forest in a separate process.
2022-10-28 07:05:00 +00:00
Treehugger Robot
2b1a1bff0f Merge "The NDK _does_ assume neon now." 2022-10-28 01:50:58 +00:00
Elliott Hughes
c55b58692d The NDK _does_ assume neon now.
This lets us simplify more of our build configuration for stuff like
libm and libz.

Test: treehugger
Change-Id: I823c7df8117f068aeeb7067e8e197863b0fb517f
2022-10-27 23:46:22 +00:00
Victor Liu
2ea00270a3 Merge "Revert "Revert ^2 "Prevent unspecified values in soong_config_st..."" 2022-10-27 19:11:31 +00:00
Brad Hinegardner
b7b2e12475 Revert "Revert ^2 "Prevent unspecified values in soong_config_st..."
Revert submission 2262062-colefaust_soong_config_string_variable_2nd_try

Reason for revert: breaks builds, b/255996492 among others
Reverted Changes:
I3e2f59e5f:Fix typo
Id3bcd9a46:Revert ^2 "Prevent unspecified values in soong_con...

Change-Id: Ifa8ebb3993bf2c716c3ec3c9fdbe72ba019e77ad
2022-10-27 19:01:10 +00:00
Jason Wu
118fd2b443 Rollforward "Use proto output instead of jsonproto output for aquery""
Test: use m --bazel-mode-dev and mixed_droid.sh
Bug: 233798334

This reverts commit d27e28c2a7.

Change-Id: Ifd37ac449979330529dd25c92a5eca2f5a80827e
2022-10-27 18:41:50 +00:00
Cole Faust
3bd8f0a6e6 Merge "Revert ^2 "Prevent unspecified values in soong_config_string_variable""" 2022-10-27 16:41:29 +00:00
Lukacs T. Berki
c541cd27fa Create Bazel symlink forest in a separate process.
This helps with incrementality a lot: the symlink forest must depend on
almost every directory in the source tree so that if a new file is added
or removed from *anywhere*, it is regenerated.

Previously, we couldn't do this without invoking bp2build, which is
quite wasteful because bp2build takes way more time than the symlink
forest creation, even though we do the latter in a very suboptimal way
at the moment.

This means that if a source file is added or removed (which does not
affect globs), we don't pay the cost of bp2build anymore.

Also refactored symlink_forest.go on the side. Too much state was being
passed around in arguments.

This change reimplements aosp/2263423 ; the semantics of not touching an
output file is the exact same as order-only inputs and the latter is a
bit fewer lines of code.

Test: Presubmits.
Change-Id: I565c580df8a01bacf175d56747c3f50743d4a4d4
2022-10-27 08:08:45 +00:00
Jason Wu
ab17626ba6 Merge "Revert "Use proto output instead of jsonproto output for aquery"" 2022-10-27 05:24:40 +00:00
Jason Wu
d27e28c2a7 Revert "Use proto output instead of jsonproto output for aquery"
This reverts commit 6fe8721e12.

Reason for revert: Broke aosp_kernel-build-tools/linux

Change-Id: I502ec4c275cbc56e1024a42fadf68b308750939d
2022-10-27 05:18:40 +00:00
Jason Wu
b1bd4bf716 Merge "Use proto output instead of jsonproto output for aquery" 2022-10-27 03:06:12 +00:00
Treehugger Robot
b5703b83a3 Merge "Tweak Soong install rules logging" 2022-10-26 22:37:59 +00:00
Jason Wu
6fe8721e12 Use proto output instead of jsonproto output for aquery
Test: use m --bazel-mode-dev and mixed_droid.sh
Bug: 233798334
Change-Id: Ib945359d3d05e6f51afe70432ec380e4e584175b
2022-10-26 17:07:48 -04:00
Chris Parsons
20602fbe4f Remove adbd from bazel prod allowlist
This is to prepare for an imminent launch of bazel prod mode to all
users.

Note that this means a temporary test regression for bazel-built adbd, as
we have CI builds in place to verify adbd prod mode, and now we will
have no e2e coverage of mixed builds with adbd allowlisted. Still, this
test regression should hopefully be shortlived, as we begin launching
bazel-built build chunks as part of feature rollout in the coming weeks.

Test: Treehugger
Change-Id: I3c34ce91ac3454d1f71340a0fa03951f2e69f203
2022-10-26 16:25:31 -04:00
Yu Liu
2ff53da9f8 Merge "Support apex_test." 2022-10-26 16:37:59 +00:00
Sam Delmerico
b9b6c6773e export clang-tidy variables to soong_injection
Change-Id: If6470c35f5ee8f4867177d641640cdc2806de574
2022-10-25 15:55:17 -04:00
Spandan Das
eb6b90747c Skip the noop Soong dep edge for api_domain and contributions
This allows us to skip the current visibility checks of certain
systemapi libraries like libsigchain. Instead of adding
`//build/orchestrator/apis` to the visibility of these libraries and
removing it later when the api_domains are collocated with their
contributions, drop the dependency edge creation for now

The dep edge will continue to exist in the generated Bazel workspace

Test: m nothing
Change-Id: If0d24d0cba85dc96dea3276a1ec0f8fa51adb379
2022-10-25 19:22:07 +00:00
Joe Onorato
934977cbbe Merge "Move bazel from being a shell function to being a script at build/bazel/bin/bazel" 2022-10-25 17:56:58 +00:00
Alessandro Astone
2b17a23da8 Tweak Soong install rules logging
The make counterparts print a colon, so match that

Change-Id: I9482a0e66b03ad41a66df09d29e76b465ece35c5
2022-10-25 11:46:01 +02:00
Treehugger Robot
1227abee34 Merge changes from topic "api_library_missing_deps"
* changes:
  Do not register missing deps
  Skip existence check for stub library files
2022-10-25 03:12:07 +00:00
Yu Liu
4c212ce058 Support apex_test.
Bug: 249744489
Test: Manual and unit test.
Change-Id: I866debf7ffee54a0f4649b5e5425a8e3cc3042a1
2022-10-24 10:35:12 -07:00
Liz Kammer
748209cb6b Disable all filegroups in mixed builds
Rather than individually denylisting filegroups until we prioritize a
solution for mixed builds that will correctly integrate into uses such
as proto, aidl, gensrcs, etc.

Test: mixed_droid
Change-Id: Iddbd391af7dd7cabc892b2b26dbc68e3aa506471
2022-10-24 11:11:58 -04:00
Joe Onorato
ba29f380d3 Move bazel from being a shell function to being a script at build/bazel/bin/bazel
Bug: 254713799
Test: b build //packages/modules/adb/apex:com.android.adbd
Change-Id: I6a0a89438a46d8252c3e0c24319038b0cf2dbd59
2022-10-24 06:38:11 -07:00
Spandan Das
c6c10fa34f Do not register missing deps
This is a fix to aosp/2260763 and skips the existence check corectly.
Previously, it would not throw an exception during Soong analysis, but
would add the path to a `MissingDeps` object. The ninja graph generated
using this would throw an exception during ninja execution.

We should not do this check for `cc_api_library`. The prebuilt
library.so is missing in the build graph of the inner tree (expected),
but it will be present when the orchestrator creates the combined
multi-tree ninja graph.

Test: rm -rf out && multitree_build vendor/vendorimage
(I did not clean out/ in aosp/2260763, and therefore did not catch this
earlier)
Test: go test ./cc

Change-Id: I68d245acae3bfb777bfc8a72fb7cd4909cb0a289
2022-10-22 02:26:30 +00:00
Vinh Tran
a38504fd11 Merge "Disable converted filegroups in mixed build" 2022-10-21 23:00:34 +00:00
Rex Hoffman
8165dd6941 Merge "Enable new_robolectric" 2022-10-21 22:17:27 +00:00
Vinh Tran
ce77a337ee Disable converted filegroups in mixed build
Bug: 254796426
Test: m libplatformprotos --bazel-mode-dev
Change-Id: I03f4f4847f8dafc3291c1cceed2dd62be4c91746
2022-10-21 16:48:37 -04:00
Rex Hoffman
54641d2aec Enable new_robolectric
Allow new robolectric to break soong's exepected machine type restrictions

Test: mma in /external/robolectric
Bug: 244627502

Change-Id: If58a36b2d84804d586d9c8a773e2e739867fa987
2022-10-21 17:53:40 +00:00
Mark Dacek
99db041a14 Merge "Add bazel staging mode to soong build." 2022-10-21 17:38:43 +00:00
Cole Faust
c52527364f Merge "Fix bazel builds with unspecified arch" 2022-10-21 17:34:31 +00:00
Cole Faust
f5eae990bc Fix bazel builds with unspecified arch
//build/bazel/platforms:android_target is an alias to
android_{arch}, so on bulids like "ndk" that don't
specify an arch, it fails.

It's also questionable if we should be setting the
platform to android in a mixed build in the first
place. What if we were mixed-building a host tool?

This reproduces when running
`OUT_DIR=out ./build/soong/scripts/build-ndk-prebuilts.sh`
with aosp/2263623. That script specifies --soong-only,
which is important because even without bazel, `m nothing`
on ndk-userdebug will fail with errors in makefile code.

Bug: 254701254
Test: Described above
Change-Id: I34cae0287830a19c4865fbd398f3c4e1ee1d2d66
2022-10-20 16:49:30 -07:00
Vinh Tran
3cb9ade56b Allowlist framework-javastream-protos and framework-cppstream-protos
Mixed build between gensrcs and filegroup is currently broken (b/242847534 b/247782695). This CL allowlist the gensrcs modules to remove the mixed build instead.

Test: m framework-javastream-protos --bazel-mode-dev
Test: m framework-cppstream-protos --bazel-mode-dev
Bug: 254634154
Change-Id: Icbca336612fbee3a91604770c8903f011bee6edd
2022-10-20 17:17:32 -04:00
Jingwen Chen
6817bbb3c8 Introduce BazelStringOrLabelFromProp.
Soong supports string properties, but they are overloaded, and can mean
one of three things:

* path reference
* module reference
* string literal

Bazel has different types: label and string attributes. Thus there needs
to be a way to categorize them correctly in bp2build.

This CL introduces a new function to be used on properties like
apex_key.private_key / apex_key.public_key, as well as
android_app.certificate / apex.certificate.

It is important to disambiguate the prop betenn a string literal
attribute or file/rule target label attribute, so this functions does
just that.  The new attributes are then further handled by their
respective macros (apex_key, android_binary, apex).

Bug: 253557437
Fixes: 253557437
Test: presubmits, new tests

Change-Id: Id8111cdd60d3aabcae7d17fe9da84d0ee3966023
2022-10-20 14:57:37 +00:00
Cole Faust
135d987d7c Revert ^2 "Prevent unspecified values in soong_config_string_variable""
This reverts commit 38944c70c4.

Reason for revert: I believe we're ready for this now, but run build_test 1-4 on internal master for at least master and tm-dev-plus-aosp on go/abtd before submitting

Change-Id: Id3bcd9a46f3087cf2d34dece5294828ea9436788
2022-10-20 00:34:00 +00:00
Yu Liu
6c999eff9a Denylist libapexinfo and libapexinfo_tests.
Bug: 254476335
Test: None
Change-Id: I7cb62bf5aaba0632d9c7e652cb3b23a5a5e35013
2022-10-19 16:41:10 +00:00
MarkDacek
b78465de1d Add bazel staging mode to soong build.
This is to use bazel to build targets that are being prepared for an
incipient release to the prod mode allowlist.

Bug: 254265047
Test: m nothing
Test: m nothing --bazel-mode-dev
Test: m nothing --bazel-mode-staging
Change-Id: Ic78a59cf51dba83ef1ac26483586560ea9b24aaf
2022-10-19 15:57:18 +00:00
Treehugger Robot
2fe9d75bef Merge "Added module_name to license metadata" 2022-10-14 15:32:25 +00:00