Commit graph

24991 commits

Author SHA1 Message Date
Colin Cross
3146c5cd67 Create fewer empty version variants
Don't create empty version variants for binaries, objects, rust
rlibs or rust dylibs.

Test: no change to build.ninja
Change-Id: I62d4d43da476eafdb258a08b5ada758bb2971a1a
2020-10-05 18:57:21 -07:00
Colin Cross
1348ce3f13 Don't make SplitPerApiLevel imply UseSdk
UseSdk was returning true when SplitPerApiLevel returned true,
which was causing the platform variant of SplitPerApiLevel
module to compile against the SDK.  Check SplitPerApiLevel
separately in the sdkMutator instead.

Test: m checkbuild
Change-Id: I0ae667d48a3b7b96709a6cad8e8ea9701659fc2a
2020-10-02 13:00:19 -07:00
Colin Cross
b6135218a4 Remove vendor crt special case
It doesn't seem to be necessary, crt objects can get headers via
local_include_dirs.

Test: m checkbuild
Change-Id: Id357adc054c85576aa9935d0acbee5f1ae3dcbff
2020-10-02 13:00:19 -07:00
Colin Cross
9f720ce52a Fix apex_test.go and add it to Android.bp
apex_test.go wasn't listed in the Android.bp file, which allowed
it to bitrot.  Make the API level methods take a PathContext
so that they can be called from a test using configErrorWrapper.
Also fix an int that was converted to a string.

Test: apex_test.go
Change-Id: I1ff87134c837bd5d344d22550baabde10d1b0b2e
2020-10-02 13:00:14 -07:00
Colin Cross
973f46703b Merge changes from topic "sanitizer-runtime-stubs"
* changes:
  Add version dependencies to sanitizer runtime dependencies
  Fix prebuilt library stubs
  Track allowed transitive deps in any updatable module.
2020-10-02 01:06:10 +00:00
Kris Alder
0f1a0f7a81 Merge "add acknowledgements field to fuzz_config" 2020-10-01 23:58:01 +00:00
Ivan Lozano
45dda43df0 Merge "rust: Refactor staticStd to stdLinkage" 2020-10-01 12:25:38 +00:00
Paul Duffin
3a7e672abe Merge "Add support for using sdk_version: "module_<ver>"" 2020-10-01 10:36:23 +00:00
Colin Cross
e7257d2019 Add version dependencies to sanitizer runtime dependencies
The hwasan runtime has stubs, make the function to add all version
variants of a shared library available to the sanitizer mutator.

Test: m checkbuild
Change-Id: Ie4124022140f8520834d7bf7b59f0499cd381083
2020-09-30 21:17:59 +00:00
Colin Cross
d48fe734cd Fix prebuilt library stubs
There were multiple stacked issues with prebuilt library stubs that
cancelled eachother out.  Prebuilts were never considered to be
DirectlyInAnyApex by the AndroidMk logic to handle stubs libraries
because it looked it up in the global list of modules in apexes
using the name with the "prebuilt_" prefix.  Fixing that to use
ctx.BaseModuleName() exposed a second issue, that stubs variants
for prebuilt libraries were never created, so there was no latest
version to expose to Make.

Making the *prebuiltLibraryLinker type work with all of the
methods that handle stubs should really be done with an interface
and methods implemented on *libraryDecorator, but that would
also cause other types like that embed libraryDecorator to
participate in stubs that may trigger more issues.  I'd like
to replace those methods anyways, so just manually handle
*prebuiltLibraryLinker for now.

Test: m checkbuild
Change-Id: I1267ee01659ad9ab11d75318c6c6bdbf8f72a061
2020-09-30 21:17:51 +00:00
Artur Satayev
4e1f2bd0d8 Track allowed transitive deps in any updatable module.
Instead of tracking per module and per module variant, track allowed
list of dependecies for all modules combined. This avoids issues with
different products and different downstream branches having different
build graphs.

To compare allowed_deps.txt vs head, run:
:; m -j out/soong/apex/depsinfo/new-allowed-deps.txt.check

To update source allowed_deps.txt, run:
:; build/soong/scripts/update-apex-allowed-deps.sh

