Commit Graph

2196 Commits

Author SHA1 Message Date
Colin Cross d4620701ad Merge "Start using Providers instead of direct module access" 2020-10-13 21:48:26 +00:00
Evgenii Stepanov 00e07c9779 Merge "Support asan/hwasan versions of prebuilts." 2020-10-13 17:51:58 +00:00
Steven Moreland 88ed5d9353 Merge "Zero C++ heap by default." 2020-10-13 16:49:16 +00:00
Treehugger Robot c8821b9451 Merge "Expose android.filesToInstall" 2020-10-13 04:52:36 +00:00
Evgenii Stepanov 2080bfe79a Support asan/hwasan versions of prebuilts.
In apex_set and cc_prebuilt_library_*, provide a way to specify an
alternative source to use when build with sanitizers.

Test: prebuilt_test, apex_test
Change-Id: I1ab8091bf696d94da3547cf5248853df489bdee6
2020-10-13 03:37:32 +00:00
Colin Cross 9ebc22cf2d Merge changes Ieeca3c39,Iddeea2d0,I8d66a5d3
* changes:
  Add jni_libs to host java binaries
  Make java_binary common variant a dependency
  Replace jniDependencyTag with a value
2020-10-13 03:33:10 +00:00
Colin Cross 0de8a1e17b Start using Providers instead of direct module access
Export information about static libraries, shared libraries and
exported flags through Providers instead of accessing the module
directly.  Much more is left to be converted, but this significantly
simplifies the dependencies on libraries with stubs by making it easy
for a module to masquerade as another by simply exporting the
providers from the other module.  Instead of depending on all the
versions of a library and then picking which one to use later, it
can depend only on the implementation variant and then select the
right SharedLibraryInfo from the variant.

Test: m checkbuild
Test: only expected changes to build.ninja
Change-Id: I1fd9eb4d251cf96ed8398d586efc3e0817663c76
2020-10-12 16:55:47 -07:00
Liz Kammer 9244491f17 Merge "Enable defaults in soong_config_module_type props" 2020-10-12 23:18:28 +00:00
Jaewoong Jung c1c415d0f7 Merge "Apply PRODUCT_ENFORCE_RRO_TARGETS to dependencies." 2020-10-12 21:45:33 +00:00
Colin Cross 56b6de5847 Merge changes I056c49e6,I994402cb
* changes:
  Fix OutputPath.InSameDir example
  Fix go vet error
2020-10-12 20:01:27 +00:00
Steven Moreland d134201537 Zero C++ heap by default.
Let the flakes, and the crashes, and the deadlocks, and the leaks, and
the undefined behavior which steals away so many nights find their
numbers decimated in the homogeneous conditions we now rest our data.

To give some intuition why this is not so underperformant, zeroing
memory is one way of priming caches.

This change is actually a no-op, because build/make/core/soong_config.mk
always overrides this setting, but it reflects the spirit and future
direction of this change.

Bug: 131355925
Test: basic simple perf comparisons
Change-Id: I8254c36373de52091839561973c9741e8f85aa09
2020-10-12 18:41:03 +00:00
Jaewoong Jung c779cd403f Apply PRODUCT_ENFORCE_RRO_TARGETS to dependencies.
With this change, users don't need to figure out which libraries
actually hold the resources to be overlaid when targetting apps with a
core lib dependency (e.g. Settings, SystemUI).

Fixes: 169898727
Test: app_test.go
Change-Id: I3c3b9dc0a377b1828db1199858a73d080a173205
2020-10-12 10:34:36 -07:00
Jaewoong Jung 19bc60abee Merge "Add config.AndroidFirstDeviceTarget." 2020-10-12 17:30:18 +00:00
Jaewoong Jung 642916f20a Add config.AndroidFirstDeviceTarget.
Targets[Android][0] is not always the first, preferred target. Add a new
field to config to provide the correct target and begin to use it.

Test: m nothing
Test: build/soong/scripts/build-ndk-prebuilts.sh
Fixes: 156980228
Change-Id: Ib56f52424ebf47f3eee6ac62b9fd9eca2919d63a
2020-10-12 14:15:19 +00:00
Treehugger Robot 6aa958902a Merge "android/: Rename Plat->SystemExt*SepolicyDirs" 2020-10-12 03:49:24 +00:00
Colin Cross 41b4676f44 Fix OutputPath.InSameDir example
The OutputPath.InSameDir example was called FileInSameDir.

Test: go vet ./android
Change-Id: I056c49e6b39f6124b0fa32ebc3498a2fe42c8ddc
2020-10-10 03:04:09 +00:00
Colin Cross ff0278b32a Fix go vet error
stderr is a bytes.Buffer, but the String() method has a pointer
receiver, so stderr does not satisify the Stringer interface
and can't be used for a %s argument.  Make stderr a *bytes.Buffer
instead.

Test: go vet ./android
Change-Id: I994402cb954946279375c9d447ad3854380381cc
2020-10-10 03:03:54 +00:00
Colin Cross c179ea6812 Make java_binary common variant a dependency
ctx.PrimaryModule() is wrong in the case of a java_binary that
supports both host and device, use an explicit dependency instead.
Once the dependency exists there is no need to manually request
the jar be installed, it will automatically be installed by the
host installation rules for dependencies.

