Commit Graph

45439 Commits

Author SHA1 Message Date
Anton Hansson
776a2bcb7e Merge "Update reference to merged services txt" am: 6fcddda43c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1850001

Change-Id: I4ec095dfc7fb6b8e698c9d5eeed4c1065500c7fc
2021-10-11 16:10:56 +00:00
Anton Hansson
6fcddda43c Merge "Update reference to merged services txt" 2021-10-11 15:57:02 +00:00
Liz Kammer
e6450855c6 Merge "bp2build; Update handling of linker flags" am: 2649c7913a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1846573

Change-Id: I9b462049bd56772ef83c9e2561f3ca8f3193baef
2021-10-08 20:26:13 +00:00
Liz Kammer
2649c7913a Merge "bp2build; Update handling of linker flags" 2021-10-08 20:09:32 +00:00
Trevor Radcliffe
e0b5c20025 Merge "Add support for USES_LIBRARIES to androidmk" am: c170e39a6b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1846993

Change-Id: I1d8ca98660e397b4ca26082a9835e1bf5ad3fcee
2021-10-08 19:29:10 +00:00
Trevor Radcliffe
c170e39a6b Merge "Add support for USES_LIBRARIES to androidmk" 2021-10-08 19:12:21 +00:00
Liz Kammer
1f93d920c2 Merge "Restrict mixed build cquery to deps of depth 2." am: 8cdd6f007d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1849693

Change-Id: I55f2bd60b00ec40d9bb4564c20de147b44466a21
2021-10-08 17:23:50 +00:00
Liz Kammer
8cdd6f007d Merge "Restrict mixed build cquery to deps of depth 2." 2021-10-08 17:04:02 +00:00
Jingwen Chen
aff7f12f5a Add bp2build support for cpp_std. am: 97b8531492
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1850354

Change-Id: I159b9e957075b595318d22423f2d6f6e520a3d03
2021-10-08 16:27:20 +00:00
Anton Hansson
f2dffd9c04 Update reference to merged services txt
The module is changing name. Update the reference.

Bug: 169103987
Test: m
Change-Id: I1e3f05b6d9c0262adcde6881ea79df9338bb363a
2021-10-08 16:15:10 +01:00
Jingwen Chen
97b8531492 Add bp2build support for cpp_std.
This converts cpp_std and gnu_extensions into a -std copt, if cpp_std is
specified or gnu_extensions is false if cpp_std is not specified.

I chose to go with this copts approach because the tradeoff is a much
simpler setting than adding a new attr(s) everywhere that uses features
to set the flag.

This approach limits the number of user-configurable knobs (since users
would then be able to set std in _both_ copts and the new attr). But it
does rely on the user copt overriding the toolchain's default gnu++17
version, which can mean a `-std` flag showing up twice in the action.

Fixes: b/202462232
Test: b build //system/libziparchive:libziparchive
Change-Id: I81dad029059461739b91f318d662e089edb46b84
2021-10-08 11:16:20 +00:00
Xin Li
8e22b59b21 [automerger skipped] Merge "Merge Android 12" am: 800112b97f -s ours
am skip reason: Merged-In Ia86b363c2556ad4999f124cbb9bec21cf0ad58ff with SHA-1 b5baa65c8e is already in history

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1847393

Change-Id: I70e5da09f84bee2af473a72e316f8be037f1f3e8
2021-10-08 01:19:41 +00:00
Xin Li
800112b97f Merge "Merge Android 12" 2021-10-07 23:50:21 +00:00
Liz Kammer
0eae52e0de bp2build; Update handling of linker flags
Test: build/bazel/ci/bp2build.sh
Bug: 197920036
Change-Id: I6e3100574fa0e40bcd8cf0e6af0efd3310aa41bf
2021-10-07 16:07:40 -04:00
Jingwen Chen
6de8f75712 Add support for nocrt by translating it to link_crt in bp2build. am: 6ada589f6e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1830053

Change-Id: I2fbe236b2a81eb5f223ab566369b8dcfa7b04bca
2021-10-07 19:49:37 +00:00
Jingwen Chen
ad5acd94de Stop relying on target.kind in mixed builds. am: 8f22274297
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1849359

