Commit graph

45016 commits

Author SHA1 Message Date
Treehugger Robot
ec01d2d719 Merge "Change default to require licenses property." am: 7bb0238418
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1818661

Change-Id: Ie6e749f3f9acd03c287b845c4e54a326383240b4
2021-09-13 19:39:03 +00:00
Treehugger Robot
7bb0238418 Merge "Change default to require licenses property." 2021-09-13 19:25:57 +00:00
Yi Kong
910cf32f49 Merge "Remove unused-but-set-{variable,parameter} from ClangUnknownCflags" am: 861441fa36
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1824620

Change-Id: Ieec9bdef68bb233e125e49d633803b39f200c81d
2021-09-13 19:07:01 +00:00
Yi Kong
861441fa36 Merge "Remove unused-but-set-{variable,parameter} from ClangUnknownCflags" 2021-09-13 18:54:15 +00:00
Treehugger Robot
1dee799ad3 Merge "Update clang version used for bindgen to r433403" am: 6e09abdf5c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1824516

Change-Id: I1c8b33d474ca741892f4731dfa9ec8a89c96e00a
2021-09-13 18:22:47 +00:00
Treehugger Robot
6e09abdf5c Merge "Update clang version used for bindgen to r433403" 2021-09-13 18:07:44 +00:00
Christian Wailes
f0caf82a7a Merge "Update the Rust prebuilt version number to 1.55.0" am: c3cb99e61b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1824023

Change-Id: I603720fb977f40a7aabb22b0aea0556a99c8af30
2021-09-13 16:55:54 +00:00
Christian Wailes
c3cb99e61b Merge "Update the Rust prebuilt version number to 1.55.0" 2021-09-13 16:39:37 +00:00
Chris Wailes
d23f0d07e1 Update the Rust prebuilt version number to 1.55.0
Bug: 199547393
Test: m rust
Change-Id: I05831a107b46019205c0a7d530b6f2a3b1beba75
2021-09-13 16:38:27 +00:00
Liz Kammer
dcd1b01464 Merge "Cleanup bp2build tests to reduce repetition" am: d11eeb8f77
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1824018

Change-Id: Id0cbe50f601e1b284a2cf9ac5579b734a7a127cc
2021-09-13 12:43:33 +00:00
Liz Kammer
dd34331163 Merge "bp2build: Split export_{includes,system_includes}" am: 15c90f5fe1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1822559

Change-Id: I35e5ac06bfaefeaf437af196249906dd517d7a5a
2021-09-13 12:43:23 +00:00
Liz Kammer
d11eeb8f77 Merge "Cleanup bp2build tests to reduce repetition" 2021-09-13 12:22:57 +00:00
Liz Kammer
15c90f5fe1 Merge "bp2build: Split export_{includes,system_includes}" 2021-09-13 12:22:19 +00:00
Yi Kong
a1ebc2d072 Remove unused-but-set-{variable,parameter} from ClangUnknownCflags
These warnings are now implemented by Clang.

Change-Id: I78d04216da0ca3d1db616c7b658ca6075b20e7f6
Test: presubmit
Bug: 197230471
2021-09-13 06:25:41 +00:00
Yi Kong
ef99688cff Update clang version used for bindgen to r433403
Bug: 197230471
Test: presubmit
Change-Id: If8885beb979492c0a0c6cc4e310a9e09fd86da7b
2021-09-12 15:22:28 +08:00
Treehugger Robot
0e7f8e9919 Merge "Don't use bugprone-easily-swappable-parameters for global tidy builds either" am: 07e7294a75
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1824475

Change-Id: I6f7e0578f6e934dbc89a5d06f532b7111d1c8d55
2021-09-11 10:36:47 +00:00
Treehugger Robot
07e7294a75 Merge "Don't use bugprone-easily-swappable-parameters for global tidy builds either" 2021-09-11 10:20:40 +00:00
Stephen Hines
4b721450c8 Don't use bugprone-easily-swappable-parameters for global tidy builds either
We turned this off in local tidy flags, but didn't disable it on global
tidy builds. Let's remove this for now, since the upkeep cost is large
on it, and it also is currently crashing in some cases.

