Commit Graph

3987 Commits

Author SHA1 Message Date
Colin Cross
f3a84bc1a6 Revert^2 "Build license metadata files in Soong" am: 4acaea9cbf am: d8395b1b2f am: c6d7cae3ca
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1918948

Change-Id: Id80b8181716cc7b5da0100fd29e9ebd865ff43d1
2021-12-11 04:32:39 +00:00
Colin Cross
d8395b1b2f Revert^2 "Build license metadata files in Soong" am: 4acaea9cbf
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1918948

Change-Id: I8682f46f7843e0d367b96a09135dad03e3df934c
2021-12-11 03:48:25 +00:00
Colin Cross
9d9dc0a0a4 Merge changes from topic "revert-1899703-AMWIVCREEV" am: 67938c2925 am: 34ca826598 am: 5400ba36b5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1918944

Change-Id: Ief89219f9cff1d842205febae3a43b607c22ba7a
2021-12-10 23:54:52 +00:00
Colin Cross
4acaea9cbf Revert^2 "Build license metadata files in Soong"
b3264f2090

Change-Id: I5ea5f7e29eb1dbc72b8b30f010006a25f5f72fac
2021-12-10 23:05:02 +00:00
Colin Cross
67938c2925 Merge changes from topic "revert-1899703-AMWIVCREEV"
* changes:
  Revert "Build license metadata files in Soong"
  Revert "Add dependency license annotations"
2021-12-10 23:04:45 +00:00
Colin Cross
b3264f2090 Revert "Build license metadata files in Soong"
Revert submission 1899703

Reason for revert: b/210158272
Reverted Changes:
I142c19284:Reuse license metadata files from Soong
Ife89b8f23:Add dependency license annotations
I8e7410837:Build license metadata files in Soong

Change-Id: I48f2bf2e2797ac9d38f7ece35ba616b823035607
2021-12-10 23:02:57 +00:00
Colin Cross
2904cf5cfc Build license metadata files in Soong am: 3dd2ff28ed am: 05ff6289c2 am: a25d6989dc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1899702

Change-Id: I1f39f285d2472c610077cca8175da7c6bed73864
2021-12-10 22:42:21 +00:00
Colin Cross
988e14cc4b Escape Host*Variable contents am: 1c35f243c5 am: 72d35eb0a5 am: 1e3709131f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1915494

Change-Id: If504de76766aad0e13eafee6342567ad39e22d55
2021-12-10 22:42:17 +00:00
Colin Cross
05ff6289c2 Build license metadata files in Soong am: 3dd2ff28ed
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1899702

Change-Id: I96620d254f43dd9e8cfe02d1ed1dbc201c9cd381
2021-12-10 22:04:43 +00:00
Colin Cross
72d35eb0a5 Escape Host*Variable contents am: 1c35f243c5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1915494

Change-Id: I78a98453a932c7cace65bfaf0c2d39a2469342e6
2021-12-10 22:04:40 +00:00
Colin Cross
b435744fdc Merge changes from topic "soong-license-metadata"
* changes:
  Add dependency license annotations
  Build license metadata files in Soong
  Escape Host*Variable contents
2021-12-10 21:43:49 +00:00
Inseob Kim
d788455703 Merge "Add BoardPlatVendorPolicy to soong config" am: fcaea66933 am: 8bc61f24aa am: 656ba20a64
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1913480

Change-Id: I820344c7b60a61924324c64e8ac4169a44a0c779
2021-12-10 13:03:08 +00:00
Inseob Kim
fcaea66933 Merge "Add BoardPlatVendorPolicy to soong config" 2021-12-10 12:13:36 +00:00
Remi NGUYEN VAN
4f2a9cb427 Merge "Relax apex package restriction for T+ jars" am: 4d5cd1f267 am: b68677917b am: 5d704c695e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1908871

Change-Id: Ia865d38f8ac71ce208d1452e39ac0c222a982ce2
2021-12-10 01:03:20 +00:00
Remi NGUYEN VAN
4d5cd1f267 Merge "Relax apex package restriction for T+ jars" 2021-12-10 00:15:17 +00:00
Treehugger Robot
c7c251787c Merge "The type assertion of DefaultableModule as Module is redundant Test: m nothing Bug: n/a" am: 37dd05bbbe am: 1bc4f14604 am: d640edaf69
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1914978

Change-Id: I3ffa0d2eb73f74ff7592a86dcf4b8f02288ce699
2021-12-09 21:39:40 +00:00
Treehugger Robot
37dd05bbbe Merge "The type assertion of DefaultableModule as Module is redundant Test: m nothing Bug: n/a" 2021-12-09 20:02:24 +00:00
Remi NGUYEN VAN
1fdd6ca88a Relax apex package restriction for T+ jars
The ART AOT exemption only applies to Q/R/S, so module jars that have
min_sdk T+ do not need to follow the module package restriction, even if
they are part of a Q/R/S module (but not loaded on Q/R/S).