Change-Id: Iabf3aaea4cec22e1bc46dc8677bed5e6a57e0a20
2021-10-07 19:49:33 +00:00
Jingwen Chen
6ada589f6e Add support for nocrt by translating it to link_crt in bp2build.
If nocrt is true, then the compilation for cc_shared_library,
cc_binary (shared or static binaries) will _not_ link against their
respective crtbegin and crtend libraries.

nocrt is true only for the Bionic libraries themselves. For everything
else that links against the Bionic runtime, crtbegin and crtend
libraries are used. This makes the "nocrt: false" case the majority.
Hence, if nocrt is explicitly false, we omit the generating attribute in
bp2build.

If nocrt is explicitly true (link_crt is false), the Starlark macro will
disable the link_crt cc_toolchain feature.

Test: new tests
Test: CI
Fixes: 187928070
Fixes: 197946668
Change-Id: I8947789930e599dc802d8eae440859257d044475
2021-10-07 14:04:39 +00:00
Jingwen Chen
8f22274297 Stop relying on target.kind in mixed builds.
target.kind was a field that existed for only a few months, and have
been removed from Bazel. This is needed to update to a newer Bazel version.

Also, this reverts filegroups to be queried for a specific arch again,
but leaving file targets in the common arch (which is correct, anyway).

Fixes: b/199363072
Test: mixed_libc
Test: presubmits
Change-Id: I3b8e5c43a39516d977d327a44a75750b2f251be3
2021-10-07 14:04:38 +00:00
Ulyana Trafimovich
4f96d844a3 Merge "Defer dexpreopt failure with missing implementation jar" am: 9d373d8cb0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1849413

Change-Id: Iee2b931d37923fe823905e16a144dd8c5c9de862
2021-10-07 11:54:14 +00:00
Ulyana Trafimovich
9d373d8cb0 Merge "Defer dexpreopt failure with missing implementation jar" 2021-10-07 11:39:59 +00:00
Pedro Loureiro
bba5a387d6 Merge "Add module-lib to droidstubs' supported sdk types" am: 2937eb5bb4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1844312

Change-Id: I3a23a868ff9b476bc3c60f01ad756d897829ff3b
2021-10-07 10:29:31 +00:00
Pedro Loureiro
2937eb5bb4 Merge "Add module-lib to droidstubs' supported sdk types" 2021-10-07 10:17:03 +00:00
Paul Duffin
77a80fa397 Defer dexpreopt failure with missing implementation jar
Previously, if an implementation jar (Host) was not available to the
build it would panic when trying to generate the JSON representation of
the CLC. That prevents builds with missing implementation jars from
working even if those jars are never actually built.

This change defers the build failure until it is actually built.

Test: TARGET_PRODUCT=armv8 TARGET_BUILD_VARIANT=eng ./art/test/testrunner/run_build_test_target.py -j80 art-no-prebuild
      - run above in master-art before and after this change.
Bug: 202366925
Change-Id: I60a78a8bf6c13b83a9dceb5c43019a9e21f0b637
2021-10-07 09:52:42 +01:00
Treehugger Robot
d48d7bd682 Merge "Include proc macro crates in rust-project.json" am: 688cea69f4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1846797

Change-Id: I2f861ec8cc5231cf9807ffd52c571039ff709302
2021-10-07 04:29:36 +00:00
Treehugger Robot
688cea69f4 Merge "Include proc macro crates in rust-project.json" 2021-10-07 04:13:07 +00:00
Xin Li
08615f7aab Merge Android 12
Bug: 202323961
Merged-In: Ia86b363c2556ad4999f124cbb9bec21cf0ad58ff
Change-Id: Ib58c27d67387c331b2adc390906f4c846bb8bacb
2021-10-06 22:51:44 +00:00
Liz Kammer
c19d5cdcff Restrict mixed build cquery to deps of depth 2.
This will be the list of targets directly being requested + additional
targets necessary for mixed_root. This reduces the size of the cquery
file by ~300Kb. Additionally, it removes unnecessary targets, making it
ever so slightly easier to find what one is looking for in cquery.out
for debugging purposes.

