Commit graph

1095 commits

Author SHA1 Message Date
Colin Cross
cf371cc1f7 Replace android.WriteFile rule with android.WriteFileRule
The android.WriteFile rule takes careful escaping to produce the
right contents.  Wrap it in an android.WriteFileRule that handles
the escaping.

Test: compare all android.WriteFile outputs
Change-Id: If71a5843af47a37ca61714e1a1ebb32d08536c31
2020-11-14 16:26:00 -08:00
Colin Cross
ae8600b507 Pass Config to NewTestContext instead of ctx.Register
Prepare for using Config when adding singletons by passing
Config to NewTestContext and NewContext instead of to ctx.Register.
This will enable a followup change to store SingletonMakeVarsProviders
registered on the Context in the Config, which is necessary to run
multiple tests in parallel without data races.

Test: all soong tests
Change-Id: Id229629a4e42ff4487d317241673837726c075fc
2020-11-12 10:07:49 -08:00
Anton Hansson
82d502a7b2 Make apex modules support tagged dists
Bug: 172951145
Test: m dist my_dist_target (with patch in bug)
Change-Id: I0da4568a49ea48efbf864614a7e7c647f251a7ce
2020-11-11 12:34:20 +00:00
Treehugger Robot
25b0780f37 Merge "Define product_available property" 2020-11-09 00:40:50 +00:00
Justin Yun
63e9ec70bb Define product_available property
To make a module available to product variants, it must define
`product_available: true`. `vendor_available: true` will not create
product variants any more.
However, in this CL, we don't change the behavior of
`vendor_available` property. It still creates both variants. After we
update all Android.bp files that need to provide product variants
with `product_available: true`, we may upload the remaining patches.

Bug: 150902910
Test: lunch aosp_arm64-userdebug && m
Change-Id: I0fd5be7bbae2c45d5cab3c3c2ca49f53a9b6f975
2020-11-08 23:53:22 +00:00
Nikita Ioffe
3862cd509b Merge "Update apex/allowed_deps.txt" 2020-11-06 12:46:39 +00:00
Nikita Ioffe
77e1d4b4e5 Update apex/allowed_deps.txt
Bug: 171330443
Bug: 171668006
Test: build/soong/scripts/update-apex-allowed-deps.sh
Change-Id: I5f3d834687121ba967d1e3aeb301c87679b2078d
Merged-In: I5f3d834687121ba967d1e3aeb301c87679b2078d
2020-11-05 21:46:26 +00:00
Artur Satayev
ed667a8345 Add PHONY for apex-allowed-deps check.
Bug: 149622332
Test: m apex-allowed-deps-check
Change-Id: I5848779b4ad04dd4c95e2667f7f62dd2949ac95e
Merged-In: I5848779b4ad04dd4c95e2667f7f62dd2949ac95e
(cherry picked from commit 01aa11e833)
2020-11-04 20:50:03 +00:00
Nikita Ioffe
3b834bf347 Update apex/allowed_deps.txt
Test: build/soong/scripts/update-apex-allowed-deps.sh
Change-Id: Iad138bdb439e3ebc7a145dec7875b8bb5756d755
2020-11-04 17:12:27 +00:00
Martin Stjernholm
af3bf0dd5d Merge "Move hardcoded apex_available's for ART modules into ART blueprints." 2020-11-04 16:28:26 +00:00
Slava Shklyaev
af7e511921 Add new neuralnetworks targets to apex/allowed_deps.txt
Generated with build/soong/scripts/update-apex-allowed-deps.sh

Bug: 160669906
Test: m
Change-Id: Ifd056230dd352fe3fa1c462d1e090aef5bbeb09d
Merged-In: Ifd056230dd352fe3fa1c462d1e090aef5bbeb09d
(cherry picked from commit 7f0c05539f)
2020-11-03 17:40:01 +00:00
Steven Moreland
9efbd038a7 Update VNDK version for common graphics HALs.
We are adding things to them, and in order for core libraries like libui
to use them, the newer versions need to be in the VNDK.

Bug: 170435409
Test: build
Change-Id: I97f26b78758f2eed128fc46db03b5f6ba3f2245f
Merged-In: I97f26b78758f2eed128fc46db03b5f6ba3f2245f
(cherry picked from commit 25281087a9)
2020-11-03 17:35:43 +00:00
Nikita Ioffe
f9b945196b Manually update apex/allowed_deps.txt
This is one in a series of cls to make sure that
build/soong/scripts/update-apex-allowed-deps.sh is a no-op on cleanly
checked out aosp/master.

This cl is an intersection of the following:
ag/I9f98361aa248b82cb58527a5cd59e6d17c3e8723,
ag/I19ba5900ddff84948cfa29e48e31cd609e61dbdb,
build/soon/apex/allowed_deps.txt in aosp/master