Test: TestBinary
Change-Id: Iddeea2d08bc574c79d42139020558cd70d718ca1
2020-10-09 19:27:34 -07:00
Colin Cross 405af07859 Revert "Make lots of tests run in parallel"
This reverts commit 323dc60712.

Reason for revert: Possible cause of test instability
Bug: 170513220
Test: soong tests

Change-Id: Iee168e9fbb4210569e6cffcc23e60d111403abb8
2020-10-09 18:34:24 -07:00
Liz Kammer dbd4809b06 Enable defaults in soong_config_module_type props
Test: go tests
Test: m
Change-Id: I8fe8c17320086034f4745b2da974a2c73c949eaf
2020-10-09 14:28:34 -07:00
Treehugger Robot 38cfe29597 Merge "Revert "Implement vts_config module"" 2020-10-09 17:25:35 +00:00
Christopher Parsons c8f84809ad Merge "Mixed bazel/soong build prototype for genrule" 2020-10-09 14:27:04 +00:00
Chris Parsons f3c96efea4 Mixed bazel/soong build prototype for genrule
With this change, bazel_module is a specifiable property on
genrule module definitions. With bazel-enabled mode, soong_build will
defer to Bazel for information on these modules.

source build/soong/bazelenv.sh to enter bazel-enabled mode.

Test: Manually verified on bionic/libc genrules using aosp_cf_x86_phone-userdebug
Change-Id: I3619848186d50be7273a5eba31c79989b981d408
2020-10-08 22:46:23 -04:00
Dan Shi ee0b81a4fe Revert "Implement vts_config module"
This reverts commit ff36da04e8.

Reason for revert: remove vts10 harness and build configs
Bug: 169581727
Bug: 166662663
Test: build

Change-Id: I090b41c99c2279d24f08e4343289cbdcc7934f5d
2020-10-08 10:38:08 -07:00
Colin Cross 323dc60712 Make lots of tests run in parallel
Putting t.Parallel() in each test makes them run in parallel.
Additional t.Parallel() could be added to each subtest, although
that requires making a local copy of the loop variable for
table driven tests.

Test: m checkbuild
Change-Id: I5d9869ead441093f4d7c5757f2447385333a95a4
2020-10-06 15:12:22 -07:00
Colin Cross 56a8321c21 Remove global state from apex modules
A global variant was used to store the global mapping between
modules and APEXes.  Replace it with storing pointers to APEX
contents inside each module so that they can query the contents
of any APEXes they belong to.

Bug: 146393795
Test: all Soong tests
Test: single line change to build.ninja host install dependency ordering
Test: no Android-${TARGET_PRODUCT}.mk, make_vars-${TARGET_PRODUCT}.mk or late-${TARGET_PRODUCT}.mk
Change-Id: Id2d7b73ea27f8c3b41d30820bdd86b65c539bfa4
2020-10-06 13:39:57 -07:00
Colin Cross ac0cd89283 Merge changes I4c8cd544,I62d4d43d,I0ae667d4,Id357adc0,I1ff87134
* changes:
  Don't create version variations of sdk modules
  Create fewer empty version variants
  Don't make SplitPerApiLevel imply UseSdk
  Remove vendor crt special case
  Fix apex_test.go and add it to Android.bp
2020-10-06 17:33:30 +00: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
Paul Duffin 157f40f056 Add prebuilt_visibility property
Some mainline modules provide an `sdk` and one or more set of
module_exports. When the snapshots are unpacked into separate prebuilts
directories (one per snapshot) then any dependencies from a member of
one snapshot to a member of another may require the latter to have
additional visibility rules.

Previously, these rules had to be added to each source module. This
change allows additional visibility rules to be specified on the
sdk/module_exports that are added to all the prebuilts in its snapshot.

Bug: 155921753
Bug: 168301990
Test: m nothing
Change-Id: Ia3eacb5749981f04770ae9872a8013e43c5c6ef1
2020-10-02 10:59:41 +01:00
Paul Duffin 958dd4f6ad Merge "Explicitly specify visibility in sdk/module_exports snapshot" 2020-10-02 09:45:22 +00:00
Paul Duffin d99d997238 Explicitly specify visibility in sdk/module_exports snapshot
This change ensures that each prebuilt in a snapshot explicitly
specifies its visibility even when that visibility is the current
default. This is done for two reasons:
1. It simplifies a follow up change that adds visibility rules to an
   existing set of rules.
2. It ensures that the snapshots are independent of the current Soong
   default visibility.