Test: build/bazel/ci/mixed_droid.sh
Change-Id: I6d0e337c9ab7c13388459dee16415be0ab3c0506
2021-10-06 18:16:58 -04:00
Trevor Radcliffe
31b48a72d0 Add support for USES_LIBRARIES to androidmk
And OPTIONAL_USES_LIBRARIES. Also includes lint fix.

Fixes: 202163928
Test: Ran tool against development/apps/Development/Android.mk
Test: Added integration test cases
Change-Id: I9c8130b19f05df938f01957852384c0532e73433
2021-10-06 20:28:01 +00:00
Seth Moore
af96f99d83 Include proc macro crates in rust-project.json
These crates were skipped before, leaving dependencies missing in
rust-project.json. Include them and mark them as `"is_proc_macro": true`
so that rust-analyzer can process them.

Fixes: 202290038
Test: SOONG_GEN_RUST_PROJECT=1 m nothing
Change-Id: Ia80e6f5e2f56a76608ba057075600e6b4424281b
2021-10-06 19:39:06 +00:00
Yu Liu
b5baa65c8e Merge "Store build targets in the soong metrics." am: c7ece788de
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1844469

Change-Id: Ia86b363c2556ad4999f124cbb9bec21cf0ad58ff
2021-10-06 18:09:23 +00:00
Yu Liu
c7ece788de Merge "Store build targets in the soong metrics." 2021-10-06 17:53:32 +00:00
Liz Kammer
02aaca663d Merge "Handle arch-variant in prebuilt_etc" am: ba26bdc316
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1844460

Change-Id: I1e842ab2cc34548f498fd083e07ddeecd18a5da1
2021-10-06 15:49:20 +00:00
Liz Kammer
ba26bdc316 Merge "Handle arch-variant in prebuilt_etc" 2021-10-06 15:36:57 +00:00
Paul Duffin
dc3951c407 Merge "Allow implementation details to be excluded from signature patterns file" am: 6546573ec9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1788094

Change-Id: I28f0ddcfe3746a8bf37471f9f1c9b9771fab690a
2021-10-06 12:35:12 +00:00
Paul Duffin
6546573ec9 Merge "Allow implementation details to be excluded from signature patterns file" 2021-10-06 12:19:23 +00:00
Cole Faust
2a50c472f4 Remove mk2rbc's support for using a product name am: ebf79bfb4a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1845613

Change-Id: I3d464b450af8c1f79fdbee7e3a8593032ff53620
2021-10-05 21:18:29 +00:00
Cole Faust
ebf79bfb4a Remove mk2rbc's support for using a product name
Now that the product and board config pass makefiles
to mk2rbc, we don't need to support passing a product
name.

Bug: 201700692
Test: Manually
Change-Id: I787f0f98bc5ab3cefeefb7af8d342aba84769925
2021-10-05 11:05:02 -07:00
Paul Duffin
bf027e4e58 Retry: Separate hidden API flags needed in sdk snapshots for S and T am: 191be3a186
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1844294

Change-Id: Id8977b8160f175b736214428cae94ea27f95675b
2021-10-05 18:04:10 +00:00
Pedro Loureiro
cc203505b9 Add module-lib to droidstubs' supported sdk types
If the android.jar is not found in the module-lib folder, it falls back
to searching it in the system folder and then falls back on the public
folder.

This only brings the functionality, we are not yet using it.

Test: m nothing
Bug: 202023154
Change-Id: I99c9004740c8e51faf53ebc3ba2444e8164215f3
2021-10-05 15:40:46 +00:00
Paul Duffin
1e18e98b14 Allow implementation details to be excluded from signature patterns file
Previously, the signature-patterns.csv file (which was output in an sdk
snapshot) included implementation details, e.g. the names of classes
that are not part of any API, including the hidden API. This change
allows a bootclasspath_fragment module owner to customize the generated
signature patterns file to remove as many implementation details as
possible from the sdk snapshot. That means that implementation only
changes would not require that sdk snapshots be updated in sync with
the corresponding APEX.