Bug: http://b/199534745
Bug: http://b/194865868
Test: WITH_TIDY=1 m
Change-Id: Ife39ab4949c5baf825efff66326b276c6a2a59f4
2021-09-11 01:14:36 -07:00
Treehugger Robot
15982f7121 Merge "Add support for --optional-uses-libs to pom2bp" am: c521d5717d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1815186

Change-Id: I01f2f418035db90465d76d4ba8fbfa27be6825a8
2021-09-10 20:31:10 +00:00
Treehugger Robot
c521d5717d Merge "Add support for --optional-uses-libs to pom2bp" 2021-09-10 20:15:35 +00:00
Colin Cross
95d3141326 Merge "Make rust builds hermetic" am: 65e8f6d765
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1824021

Change-Id: I727a09cb1ec1e86e44039a1b1800ab986ad3c68a
2021-09-10 19:58:52 +00:00
Colin Cross
65e8f6d765 Merge "Make rust builds hermetic" 2021-09-10 19:51:20 +00:00
Chih-hung Hsieh
cd6242cc74 Merge "Pass TIDY_TIMEOUT to clang-tidy" am: aaa4c07f21
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1823596

Change-Id: I324448b5c311783119c263bc2c3ecc19c553974a
2021-09-10 19:48:23 +00:00
Pirama Arumuga Nainar
4c30b7f240 [rust/coverage] Pass -z,nostart-stop-gc to the linker am: 1799f9d7b4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1824020

Change-Id: I80d60e6da73f9be2044b5bfb356f915af4a45a1f
2021-09-10 19:48:14 +00:00
Chih-hung Hsieh
aaa4c07f21 Merge "Pass TIDY_TIMEOUT to clang-tidy" 2021-09-10 19:36:29 +00:00
Pirama Arumuga Nainar
1799f9d7b4 [rust/coverage] Pass -z,nostart-stop-gc to the linker
Bug: http://b/199203503

Upstream LLVM change 6d2d3bd0a6 made -z,start-stop-gc the default.  It
drops metadata sections like __llvm_prf_data unless they are marked
SHF_GNU_RETAIN.  https://reviews.llvm.org/D97448 marks generated
sections, including __llvm_prf_data as SHF_GNU_RETAIN.  However this
change is not in the Rust toolchain.  Since we link Rust libs with new
lld, we should use nostart-stop-gc until the Rust toolchain updates past
D97448.

Test: m unicode-xid_device_test_src_lib and verify that they have the
__llvm_prf_data section.

Change-Id: I55eb3622dae9bd789fbacfe708600316102c365f
2021-09-10 10:33:30 -07:00
Colin Cross
748c8c7e09 Make rust builds hermetic
Rust builds were picking up the crt objects and system libraries like
libc.so from /usr/lib/x86_64-linux-gnu/Scrt1.o and
/lib/x86_64-linux-gnu/libc.so.6.  Pass --sysroot to the linker to
point it to the glibc prebuilts.

Test: manual
Change-Id: I6540df8aef0e5c2258de77456d18a6052db627d4
2021-09-10 09:55:54 -07:00
Liz Kammer
8337ea4e7d Cleanup bp2build tests to reduce repetition
Test: go test bp2build tests
Change-Id: Ia96a1a8ed58d5be13fedf31e1667670efdfe3aef
2021-09-10 10:14:09 -04:00
Treehugger Robot
03f327c83e Merge "Avoid duplicate module names in the error from ModuleForTests." am: eee562f950
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1823277

Change-Id: I0c4865071f4aba40f63ab34e0f9676be1063e634
2021-09-10 09:29:42 +00:00
Treehugger Robot
eee562f950 Merge "Avoid duplicate module names in the error from ModuleForTests." 2021-09-10 09:15:06 +00:00
Yi Kong
7d927b62bf Merge "Switch to clang r433403" am: 6afa749d1d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1814448