The latter is important because we intend to switch from modules being
visible to everyone by default (i.e. //visibility:public) to only being
visible to modules in the same package (i.e. //visibility:private). By
making the snapshots of modules that do not specify any visibility
explicitly specify that they are "//visibility:public" it ensures that
the snapshots will not need to be changed when the default changes.

Bug: 168301990
Test: m nothing
Change-Id: Ia034f4a1e5124c17f46d73b0e9a6c5f2a251038e
2020-10-01 18:20:13 +01: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
Treehugger Robot 025ae97b0e Merge "Add support of test data to python_host_test" 2020-09-29 21:56:19 +00:00
Jiyong Park 4dc2a1aaa7 Expose android.filesToInstall
It will be used by the cvd_host_package module type to gather installed
files and package them in a distributable format.

Bug: 168086242
Test: m

Change-Id: I3af6dcda0bce1f298b1500fbac311c9593ddf375
2020-09-29 20:17:22 +09:00
Treehugger Robot 5cc622ad78 Merge "Update the default platform version to S" 2020-09-29 00:09:50 +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
Martin Stjernholm 79bee057a3 Merge "Handle property structs and BpPropertySets as values to AddProperty." 2020-09-28 10:06:04 +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 0bab8773cb Support arch-specific init_rc property
Mulitple init_rc files may be necessary to support multilib binaries
with different installed names.

Test: m checkbuild
Change-Id: I17d3a3b2346a25b230e5a325deb0d78f0ee045f0
2020-09-25 14:01:21 -07:00
Jiyong Park 84d8a7e111 Update the default platform version to S
R is out. The platform codename on the main branch is now S and the API
level of the platform is 30, which is R because S hasn't been finalized.

Bug: N/A
Test: rm -rf out; ./build/soong/soong_ui.bash --make-mode --skip-make
Change-Id: I486b9639bccfe17a42681e1f84097373f8f401e7
2020-09-25 13:47:41 +09:00
Martin Stjernholm 191c25f589 Handle property structs and BpPropertySets as values to AddProperty.
Both will create a nested property set, that may be merged with an
existing one.

Test: m nothing
Bug: 151303681
Change-Id: I30696ba3eb8960ca6fa54c9ee2cf6229ab9f5da9
2020-09-25 00:33:04 +01:00
Treehugger Robot 4f6eebff0c Merge changes I0885e493,Ic37c8db9
* changes:
  linux_bionic_arm64 is added when Host_bionic_arm64 is true
  HostCross is an attribute of a Target, not OsType
2020-09-24 22:56:43 +00:00
Dan Albert 8bd5095362 Merge changes from topics "soong-apilevel", "soong-config-apilevel"
* changes:
  Convert more versions in config to ApiLevel.
  Replace FutureApiLevel with an ApiLevel.
  Replace ApiStrToNum uses with ApiLevel.
2020-09-24 21:02:07 +00:00
Treehugger Robot 2c7ca784f7 Merge "Extend target docs to cover (almost) all variants." 2020-09-24 18:05:39 +00:00
Jiyong Park 2210198129 linux_bionic_arm64 is added when Host_bionic_arm64 is true
linux_bionic_arm64 is the new host target using Bionic as libc.  This
change adds a new Soong config Host_bionic_arm64 that enables the
target.

This change also amends firstTarget() function to handle the case when
the available targets for an OS have different arch families. In that
case, first target is selected for each of the arch family. This is
needed in the (rare) care when both linux_bionic_x86_64 and
linux_bionic_arm64 targets are enabled.

Bug: 159685774
Test: add "Host_bionic_arm64": true to out/soong/soong.config and run
./build/soong/soong_ui.bash --make-mode --skip-make
out/soong/host/linux_bionic-arm64/bin/aarch64-linux-bionic/crosvm

Change-Id: I0885e49379f6ee216c6e82adbb1230655171a7a5
2020-09-24 14:14:36 +09:00
Jiyong Park 1613e5541f HostCross is an attribute of a Target, not OsType
A host target is considered as being cross-compiled when the target
can't run natively on the build machine. For example, linux_glibc/x86_64
is a non-cross target on a standard x86/Linux machine, but is a cross
host on Mac. Previously, whether cross or not was a static attribute of
an OsType. For example, Windows was always considered as cross host,
while linux_bionic was not. This becomes a problem when we support more
host targets like linux_bionic/arm64 which should be cross-host on
standard x86/Linux machines.

This change removes HostCross from the OsClass type and instead adds a
property HostCross to the Target type. When a target is being added, it
is initialized to true when the target can't run natively on the current
build machine.

Bug: 168086242
Test: m
Change-Id: Ic37c8db918873ddf324c86b12b5412952b0f2be2
2020-09-24 14:14:31 +09:00
Colin Cross 3735c144e0 Merge "Move PrimaryModule, FinalModule, VisitAllModuleVariants to BaseModuleContext" 2020-09-24 00:58:24 +00:00
Colin Cross f950513579 Merge "Add providers support" 2020-09-24 00:28:42 +00:00
Martin Stjernholm e284b48496 Extend target docs to cover (almost) all variants.
Test: n/a - comment change only
Change-Id: Ia0e6e4c6f872cf8023cb6470935cab3d6a0c1fee
2020-09-23 21:12:45 +01:00
Martin Stjernholm a9a99bc6d2 Merge "Handle absolute source paths correctly." 2020-09-23 13:03:06 +00:00