Module owners can remove implementation in the following ways:
1) Limit the number of packages that are treated as split packages by
   explicitly specifying the split packages in the split_packages
   property. A split package is one whose classes are provided by
   separate bootclasspath_fragment modules and so the signature
   patterns has to include every class in that package provided by a
   specific bootclasspath_fragment module, including implementation
   classes, instead of just listing the package.

   The default is to treat all packages as being split, so if no
   split_packages is specified then it defaults to ["*"] which matches
   all packages. Assuming that no package was split unless specifically
   stated would require that all the modules that had split packages
   explicitly list them before this change could be submitted as
   without them this change would break the build.

   Once all existing modules with split packages have been updated to
   include them then the default may be changed.

2) Adding package prefixes for any hierarchy of packages that are
   owned solely by that bootclasspath_fragment. This removes the need
   to list the packages in that hierarchy, including implementation
   specific packages.

Bug: 194063708
Test: atest --host verify_overlaps_test signature_patterns_test
      m out/soong/hiddenapi/hiddenapi-flags.csv
      - manually change files to cause difference in flags to check
        that it detects the differences.
Change-Id: If2f90cfc41b6fff9fa4ac8b9d4973110938b9392
2021-10-05 15:47:05 +01:00
Paul Duffin
191be3a186 Retry: Separate hidden API flags needed in sdk snapshots for S and T
Previous change that was reverted: https://r.android.com/1835222
An additional test was added that revealed a bug in the previous change
which has been fixed here.

Previously, the behavior of the stub_flags and all_flags properties
was different between S and T. In S they contained paths for the
complete set of stub flags and all the encoded flags. However, in T
they contained filtered sets of flags which if used in S would prevent
build checks from detecting possible inconsistencies. Also, a new
signature_patterns property was added in T that is not supported in S.

This change creates separate properties/files for T and reverts the
behavior of the properties/files that were added in S back to how they
behaved in S. The new properties are called filtered_stub_flags and
filtered_flags.

The S and T properties are tagged with the appropriate
supported_build_releases tag to ensure that they are only output when
specifically targeted.

Bug: 197842263
Test: m nothing
Change-Id: I1ce0a3d6623dabf73e32af1a7457b9b444fc3b7c
2021-10-05 15:27:42 +01:00
Sorin Basca
d63116f5a9 Merge "OpenJDK 11: Adding jdk.internal.reflect to allowed package list" am: 6e06f911a5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1837335

Change-Id: I16588846c58c0bf8482e9f6002e5a07f8323cf51
2021-10-05 12:38:22 +00:00
Sorin Basca
6e06f911a5 Merge "OpenJDK 11: Adding jdk.internal.reflect to allowed package list" 2021-10-05 12:34:42 +00:00
Cole Faust
5abbecbc0f Merge "Make rbc-run accept a makefile instead of a product" am: e5fbd7706c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1843576

Change-Id: I0fb0c2c33c847e3aaf4c7791c9956698206360e3
2021-10-05 01:01:45 +00:00
Cole Faust
e5fbd7706c Merge "Make rbc-run accept a makefile instead of a product" 2021-10-05 00:49:48 +00:00
Yu Liu
e737a9912b Store build targets in the soong metrics.
Bug: 194519312
Test: Added unit test and verified the soong metrics file generated.
Change-Id: I832da2501e0e8d3435d4f92642cf45ddccb7f2ea
2021-10-04 13:24:48 -07:00
Christopher Parsons
f5a385f171 Merge "Remove more out-of-date items from denylist" am: b19d4cda2e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1844513

Change-Id: Ic7a0cebac496ca1d07145b4cd28439b4fd373e70
2021-10-04 19:44:07 +00:00
Christopher Parsons
b19d4cda2e Merge "Remove more out-of-date items from denylist" 2021-10-04 19:31:36 +00:00
Treehugger Robot
3e745e63f3 Merge "Bp2Build common properties auto-handling" am: d905146590
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1815376

Change-Id: I38f1063302ea90583a51e625076e6232b4364ab7
2021-10-04 19:20:28 +00:00
Treehugger Robot
d905146590 Merge "Bp2Build common properties auto-handling" 2021-10-04 19:02:07 +00:00