Change-Id: I19285347bc70349ce02de3d8b2b6793a4d56fa75
2021-09-10 04:39:04 +00:00
Yi Kong
6afa749d1d Merge "Switch to clang r433403" 2021-09-10 04:21:54 +00:00
Yi Kong
e82732916a Switch to clang r433403
Bug: 197230471
Test: presubmit
Change-Id: I374a66deb785bae99953ea23c67f873f33c2081b
2021-09-10 04:20:49 +00:00
Chih-Hung Hsieh
95dfbce28b Pass TIDY_TIMEOUT to clang-tidy
* Tested with a clang-tidy wrapper that dumps TIDY_TIMEOUT.

Test: make WITH_TIDY=1 TIDY_TIMEOUT=42
Bug: 199451930
Change-Id: I86580225bad7487da786db2ba62c09bd99d70c67
2021-09-09 19:58:41 -07:00
Martin Stjernholm
98e0d88aac Avoid duplicate module names in the error from ModuleForTests.
#codehealth

Test: m nothing
Change-Id: Ia7c3191440452ce04782701bc6ef99251e55af4d
2021-09-09 21:34:02 +01:00
Liz Kammer
5fad501aeb bp2build: Split export_{includes,system_includes}
The specification of exporting includes vs system includes has an impact
on inclusion sort order. Conflating the two caused some symbols to not
be resolved correctly.

Bug: 198403271
Test: build/bazel/ci/bp2build.sh
Test: USE_BAZEL_ANALYSIS=1 m libbacktrace_no_dex succeeds with libc++_*
      modules removed from mixed build denylist (would fail otherwise)
Change-Id: I08aff253d8962dc678ed10214b1c171330e0fe19
2021-09-09 15:59:05 -04:00
Peter Collingbourne
4ceae5b280 Merge "Read LLVM version from $LLVM_PREBUILTS_VERSION if set." am: e168f15ab9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1822335

Change-Id: I4e9049d5717b1a9ed87f9232ced1e4e7f995ba55
2021-09-09 18:36:07 +00:00
Bob Badour
65ee90a362 Change default to require licenses property.
Please do not roll back.

If you have recently created a new Soong module type, please make sure
it supports the `licenses` property.

If your build on an older branch fails due to this change, please
configure your build to set `ANDROID_REQUIRE_LICENSES=false` in the
environment.

If running from the command line, the following will work:

export ANDROID_REQUIRE_LICENSES=false; m -j ...

Previously defaulted to not require property unless overridden in env.

Bug: 151177513

Test: m all

Change-Id: Ib295658f978511d07197c295f04a6f25f7d83686
2021-09-09 18:26:56 +00:00
Peter Collingbourne
e168f15ab9 Merge "Read LLVM version from $LLVM_PREBUILTS_VERSION if set." 2021-09-09 18:17:11 +00:00
Treehugger Robot
16010fe5cd Merge "Cleanup unused code for bp2build conversion." am: 4011ebb12d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1819237

Change-Id: I41d4bdf23a5d17c74e1897a6d42a0b3a22fd865e
2021-09-09 13:17:31 +00:00
Rupert Shuttleworth
545ed91fc0 Move genrule tests to genrule_conversion_test.go. am: c5fa306162
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1821932

Change-Id: Ibf8cdb61a60ca2a37de0c4fb3bfb2ea382efc7ac
2021-09-09 13:17:18 +00:00
Treehugger Robot
4011ebb12d Merge "Cleanup unused code for bp2build conversion." 2021-09-09 13:12:04 +00:00
Rupert Shuttleworth
c5fa306162 Move genrule tests to genrule_conversion_test.go.
Test: go test

Change-Id: Ice1ed23d008d26cce0a4feca5bfcab51febcea1b
2021-09-09 06:19:02 -04:00
Treehugger Robot
1309335a4c Merge changes I6df9a14d,I830c53ef am: 62b843b90f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1818018