Test: presubmit
Merged-In: I9f98361aa248b82cb58527a5cd59e6d17c3e8723
Change-Id: I19d58582de85e1ae1ef1c2b997d568235ca17710
2020-11-03 17:30:31 +00:00
Treehugger Robot
20cf20ba1c Merge changes I0289d866,Ie7363524
* changes:
  Move stubs related methods out of LinkableInterface
  Don't create stubs variants of static libraries
2020-11-02 21:31:11 +00:00
Martin Stjernholm
377d752a6b Move hardcoded apex_available's for ART modules into ART blueprints.
Test: m droid
Bug: 133140750
Change-Id: I7280c7c61979d8f1aa3c849ff7079a5dd3ef216d
2020-10-30 02:17:23 +00:00
Colin Cross
a717db7304 Don't create stubs variants of static libraries
Statically linking stub implementations doesn't make sense, don't
create stubs variants of static libraries.

Bug: 170784825
Test: all soong tests
Change-Id: Ie73635244516edf6da884e3a7a275971a9bd7839
2020-10-29 14:17:37 -07:00
Nikita Ioffe
7f17421012 Update apex/allowed_deps.txt
Bug: 171330443
Bug: 171668006
Test: build/soong/scripts/update-apex-allowed-deps.sh
Change-Id: Id239ea9b31ce23f045f0db4027db33658ef3da14
Merged-In: Id239ea9b31ce23f045f0db4027db33658ef3da14
2020-10-29 15:35:01 +00:00
Nikita Ioffe
769f4a5c03 Update apex/allowed_deps.txt
Bug: 171330443
Test: build/soong/scripts/update-apex-allowed-deps.sh
Change-Id: Ic7ddd86cefc0c6a26de294b6e73b3e23d4791f5c
Merged-In: Ic7ddd86cefc0c6a26de294b6e73b3e23d4791f5c
2020-10-28 01:17:55 +00:00
Paul Duffin
e10dfa4e3d Cleanup usages of CreateConfiguredJarList
After previous refactorings the CreateConfiguredJarList function is now
only used in tests and are supplied with a PathContext that will cause
ReportPathErrorf() to panic. So, this change removes the ctx parameter,
calls panic directly on any error and renames the method to make it
clear that it is for testing only.

Bug: 171479578
Test: m nothing
Change-Id: Icfb4bdfe720afa855b64ecf0e74a0b030882d029
2020-10-27 10:36:29 +00:00
Paul Duffin
69d1fb1e39 Switch BootJars/UpdatableBootJars to ConfiguredJarList
This change:
* Switches BootJars/UpdatableBootJars fields of config.productVariables
  from []string to ConfiguredJarList.
* Updates BootJars() method to simply concatenate the jars list from
  the BootJars/UpdatableBootJars fields.
* Adds an UnmarshalJSON(..) method to ConfiguredJarList to support
  unmarshalling from a single string array to avoid having to change the
  format of the JSON file from which the configuration is loaded.
* Adds some additional calls to ConfiguredJarList(..) in tests to
  convert from []string to ConfiguredJarList. They pass nil as the
  ctx argument as there is no suitable PathContext which will cause any
  errors to be thrown using panic. That is reasonable for hard coded
  values in tests. A follow up change will clean up the calls to
  ConfiguredJarList(..).

Bug: 171479578
Test: m nothing
Change-Id: I59b94dafb479ccd8f0471ed802be175af57be271
2020-10-27 10:36:29 +00:00
Treehugger Robot
93d8c6443e Merge "Add libdmabufheap to the list of allowed dependencies" 2020-10-26 19:31:57 +00:00
Colin Cross
ed5dee0a8f Merge "Add llndk_stubs property" 2020-10-23 18:09:42 +00:00
Martin Stjernholm
9649748516 Merge "Rename ART release APEX to com.android.art." 2020-10-23 10:03:24 +00:00
Steven Moreland
8f01ff814b Merge "apex dependency error: note 'apex_available'" 2020-10-22 23:08:18 +00:00
Hridya Valsaraju
87076a45be Add libdmabufheap to the list of allowed dependencies
It needs to be in the list since it is needed by codec2_vndk.
It will eventually replace libion(also in the list).

Test: m
Bug: 168333162
Change-Id: If11d7e845bd4704f34f84435b5cac32b614312a8
2020-10-21 22:09:44 -07:00
Steven Moreland
6e36cd6104 apex dependency error: note 'apex_available'
This error tracks `apex_available` closure, but the message doesn't
indicate this variable specifically. Calling it out to try to make
the problem more searchable/discoverable/intuitable.