Relax the restriction to only apply to jars that have min_sdk before T.

Bug: 208773835
Test: m (runs apex tests)
Change-Id: I2c3ad8984ca05ad763bf6162bd478f93ab4ee650
2021-12-09 18:28:47 +09:00
Colin Cross
0c631f19e9 Merge "Don't panic when DevicePrimaryArchType is called in a host only build" am: 9f5a9d1d54 am: 11f79516e2 am: 278415109a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1915495

Change-Id: I08b50779360189f4cd979369386a016c890345cd
2021-12-09 05:11:56 +00:00
Colin Cross
c53c37fad1 Don't panic when DevicePrimaryArchType is called in a host only build
Check the length of c.Targets[Android] before getting the first
element, and return Common if the length is set.  Fixes a panic
when a tradefed_binary is defined in a host-only build.

Test: aosp-build-tools build
Change-Id: I89f1dd13aa1aff5eb7d39e0b66eeedcb7d930fa0
2021-12-08 15:42:22 -08:00
Dan Willemsen
4d913d8528 Merge "Add Darwin x86_64+arm64 universal binary support" am: ce69757379 am: 1bd7543d6e am: b2a6b903fb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1884611

Change-Id: I106219bd0af5ba1ef0f8f96a71f3026d4b8eb07c
2021-12-08 23:38:45 +00:00
Colin Cross
3dd2ff28ed Build license metadata files in Soong
Soong has enough information to build the license metadata files
without resorting to the fixups required in Make.

Bug: 207445310
Test: m checkbuild
Change-Id: I8e74108376162b8fdb87ba098ebe94350aa1f7c4
2021-12-08 15:08:59 -08:00
Colin Cross
1c35f243c5 Escape Host*Variable contents
There are tests with "$" in the name, which becomes part of the
path.  Escape Host*Variable so that the path to a host binary
in a test doesn't get treated as a ninja variable.

Test: genrule_test.go
Change-Id: Ie50b13e94d8a30743c70b7f7c28bbab8afa73e5f
2021-12-08 15:08:59 -08:00
Usta
fe201fe158 The type assertion of DefaultableModule as Module is redundant
Test: m nothing
Bug: n/a

Change-Id: I5f7eea47a2f2bc81a0a5b9314e6a452c38226067
2021-12-08 18:03:23 -05:00
Dan Willemsen
ce69757379 Merge "Add Darwin x86_64+arm64 universal binary support" 2021-12-08 21:08:43 +00:00
Treehugger Robot
a0b46c1d06 Merge changes I08ec0b44,I79b5a1fc,I469d6558 am: 6abfb33784 am: 3bcefabfeb am: dc2accaba0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1907862

Change-Id: I189da72fe127e9717b2dc5e357f37263959d23a6
2021-12-08 18:45:10 +00:00
Treehugger Robot
6abfb33784 Merge changes I08ec0b44,I79b5a1fc,I469d6558
* changes:
  Allow java_sdk_library in an APEX to have higher min_sdk_version.
  Perform CheckMinSdkVersion for java_sdk_library.
  Add MinSdkVersion(ctx) method to ModuleWithMinSdkVersionCheck interface.
2021-12-08 17:58:24 +00:00
Liz Kammer
cf392311e6 Merge "Propagate headers from bazel to mixed builds" am: 92d4188c2b am: 8534a37261 am: 5da0c42a09
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1912212

Change-Id: I656710bf84a13af99b98712ee5934c5e21e8e5c2
2021-12-08 14:18:28 +00:00
Inseob Kim
1417880942 Add BoardPlatVendorPolicy to soong config
Bug: 205924657
Test: build
Change-Id: Ia0fe4fd916e539ee04aa0e8343068cc03bd9787c
2021-12-08 22:53:31 +09:00
Liz Kammer
92d4188c2b Merge "Propagate headers from bazel to mixed builds" 2021-12-08 13:24:08 +00:00
satayev
758968a700 Allow java_sdk_library in an APEX to have higher min_sdk_version.
Inidividual boot or system server jars may have higher min_sdk_version
than the contianing apex, since the runtime respects the values of
min/max_sdk_version; e.g. runtime would not load a boot jar with
higher min_sdk_version. This allows shipping new boot jars via apexes
that target older platforms.