Bug: 149622332
Test: m
Change-Id: Ic518fbd9ebfe1b46aaf9a58df731780a7e5a676b
Merged-In: Ic518fbd9ebfe1b46aaf9a58df731780a7e5a676b
(cherry picked from commit 453555083b)
(cherry picked from commit e5207cd9a6)
2020-09-30 21:17:42 +00:00
Paul Duffin
fb6ae5bc73 Add support for using sdk_version: "module_<ver>"
Fixes a panic when trying to build something with
sdk_version: "module_30".

Test: m nothing
Change-Id: I9b2ce50957f59e2bead335ffa58888e15cda1f78
2020-09-30 16:20:17 +01:00
Thiébaud Weksteen
996de36d0f Merge "rust: document manual configuration for rustfmt" 2020-09-30 14:41:14 +00:00
Thiébaud Weksteen
4f6c766992 rust: add darwin as host arch
Bug: 169739272
Test: m nothing
Change-Id: I3ef2a3dd7e80b9fe47edb6eb04ed9d37e8d58096
2020-09-30 14:16:12 +02:00
Thiébaud Weksteen
425a542e2b rust: document manual configuration for rustfmt
Currently, rustfmt requires to be enabled per repository. Add a comment
near the current project allowed_list as a reminder.

Test: None
Bug: 160223496
Change-Id: Iecf8d5b693620541a00d8ddc905549652025eed9
2020-09-30 08:37:42 +00:00
Thiébaud Weksteen
d2ff08710b Merge changes Icbbf176c,I52beadc8
* changes:
  rust: Add ref to generated sources (aidl, bindgen)
  rust: refactor projectGeneratorSingleton
2020-09-30 08:21:36 +00:00
Yi Kong
21de510915 Merge "Do not implicitly turn on lto for static libraries" 2020-09-30 01:42:10 +00:00
Kris Alder
2598c9b350 add acknowledgements field to fuzz_config
This will be used to track who should be recognized for any CVEs
resulting from bugs found by a fuzz target.

Bug: 145745999
Test: n/a
Change-Id: I21e065ab8013d013b1d9f42981c729b996163387
2020-09-29 22:28:18 +00:00
Treehugger Robot
025ae97b0e Merge "Add support of test data to python_host_test" 2020-09-29 21:56:19 +00:00
Thiébaud Weksteen
a6351caf12 rust: Add ref to generated sources (aidl, bindgen)
Test: SOONG_GEN_RUST_PROJECT=1 m nothing; Edit
  system/security/keystore2/selinux/src/lib.rs;
  Check name resolution in IDE.
Bug: 168263887
Change-Id: Icbbf176c4355c3043807ce3fe0c3967c4a1374e2
2020-09-29 20:23:49 +02:00
Yi Kong
e2577141ba Do not implicitly turn on lto for static libraries
For global ThinLTO, don't implicitly turn on LTO for static libraries,
but instead rely on mutator to generate correct variants.

Bug: 169004486
Test: GLBOAL_THINLTO=true m
Change-Id: I9cdeea706ec6dd4ad31f55b9e12a96b42176aa89
2020-09-30 01:13:57 +08:00
Thiébaud Weksteen
3805f5cd2e rust: refactor projectGeneratorSingleton
Move the project and knownCrates arguments to attributes of
projectGeneratorSingleton.

Test: SOONG_GEN_RUST_PROJECT=1 m nothing
Change-Id: I52beadc8b3ba68c275ec940a6be51c2645983a6c
2020-09-29 19:08:02 +02:00
Treehugger Robot
6c76f18aae Merge "Don't include artifacts for host-cross targets" 2020-09-29 14:03:05 +00:00
Martin Stjernholm
b7c77bd889 Merge "Retain all stubs versions in the snapshot." 2020-09-29 13:59:05 +00:00
Paul Duffin
41b0876c10 Merge "Allow java_sdk_library to specify doctags_files" 2020-09-29 13:55:53 +00:00
Martin Stjernholm
dc6f2b06be Merge "Propagate all sanitizer flags in SDK snapshots." 2020-09-29 10:43:08 +00:00
Jiyong Park
ccb406fc9c Don't include artifacts for host-cross targets
When building an APEX, the build system included artifacts from all
targets that are returned from ctx.MultiTargets(). This however has
became a problem as we add new host targets like linux_bionic_arm64.
When there are multiple host targets having different OSes,
ctx.MultiTargets() returns one target per a host OS. For example, when
linux_bionic_arm64 is enabled, ctx.MultiTargets() returns the following
two targets because linux_bionic != linux_glibc.

