Commit graph

24969 commits

Author SHA1 Message Date
Ivan Lozano
74fe471e7a Merge "rust: Fix rust_bindgen implicits" 2020-09-09 22:04:38 +00:00
Ivan Lozano
0eef27a556 Merge "rust: Pass lld flags from cc to rust linker args." 2020-09-09 22:03:23 +00:00
Colin Cross
617b88a288 Create os and arch variants for bootstrap Go modules
AddFarVariationDependencies was broken, which allowed modules to add
dependencies on bootstrap Go modules using os and arch variations
even though boostrap Go modules did not have any variations.  Mutate
bootstrap Go modules in the os and arch mutators so that they have the
expected os and arch variations.

This relands Ida7bc75a51ab1d2d38a6be11f574399097380cc9 with fixes
to also mutate *bootstrap.goPackage modules so that they can find a
matching *bootstrap.goBinary module when creating their pluginFor
dependency, and to create a variation for linux_bionic when it is
enabled so that linux_bionic builds can package Go binaries.

Also requries https://github.com/google/blueprint/pull/320 to
support multiple variants of bootstrap Go modules.

Test: all soong tests
Change-Id: Ibc627aa262c298a076d171a4c21b0b9c2a7b0ada
2020-09-09 14:44:57 -07:00
Ivan Lozano
6d45a9863a rust: Pass lld flags from cc to rust linker args.
Rust is not passing the sysroot flag to Clang when invoking it as the
linker. This means files from the host may leak in, and host targets
may fail if sysroot files are not available from the host.

This patch prepends the lld flags from cc into rust linkargs. This
pulls in the sysroots flag, and also ensures that we remain in sync
with linkage flags used in cc.

The '-Wl,--no-undefined-version' from cc is overridden to avoid
missing version assignment errors for rust's generated alloc
functions.

Bug: 167690054
Test: cd external/rust; mma
Test: strace -f -e %file <host libstd.dylib.so build command> pulls
      from correct sysroots.
Change-Id: Ic40597f546f3b112012155614056afed487c6ca1
2020-09-09 14:20:00 -04:00
Jiyong Park
4afa2e2682 LinuxBionic supports arm64
LinuxBionic now supports arm64 architecture in addition to the existing
x86_64 arch. This is to make it possible to build host tools like adb,
fastboot, crosvm, etc. for Linux/ARM on regular Linux/x86 machines.

The arm64 target can be selected in various ways in Android.bp files:

   - target.host (because this is still considered as a host target)
   - target.linux (provided that the module is also enabled for host)
   - target.linux_bionic (use the OS name directly)
   - target.linux_bionic_arm64 (OS name + arch combo)
   - target.linux_arm64 (provided that the module is also for host)
   - target.not_windows
   - arch.arm64

The toolchain for the new target is almost the same as the toolchain
config for Android/ARM64. One notable difference is that the clang
triple is aarch64-linux instead of aarch64-linux-android, so that
__ANDROID__ is not defined for the new OS type.

Bug: 134795810
Test: HOST_CROSS_OS=linux_bionic HOST_CROSS_ARCH=arm64 m nothing

Change-Id: If4300583edfb6d75bd4d984b38f73b6a406b4447
2020-09-09 21:57:10 +09:00
Ivan Lozano
4fa4c9ef84 Merge "[rust] Fix missing libclang for bindgen on darwin." am: 29139f9c02
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1421828

Change-Id: Ic3a90644291856a0b4b89f72ea8886161109ed92
2020-09-09 12:53:51 +00:00
Ivan Lozano
29139f9c02 Merge "[rust] Fix missing libclang for bindgen on darwin." 2020-09-09 12:27:34 +00:00
Jingwen Chen
d8004efff2 Generate .bzl rule definitions for every module type in Soong, and
surface module properties as attributes.

This CL maps int, bool, string and string_list module props from Soong
modules into their respective Bazel targets.

With this CL, you can now query modules based on their properties. For
example:

$ bazel query 'attr(nocrt, 1, //...)'
$ bazel query 'attr(apex_available, //apex_available:platform, //...)'
$ bazel query //art/dalvikvm:dalvikvm--linux_glibc_x86_64 --output=build | grep compile_multilib

Test: m bazel_overlay && cd out/soong/bazel_overlay && bazel cquery 'attr(apex_available, com.android.runtime, //...)'

Test: soong_build tests

Fixes: 162720644
Fixes: 164320355
Change-Id: Iea8e594b952feccac3281f36dd6bdee8e7d62c3a
2020-09-09 09:51:45 +00:00
kellyhung
af286f3312 Add test_mainline_module option. am: 74b00521f8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1402513

Change-Id: I4824247226e786363cf94815576a93da3deb73da
2020-09-09 08:06:35 +00:00
Jiyong Park
41f637d653 Notice files for prebuilt_etc are included in APEX
This change fixes a bug that notice files for some module type (e.g.
prebuilt_etc) were not included in APEX. This happened because we relied
on WalkPayloadDeps which actually doesn't traverse module types that
don't implement ApexModule interface. prebuilt_etc is one such module
type. Fixing the problem by also iterating the filesInfo array which
has info about all modules that are included in the APEX.

Bug: 166575301
Test: m com.android.tzdata and inspect the built artifact.
NOTICE.html.gz is there.

Change-Id: Iceb055b60184aef2a3e65e44680304853eb79a53
2020-09-09 13:19:56 +09:00
kellyhung
74b00521f8 Add test_mainline_module option.
Bug: 165425972

Test: m HelloWorldTests
Change-Id: I6e60b3895328c4f7aef0bfb30dcdefc30ee1d8ed
2020-09-09 02:15:39 +00:00
Treehugger Robot
9ef1f7d96a Merge "Don't assume host arch is always x86" am: daf735287b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1415953

Change-Id: I049556891890833c1e7db6483e5ee6446714583e
2020-09-09 00:32:18 +00:00
Treehugger Robot
daf735287b Merge "Don't assume host arch is always x86" 2020-09-09 00:13:50 +00:00
Treehugger Robot
9e1ba22f14 Merge "Add vendor snapshot usage test" am: f8123919aa
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1420809

Change-Id: I9b22b04a02f6b0e0fd6e76bd58a9e520e9c4d064
2020-09-09 00:05:23 +00:00
Treehugger Robot
f8123919aa Merge "Add vendor snapshot usage test" 2020-09-08 23:48:06 +00:00
Ivan Lozano
54a8ee12fe [rust] Fix missing libclang for bindgen on darwin.
The LIBCLANG_PATH provided to bindgen should point to the directory
containing libclang, not the file itself.

Bug: 167977778
Test: m profcollectd
Change-Id: Iabd9970a763c192249b401a618a2d6990b02eab0
2020-09-08 13:13:07 -04:00
Ulyana Trafimovich
0f13eff149 Merge "Be more strict about unknown install <uses-library> paths." am: 117a5ef307
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1418529

Change-Id: Ib28e902e7f8ec57a15ef50692024cd37a96696bc
2020-09-08 15:34:50 +00:00
Ulyana Trafimovich
117a5ef307 Merge "Be more strict about unknown install <uses-library> paths." 2020-09-08 15:21:30 +00:00
Jiyong Park
87788b5247 Don't assume host arch is always x86
This change fixes some places where host arch is assumed to be x86 to
form a path element like linux-x86. In preparation for non-x86 host
targets, the host arch part is derived from the context.

In addition, InstallForceOS() is refactored so that it can override not
only OsType, but also ArchType. Without this, the paths for the
robolectic modules will be changed from linux-x86 to linux-common, which
breaks several other places where the old paths are expected.

Bug: 134795810
Test: m
Change-Id: Ib38c715948ae546e55021ece82bac1d82e9e5da0
2020-09-08 15:12:10 +09:00
Paul Duffin
4d38789695 Merge "Propagate vendor_available property through to sdk snapshot" am: 4964a5e000
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1398472