Bug: 190818041
Test: presubmit
Change-Id: I08ec0b4463a17bc8265b948fe09da55eb4e52ac3
2021-12-08 11:36:34 +00:00
satayev
ad99149a62 Add MinSdkVersion(ctx) method to ModuleWithMinSdkVersionCheck interface.
Bug: 205923322
Test: presubmit
Change-Id: I469d655823e12a14bc0abaeb544a5dd2a6d3622f
2021-12-08 11:36:31 +00:00
Treehugger Robot
3b23e8bcb1 Merge "Add (obj|tidy)-*_os, and (obj|tidy)-*_subset targets" am: 939cb7b028 am: bf92b6d44e am: c028e47a3a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1852749

Change-Id: Iff32a1cdef6d911870a30200d4eca0382db7df8c
2021-12-08 06:58:12 +00:00
Treehugger Robot
939cb7b028 Merge "Add (obj|tidy)-*_os, and (obj|tidy)-*_subset targets" 2021-12-08 06:03:14 +00:00
Dan Willemsen
4745007bb1 Add Darwin x86_64+arm64 universal binary support
This is configured from Make by setting up Darwin+Arm64 as a HOST_CROSS
target (which is largely true, as binaries can't be executed on X86_64
machines). On the Soong side, it's a bit blurier, as we don't current
have any other users that are the same OS but not natively executable
(Linux/musl is executable, Windows/x86 is a different OS).

Instead of requiring cc_binary/etc to become multi-architecture-aware
and using something like common_first/MultiTarget, this defaults all
non-multi-architecture-aware modules to be built with both
architectures. It then adds a dependency with the
DarwinUniversalVariantTag so that supporting modules can get the outputs
of the other variant.

Cc uses that dependency tag to run lipo on shared libraries and binaries
so that the output of the x86_64 variant is actually a fat binary
including both architectures.

Bug: 203607969
Test: build sdk-repo targets on a Mac
Change-Id: Icbddb0a177c0ba19d3e0d11f8cf568e0d1ea3245
2021-12-07 22:01:25 -08:00
Romain Jobredeaux
6ba0a6a4a9 Merge "Initial bp2build converter for android_app." am: 4526269c2e am: f7a7a95c07 am: 019d78829d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1907394

Change-Id: If3d0529d27a617440cee0b95112dd896801b0ae6
2021-12-07 21:17:05 +00:00
Chih-Hung Hsieh
80783774b9 Add (obj|tidy)-*_os, and (obj|tidy)-*_subset targets
* The obj-* targets only call clang or clang++ to compile
  C/C++ files, like the tidy-* targets only call clang-tidy.
* Add (obj|tidy)-dir_os and module_os-(obj|tidy) phony targets
  to include only targets of the specified OS.
* Add (obj|tidy)-dir_os_subset and module_os_subset-(obj|tidy) phony targets
  to include only a subset of that OS target group.
  * Most clang-tidy runs produce the same warnings for all variants
    of an OS. The *_subset targets reduce runs over multiple variants.
  * The obj-*subset targets are useful for a quick test to compile
    at least one variant of every C/C++ file for each OS.
* The (obj|tidy)-soong phony target is changed to include only
  (obj|tidy)-top_level_directory targets instead of ALL
  module-(obj|tidy) targets in all subdirectories.
* For aosp_arm64-eng make tidy-* targets; count NINJA commands:
    tidy-soong                     381K
    tidy-soong_subset              106K
    tidy-soong_android             294K
    tidy-soong_android_subset       73K
    tidy-soong_linux_glibc          84K
    tidy-soong_windows              12K
    tidy-bionic                     12K
    tidy-bionic_subset               2.4K
    tidy-bionic_android             11.5K
    tidy-bionic_android_subset       2.1K
    tidy-bionic_linux_glibc          1K
    tidy-device_android              7K
    tidy-device_android_subset       5K
    tidy-hardware_android            3K
    tidy-hardware_android_subset     9K
    libfec_rs-tidy                   33
    libfec_rs_subset-tidy             9
    libfec_rs_android-tidy           18
    libfec_rs_android_subset-tidy     3
* For aosp_arm64-eng make obj-* targets; count NINJA commands:
    obj-soong                      399K
    obj-soong_subset               112K
    obj-soong_android              305K
    obj-soong_android_subset        75K
    obj-soong_linux_glibc           90K
    obj-soong_linux_glibc_subset    38K
    obj-soong_windows               12K
    obj-bionic                      15K
    obj-bionic_subset                3K
    obj-bionic_android              14K
    obj-bionic_android_subset        2.3K
    obj-bionic_linux_glibc           1.3K
    obj-system-core                  6K
    obj-system-core_subset           3K
    obj-frameworks-base             16K
    obj-frameworks-base_subset       6K
    libfec_rs-obj                    33
    libfec_rs_subset-obj              9
    libfec_rs_android-obj            18
    libfec_rs_android_subset-obj      3