Bug: N/A
Test: apex_test.go
Change-Id: Ib254ace1dbd4e77d073ed4f98ee181dd86adfcfc
2020-10-22 01:23:33 +00:00
Colin Cross
0477b42276 Add llndk_stubs property
Prepare for making the relationship between an llndk_library stubs
module and the cc_library implementation module explicit by
adding an llndk_stubs property.  Each cc_library will be updated
to point to its llndk_library, and the llndk_library name will
be changed to make the .llndk suffix explicit.  Then the implicit
connection and suffix can be removed.

Bug: 170784825
Test: m checkbuild
Change-Id: I6b0482a3f286ec29b2e928551aa4317749f2b499
2020-10-21 10:55:33 -07:00
Martin Stjernholm
7f51107ee6 Rename ART release APEX to com.android.art.
Test: See https://r.android.com/1457217
Bug: 169639321
Change-Id: I6800c7a382486b4e50945cc8b789f4be16482fe6
Merged-In: I6800c7a382486b4e50945cc8b789f4be16482fe6
2020-10-21 15:41:02 +01:00
Nikita Ioffe
5335bc471a Propagate min_sdk_version to apexer
This way it will be correctly set in the auto-generated
AndroidManifest.xml.

Bug: 171096530
Bug: 157078772
Test: m
Change-Id: I268f08ca5dd17fa9d6763ad70cc9a3f83891a8d6
Merged-In: I268f08ca5dd17fa9d6763ad70cc9a3f83891a8d6
(cherry picked from commit 97fd49235a)
2020-10-21 14:26:44 +01:00
Nikita Ioffe
dd203b6b34 Update allowed deps for sdkext apex
Test: m
Bug: 171096530
Bug: 171330443
Change-Id: Iacaa4e8c6ed2e3854ef973a84bb0e44c433c00d3
2020-10-20 21:08:41 +00:00
Colin Cross
d4620701ad Merge "Start using Providers instead of direct module access" 2020-10-13 21:48:26 +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
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
Steven Moreland
73a9e603d5 Merge "build/soong/scripts/update-apex-allowed-deps.sh" 2020-10-12 16:59:24 +00: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
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
Jooyung Han
51ce6b0acc Merge "apex: emit file_contexts for flattened apex" 2020-10-06 03:26:14 +00:00
Steven Moreland
3453948ad0 build/soong/scripts/update-apex-allowed-deps.sh
For bionic_libc_platform_headers(minSdkVersion:29).

Bug: 166675194
Test: build
Change-Id: I5c516265003ee2e0cec619ef7872e8a549354385
2020-10-06 00:52:00 +00:00
Treehugger Robot
0400ede359 Merge "Remove stale apex_available dependency." 2020-10-04 22:52:57 +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
Martin Stjernholm
3b8ca4c317 Remove stale apex_available dependency.
Test: m
Bug: 142944931
Change-Id: I9c69ef64eb9eecd45f6272a1d79bf77ee910815c
2020-09-30 17:40:17 +01:00
Treehugger Robot
025ae97b0e Merge "Add support of test data to python_host_test" 2020-09-29 21:56:19 +00:00
Treehugger Robot
6c76f18aae Merge "Don't include artifacts for host-cross targets" 2020-09-29 14:03:05 +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
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
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
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
Jooyung Han
7f146c0da1 apex: emit file_contexts for flattened apex
Flattened APEXes are installed in /<partition>/apex/<name>, so its
file_contexts file should be amended accordingly.
For example, file_contexts of an apex "com.android.foo" with should be
modified by prepending actual install path to the path regex.

/bin/foo <sepolicy label>
=> /system/apex/com\.android\.foo/bin/foo <sepolicy label>

File_contexts file is emitted to "make" via LOCAL_FILE_CONTEXTS variable
for apex_manifest.pb module.

Make collects these files and use them to build file_contexts.bin.

Also removed global state which is used to keep the list of all
flattened apexes.

Bug: 166518492
Test: m file_contexts.bin
      check intermediate file_contexts.modules.tmp file
      in $OUT/obj/ETC/file_contexts.bin_intermediates/
Change-Id: I780370b6e576964a5c09f9477f3361f341dd576b
2020-09-23 15:43:39 +00:00
Dan Albert
4f378d75aa Convert more versions in config to ApiLevel.
The test case I removed is invalid. The codename has had its int
assigned, but the config claims it is not final.

If this ever does need to be supported it's just a matter of making
sure the Q -> 29 mapping (or whatever) in the finalized codenames map
in android/api_levels.go.

Test: treehugger
Bug: http://b/154667674
Change-Id: I4f42ec2fd4a37750519ee3937938a1c65b6bb1e8
2020-09-22 16:01:56 -07:00