Change-Id: I913a8e3cfd7eebb0a53ecd591b1bf12f69fa00b2
2020-09-07 15:20:07 +00:00
Paul Duffin
4964a5e000 Merge "Propagate vendor_available property through to sdk snapshot" 2020-09-07 14:58:20 +00:00
Ulya Trafimovich
045e11ad0d Be more strict about unknown install <uses-library> paths.
Allow default install paths only for compatibility libraries. For other
libraries that are explicitly specified in `uses_libs` and
`optional_uses_libs` unknown install path should be an error.

Bug: 132357300
Test: lunch cf_x86_phone-userdebug && m
Change-Id: I2209c90a939a8aa46c42e13bb42d09c07e4d0895
2020-09-07 13:58:51 +01:00
Inseob Kim
5f58ff7839 Add vendor snapshot usage test
In addition to capture test, this adds vendor snapshot usage test to
ensure the snapshots of BOARD_VNDK_VERSION are used correctly.

Bug: 167642944
Test: m nothing
Change-Id: I200c95626479a2b2d982edd7488d816e01376734
2020-09-07 19:56:43 +09:00
Ulyana Trafimovich
99bd329274 Merge "Allow non-SDK Java libraries to masquerade as <uses-library>." am: bb3467d297
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1417188

Change-Id: If25aaa0174091e966cc5c6b16063b6486a7b4ab6
2020-09-07 10:23:53 +00:00
Ulyana Trafimovich
bb3467d297 Merge "Allow non-SDK Java libraries to masquerade as <uses-library>." 2020-09-07 09:49:07 +00:00
Mark Chien
288f40ba51 Merge "Include bpf program in APEXes" am: 66a0ae60f8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1418308

Change-Id: I86983c1012615e95d1d9aac875a52e92248a17b8
2020-09-04 09:11:22 +00:00
Mark Chien
66a0ae60f8 Merge "Include bpf program in APEXes" 2020-09-04 08:58:21 +00:00
Treehugger Robot
da55e8208f Merge "Iterate <uses-library> in deterministic order in manifest_fixer." am: bfb98ece49
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1418533

Change-Id: I42df02457960f99d3257d131524d8005e2c7a97e
2020-09-04 01:17:25 +00:00
Treehugger Robot
bfb98ece49 Merge "Iterate <uses-library> in deterministic order in manifest_fixer." 2020-09-04 00:45:48 +00:00
Treehugger Robot
48e2acaf99 Merge "Add imports_compile_dex to prebuilt_apis" am: cda9a92efb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1418868

Change-Id: I29a69d3fd58d9bd7d02ad27fc5b9b9b54b633f63
2020-09-04 00:05:40 +00:00
Treehugger Robot
cda9a92efb Merge "Add imports_compile_dex to prebuilt_apis" 2020-09-03 23:50:17 +00:00
Bill Peckham
f3bf78650a Merge "Add exclude_from_vendor_snapshot property, related logic" am: e1359af34d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1416430

Change-Id: I89da13623f047a1651fb99b6a6ccc575cc75171c
2020-09-03 18:06:37 +00:00
Martin Stjernholm
837ee1a6df Symlink prebuilt binaries on host.
This means binaries will run from their source location and look up
shared libs relative to there.

Test: m nothing
Test: Set up a prebuilt binary with shared libs, check that it can
  be executed during build, and check that its symlinks get updated
  when a shared lib is touched.
Bug: 145934348
Change-Id: I1a600c7163ce0ec34ee8caf0ffe87fef4feb3064
2020-09-03 19:05:18 +01:00
Bill Peckham
e1359af34d Merge "Add exclude_from_vendor_snapshot property, related logic" 2020-09-03 17:52:29 +00:00
Paul Duffin
d1edbd4eed Propagate vendor_available property through to sdk snapshot
Test: m nothing
Change-Id: I68dcba111d290ae8a84c2bc023e1a4e0eaa43408
2020-09-03 18:49:35 +01:00
Paul Duffin
891e77641d Remove unnecessary methods/fields of DefaultsModule/Base am: 3f98d148df
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1418390