Test: NINJA_ARGS="-n" WITH_TIDY=1 make some_obj_tidy_target;
      compare output commands from various phony targets
Bug: 199169329
Bug: 202769240
Change-Id: I186c45dc07c5884888c1063dfc09cf212ffb0ebf
2021-12-07 12:58:11 -08:00
Romain Jobredeaux
4526269c2e Merge "Initial bp2build converter for android_app." 2021-12-07 20:14:29 +00:00
Liz Kammer
eb2d6d1ffd Propagate headers from bazel to mixed builds
Bug: 208503274
Test: mixed_libc.sh
Change-Id: I0be57f2a22f48be3a919208db4034d2bd03c18c0
2021-12-07 10:25:11 -05:00
Romain Jobredeaux
1282c42484 Initial bp2build converter for android_app.
The only supported attributes at this point are:
- srcs
- manifest
- package_name
- resource_dirs
as they most easily map to bazel's android_binary's srcs, manifest, custom_package, and resource_files respectively.
Allow-listing all apps that use these fields, along with sdk_version and dex_preopt. The latter 2 are ignored by the converter,
- sdk_version because we're currently relying on a single pre-built SDK,
- dex_preopt because,
   1. though it is not supported in Bazel builds yet, it doesn't prevent the apps from building, and
   2. the apps being converted only use the dex_preopt attribute to disable dex_preopt, which is what is happening anyway.

Change-Id: I4a4f771eeb8f60a1cd4844b2ac1ce3df7c070e73
Test: ./build/bazel/scripts/run_presubmits.sh
Bug: 198224074
Bug: 203688791
2021-12-07 09:41:49 -05:00
Yi Kong
f0071759e5 Merge "addSamplingProfileGatherFlags is no longer needed" am: b0d167cb43 am: 84afb3787b am: 8a98aff182
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1908874

Change-Id: Id8e6c9021cbe08983932e0a4a0e0eae2cbed74aa
2021-12-07 05:17:51 +00:00
Yi Kong
b0d167cb43 Merge "addSamplingProfileGatherFlags is no longer needed" 2021-12-07 04:27:14 +00:00
Artur Satayev
44d0ef55da Merge "Add ModuleWithMinSdkVersionCheck type." am: a4fc08d204 am: 25f5783263 am: fe55ffd190
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1907860

Change-Id: I3bfb508247c9eb6d47ae006e705766b689977454
2021-12-06 17:38:10 +00:00
Artur Satayev
a4fc08d204 Merge "Add ModuleWithMinSdkVersionCheck type." 2021-12-06 16:53:28 +00:00
Liz Kammer
b8c8e8c6bf Merge "bp2build: support full/lite protos in cc libs" am: 85c0097d69 am: 03b6cf4e30 am: 42866b6eb7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1838061

Change-Id: I2281072f66d57da2b02d54a6376e939f266aa2b7
2021-12-06 15:34:32 +00:00
Liz Kammer
85c0097d69 Merge "bp2build: support full/lite protos in cc libs" 2021-12-06 14:46:34 +00:00
Jingwen Chen
cf33d8e025 Merge "Allowlist //build/soong/cc/{ndkstubgen,symbolfile}." am: a86cbd4a49 am: 8d6f36b4b1 am: b7601ceb3a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1906372

Change-Id: I1f4dfd8ee550dc57672f4c39eab4c72a68d169c6
2021-12-06 12:54:13 +00:00
satayev
b3fd411465 Add ModuleWithMinSdkVersionCheck type.
This is to help following refactor for individual modules to have their
own version of checking where needed.

For example, apk in apex may want to enforce it's own version of
CheckMinSdkVersion.

Bug: 205923322
Test: presubmit
Change-Id: Ia2fad6c52af39e21f65385bcb283f1e3adab5548
2021-12-06 12:05:48 +00:00
Jingwen Chen
a86cbd4a49 Merge "Allowlist //build/soong/cc/{ndkstubgen,symbolfile}." 2021-12-06 11:36:52 +00:00
Yi Kong
5ded619f3e addSamplingProfileGatherFlags is no longer needed
We already add the "-fdebug-info-for-profiling" flag globally by default.
Besides, Sampling PGO does not need additional target-specific build
flags, unlike instrumentation PGO.

This is preparation to separate out sampling pgo into a separate module.
NFCI.

Test: presubmit
Change-Id: Icb28a98c021a78db25d8cb5ca9694ed6b7367a8d
2021-12-06 08:14:00 +00:00