Change-Id: I30c26d7caca2f2cffe1779b686ea160c1683fb84
2021-09-09 10:07:19 +00:00
Treehugger Robot
62b843b90f Merge changes I6df9a14d,I830c53ef
* changes:
  bp2build: allowlist //external/libcap/...
  bp2build: don't generate filegroups (or error) if it contains a file with the same name.
2021-09-09 09:51:33 +00:00
Mohammad Islam
17544fe23a Merge "Relax restriction on suffix of apex_set filename to include .capex" am: 385cde82d4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1821656

Change-Id: I91189bd060d0c365892234daab5a59b70a8018c7
2021-09-09 09:08:51 +00:00
Mohammad Islam
385cde82d4 Merge "Relax restriction on suffix of apex_set filename to include .capex" 2021-09-09 08:21:27 +00:00
Jingwen Chen
1e347860d5 bp2build: allowlist //external/libcap/...
This builds cap_names.list.h, which uses an eponymous filegroup
"generate_cap_names_list.awk" in Soong, but uses the file target
directly in Bazel.

This also improve filegroup support for mixed builds, by issuing a
cquery call _without_ arch. Filegroups in Soong don't have configurable
properties, so don't generate Bazel filegroups into buildroot's
config_nodes (which was x86_64 by default).

The mixed_build_root now looks like this:

```
config_node(...)
config_node(...)
config_node(...)
config_node(...)

...

filegroup(name = "common",
    srcs = ["@//bionic/linker:linker_sources_x86",
            "@//bionic/libc:kernel_input_headers",
            "@//system/timezone/apex:com.android.tzdata-androidManifest",
            "@//external/libcap:generate_cap_names_list.awk",
            "@//bionic/linker:linker_sources_arm64",
            "@//bionic/linker:linker_sources",
            "@//bionic/libc:libc_sources_shared_arm",
            "@//bionic/linker:linker_sources_x86_64",
            "@//bionic/libc:all_kernel_uapi_headers",
            "@//build/bazel/examples/apex/minimal:build.bazel.examples.apex.minimal-file_contexts",
            "@//system/core/libcutils:android_filesystem_config_header",
            "@//bionic/libc:libc_sources_static",
            "@//bionic/linker:linker_sources_arm",
            "@//bionic/libc/tools:bionic-gensyscalls",
            "@//bionic/tools:bionic-generate-version-script",
            "@//bionic/libc:libc_sources_shared"],
)

mixed_build_root(name = "buildroot",
    deps = [":x86",
            ":arm64",
            ":arm",
            ":common",
            ":x86_64"],
)
```

Test: CI
Fixes: 198595323
Fixes: 198235838
Change-Id: I6df9a14da556cf358d96e6a99b514f66a2638295
2021-09-09 07:54:16 +00:00
Jingwen Chen
5146ac02a1 bp2build: don't generate filegroups (or error) if it contains a file
with the same name.

Also add capability to test for errors raised in bp2build mutators /
contexts.

This CL does two things to filegroups:

1) If the filegroup has only 1 source file with the same name as itself,
don't generate a filegroup target. Instead, dependents will depend
directly on the Bazel file target instead.

2) If the filegroup has more than 1 source file and 1 of them has the
same name as itself, the bp2build mutator will error out. If bp2build
on CI passes, it means that the source tree / product we're testing
against does not have such a case (which seems to be true for most
source trees).

Either way, this will allow us to be unblocked for most of the errant
filegroups (case 1) in the tree.

Test: CI
Test: New test cases in filegroup_conversion_test.go

Fixes: 194762573
Change-Id: I830c53efc8808569afe3c5f9f08436855bcdafed
2021-09-09 07:12:13 +00:00
Lukács T. Berki
c08fff0423 Merge "Implement cleanups requested in aosp/1818245:" am: 4b221b3cf9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1821792

Change-Id: Icb9161bb48a4f8fed83cdb115ba7c8412625c3b6
2021-09-09 06:24:32 +00:00