Change-Id: Ib44fe28b451daa19ef9b7fec83fc549924ba5024
2020-09-03 15:41:27 +00:00
Paul Duffin
f2dc411692 Extract dist properties from commonProperties am: ed87513b0b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1418389

Change-Id: I9a59d1a4154409a6a3d1efa590cccd2064b6c389
2020-09-03 15:18:46 +00:00
Ulya Trafimovich
d2c7ddc82a Iterate <uses-library> in deterministic order in manifest_fixer.
Bug: 132357300
Test: lunch cf_x86_phone-userdebug && m
Change-Id: Ideb7e0f7beae8c80561f841b8ce9129003f1aa96
2020-09-03 15:52:01 +01:00
Paul Duffin
3f98d148df Remove unnecessary methods/fields of DefaultsModule/Base
The commonProperties and defaultsVisibilityProperties fields are only
used as containers for default values for properties and only within
the InitDefaultsModule() and so can be removed and replaced with an
empty structure instead.

Test: m checkbuild and TH
Change-Id: Ic5038d6b84b33afdf4859ced08e59871b9cde4a2
2020-09-03 10:12:10 +01:00
Paul Duffin
ed87513b0b Extract dist properties from commonProperties
Common properties are automatically inherited from a parent module
(i.e. one that calls CreateModule()) to the child module that it
creates. This makes no sense for dist/dists properties so this change
extracts them into their own structure separate to the
commonProperties.

Test: m checkbuild and TreeHugger
Bug: 160448975
Change-Id: Icceb20455e13394dd3b3bce464fb9bb34882d6c3
2020-09-03 10:12:10 +01:00
Yi Kong
7daf77bbc6 Merge "Revert "Revert "[pgo] Return updated Flags after adding flags for PGO/AFDO""" am: 4f78c512d4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1418988

Change-Id: I73355f33044be0378e395f06f2d3b52eeed08f59
2020-09-03 07:41:57 +00:00
Yi Kong
4f78c512d4 Merge "Revert "Revert "[pgo] Return updated Flags after adding flags for PGO/AFDO""" 2020-09-03 07:25:24 +00:00
Ramy Medhat
16f23a4038 Check UseRBE is set before replacing any template with the RE version.
Test: presubmit
Change-Id: I6df58b4e700f0d231367af2710672d731d20a736
2020-09-03 01:29:49 -04:00
Colin Cross
6deda0a39a Merge "Revert "Create os and arch variants for GoBinaryTool modules"" am: 02789ab327
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1419428

Change-Id: I3d563ce07c76ae3d0200be599f7576d4253b3bcd
2020-09-03 04:31:55 +00:00
Colin Cross
02789ab327 Merge "Revert "Create os and arch variants for GoBinaryTool modules"" 2020-09-03 03:46:26 +00:00
Colin Cross
d4bdabcfad Revert "Create os and arch variants for GoBinaryTool modules"
This reverts commit 1ec1255476.

Reason for revert: b/167632665, broke linux_bionic builds.

Change-Id: I544fb5fd8aab06efa5618f076af3032271d4020f
2020-09-03 03:45:42 +00:00
Treehugger Robot
cab67c0dff Merge "AutoGen: Support NativeTest with vendor namespace." am: 52ddbe25f9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1399147

Change-Id: I1d18daede7426969383666263a2a3aef27a5bc37
2020-09-03 03:07:06 +00:00
Treehugger Robot
52ddbe25f9 Merge "AutoGen: Support NativeTest with vendor namespace." 2020-09-03 02:26:11 +00:00
Colin Cross
90d0500699 Merge changes I59b7a32a,Ida7bc75a am: 0329f2398c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1406259

Change-Id: I9b2b709c59630394aa528c64b4fbe60b52d50be5
2020-09-03 00:21:49 +00:00
Colin Cross
0329f2398c Merge changes I59b7a32a,Ida7bc75a
* changes:
  Only request image and version variations for device SDK dependencies
  Create os and arch variants for GoBinaryTool modules
2020-09-02 23:51:53 +00:00