* linux_glibc_86_64
* linux_bionic_arm64

Some dependencies (like soong_zip, etc.) are not enabled for the new
host target (because they don't have to) and therefore the build fails.
Since the purpose of host APEX is to package some host tools for
testing, etc., we actually don't need the second target for APEX.

Fixing the problem by not skipping "cross host" targets which can't be
natively executed on the host machine.

Bug: 169454252
Test: HOST_CROSS_OS=linux_bionic HOST_CROSS_ARCH=arm64 m
Test: DIST_DIR=$(pwd)/out/dist \
        ./art/tools/dist_linux_bionic.sh com.android.support.apexer
Change-Id: Idaded56e4b4fc0195c8bbc760e4b4728016bd5b4
2020-09-29 11:22:23 +09:00
Treehugger Robot
5cc622ad78 Merge "Update the default platform version to S" 2020-09-29 00:09:50 +00:00
Yi Kong
15bad7a9cf Merge "Forbid -fwhole_program_vtables" 2020-09-28 23:56:02 +00:00
Frank Feng
d5bff956f9 Merge "Support auto-push of data_device_bins to device in test config auto-gen for sh-test" 2020-09-28 23:29:04 +00:00
Treehugger Robot
f1a406cdd6 Merge "lto: Rename Disabled to Never to reduce confusion" 2020-09-28 21:47:16 +00:00
Martin Stjernholm
618b671bf4 Retain all stubs versions in the snapshot.
This is a quick fix to avoid build failures due to prebuilts lacking
stubs versions that the sources have, which causes dependencies on
older version stubs fail on master-art-host where the sources of e.g.
Bionic are no longer available.

More work is required to make the version handling of stubs DTRT - a
TODO comment outlines it.

Test: m nothing
Test: `m runtime-module-sdk`, check that the generated Android.bp
  has the full stubs.versions list like the sources.
Bug: 169373910
Change-Id: I0ebfaf94f9d45a0e58d9785c40e7cea626f0ab83
2020-09-28 22:32:02 +01:00
Treehugger Robot
695755ae8c Merge "Collect FORCE_USE_GOMA environment variable as a metric." 2020-09-28 20:57:22 +00:00
Treehugger Robot
ca17414206 Merge changes Id412359e,I9c4d3a33,Ic3216235
* changes:
  Fix ChooseSdkVersion after api levels
  Don't export flags from SourceProvider variants
  Simplify missing whole_static_libs checking
2020-09-28 20:27:10 +00:00
frankfeng
be6ae776e5 Support auto-push of data_device_bins to device in test config auto-gen for sh-test
Bug: 148805488
Test: m
Test: ziptool-tests:
Change-Id: Iee4e8550dc77220ea576c5c33ade5d3b770573f0
2020-09-28 13:22:57 -07:00
Ivan Lozano
a711074817 Merge "rust: Add prefer_rlib property for static libstd." 2020-09-28 19:23:23 +00:00
Patrice Arruda
c97d6dcbb3 Collect FORCE_USE_GOMA environment variable as a metric.
FORCE_USE_GOMA is needed to be collected as a metric for the
deprecation of GOMA on Android builds.

Bug: b/169423400
Test: m nothing, ran printproto command
Change-Id: I12300389f1f27239d8f21875d1b6e4ad069d95d7
2020-09-28 18:25:42 +00:00
Treehugger Robot
a6b38f2d3e Merge "Remove InputRootAbsolutePath spec to header-abi-dumper" 2020-09-28 17:45:41 +00:00
Paul Duffin
a2ae7e0358 Allow java_sdk_library to specify doctags_files
When generating Javadoc the processor needs to be given information
about the doctags that are present in the source. This change allows
that information to be managed with the java_sdk_library that generates
the stubs source from which the Javadoc is generated.

Bug: 168301990
Test: Built offline-sdk-docs with and without the change and
      diffed them. The only difference was the timestamp.js
      file.
Change-Id: I4adbeb0781bc2191461fec856ffa90ea185e7434
2020-09-28 18:35:57 +01:00
Ivan Lozano
dd0554722a rust: Refactor staticStd to stdLinkage
Instead of returning a boolean, return an enum value to improve
readability and provide greater flexibility for future modifications.

Bug: 168729404
Test: Soong tests pass
Change-Id: Iddcdae8c34be09e476404382e43d1ea5935bae65
2020-09-28 13:26:05 -04:00
Yi Kong
f43ff059ff lto: Rename Disabled to Never to reduce confusion
Having different name from the underlying property is confusing...

Test: build
Change-Id: Ia24b664d6cded68abed2966455193f0e20757e06
2020-09-28 17:18:36 +00:00
Ivan Lozano
11200870b0 rust: Add prefer_rlib property for static libstd.
Adds the prefer_rlib property to allow linking libstd statically for
device rust binaries. This also changes the default behavior of rustlibs
to also prefer rlib linkage. This is because dylibs do not provide
rlib-libstd variants and always link in libstd dynamically. Thus a
binary requesting libstd rlib linkage should not attempt to link against
dylibs that link libstd dynamically.

Bug: 168729404
Test: New Soong test passes.
Change-Id: Idf8dfbbce8fd936f55a3fb323b17a1a7f0ee954e
2020-09-28 12:01:47 -04:00
Paul Duffin
d124b6b4e8 Merge "Output Javadoc comments for public API" 2020-09-28 14:25:48 +00:00
Martin Stjernholm
79bee057a3 Merge "Handle property structs and BpPropertySets as values to AddProperty." 2020-09-28 10:06:04 +00:00
Yo Chiang
19dfeee7d5 Merge "soong: Exclude system shared libs from fix suggestions" 2020-09-28 03:54:27 +00:00
Treehugger Robot
85aaf56dd6 Merge "Support arch-specific init_rc property" 2020-09-26 02:07:40 +00:00
Colin Cross
7812fd3814 Fix ChooseSdkVersion after api levels
I2954bb21c1cfdeb305f25cfb6c8711c930f6ed50 switched normalizeVersions
to work on ApiLevels, which inadvertantly caused it to return "current"
instead of "10000" for libraries that specify "current" in their stubs
property.  ChooseSdkVersion couldn't handle "current" because it was
manually converting the version to an int.  Switch ChooseSdkVersion
to use ApiLevels instead so that it can handle "current".

Test: m checkbuild
Change-Id: Id412359e092483ba419118dd03bc206fae702a96
2020-09-26 00:53:03 +00:00
Colin Cross
d3e05caa47 Don't export flags from SourceProvider variants
There is no need to export the linkdirs from the SourceProvider
variant.  Remove them to reduce differences in build.ninja from
a later patch that moves the flag exporting into compile(), which
isn't called by the SourceProvider variant.

Test: m checkbuild
Change-Id: I9c4d3a336a07cb9074376303bfa277c05d893b98
2020-09-26 00:52:55 +00:00
Colin Cross
e4f6ebaf6c Simplify missing whole_static_libs checking
Whole_static_libs required custom error checking when
AllowMissingDependencies was set because it could end up depending
on an empty list of objects, which would leave nothing in the
dependency tree that had been replaced with an ErrorRule.
Reuse the prebuilts case to depend on the .a file when there
are no objects and remove the custom error handling.

Test: TestEmptyWholeStaticLibsAllowMissingDependencies
Change-Id: Ic3216235f7e5ae8b5b6ab31ef2ca35c3994d82aa
2020-09-26 00:52:44 +00:00
Treehugger Robot
9dd2c4d543 Merge "Add type information to symbolfile and ndkstubgen." 2020-09-25 23:59:07 +00:00