Commit graph

2938 commits

Author SHA1 Message Date
Paul Duffin
dbb490359a Merge "Make all SdkMemberTypes support transitive member deps" 2021-05-07 12:31:15 +00:00
Paul Duffin
e746f30a0b Merge "Make licenseModule SdkAware" 2021-05-07 12:31:03 +00:00
Paul Duffin
e0fc8725f3 Merge "Make sdk tests more realistic" 2021-05-07 12:16:25 +00:00
Colin Cross
57892ceafb Merge "Support blueprint_go_binary in PathForModuleSrc" 2021-05-06 23:29:22 +00:00
Paul Duffin
2d3da31d41 Make all SdkMemberTypes support transitive member deps
Previously, only those SdkMemberTypes which had specific need to
automatically add some of their dependencies as sdk members would cause
the sdk to visit their transitive dependencies. However, as any module
can have dependencies on license modules and license modules need to be
included in the sdk then it needs to visit transitive dependencies of
all members.

So, this change removes the support for allowing an SdkMemberType to
control whether its transitive dependencies are visited and just visits
them all.

This does not have any effect on sdk snapshots as in order for a
dependency to be added to an sdk it needs to be added with a tag that
implements SdkMemberTypeDependencyTag and the only tags that implement
this are used by SdkMemberTypes that had enabled transitive members.

Bug: 181569894
Test: m art-module-sdk art-module-host-exports art-module-test-exports
      - verify that this change has no effect on the generated snapshots
Change-Id: If0293af0237aa7e39335e5b8383a41c023ff5853
2021-05-06 23:13:06 +01:00
Paul Duffin
b9e7a3ca7a Make licenseModule SdkAware
Making licenseModule SdkAware caused two breakages in the build. The
breakages were both caused by having an SdkAware module that was
depended upon by a versioned sdk snapshot but which was not itself
versioned and so did not have the member_name property set.

That occured because some default licenses have been added to the
packages containing prebuilts, e.g. prebuilts_runtime_license in
prebuilts/runtime/Android.bp. They apply to both the versioned and
unversioned members.

Once license support has been added to the sdk most of those will be
removed and replaced with properly versioned license modules. However,
in the meantime it is necessary to support that.

This change avoids the issue by checking to see whether the module is
itself versioned before relying on the member_name property. It also
improves the error message when a panic is recovered to make it easier
to identify where it originates.

Bug: 181569894
Test: m nothing
Change-Id: I0e7da2e0c4a30a6f814c2faab821b185aaed2135
2021-05-06 23:13:06 +01:00
Paul Duffin
525a590565 Make sdk tests more realistic
The tests use <sdk>_<module>_<version> as the format for a versioned
sdk member name but the format should be <sdk>_<module>@<version>. This
change corrects it and also fixes a similar issue in an error message.

Bug: 181569894
Test: m nothing
Change-Id: I8be0db4bcd0b6f4d6fbdf9e402ef7257fae8e18b
2021-05-06 23:13:06 +01:00
Lukacs T. Berki
598dd00236 Refactor how bp2build gets arch-specific props.
Then plumb them to LabelAttribute.

This refactoring is required because the previous implementation did not
handle properties in shards other than the first one (e.g.
version_script) well. In addition, it also makes the code paths between
bp2build and analysis more similar.

Bug: 186650430
Test: Presubmits.
Change-Id: Ic4393e8ae47f4e88816bf45c89399efd61494d22
2021-05-05 09:00:01 +02:00
Treehugger Robot
ee4e7fe76f Merge "bp2build: build static version of libstdc++." 2021-05-04 08:46:37 +00:00
Jingwen Chen
179856a69d bp2build: build static version of libstdc++.
This CL adds the ability to filter cc_library modules to only generate
their static variant of their shared variant isn't ready.

For example, the libstdc++ library is buildable as a static library,
which libc depends on. However, the shared variant of libstdc++ depends
on libc, which has to come later.

This CL introduces that abstraction to break up bp2build conversion into
more atomic steps to help with conversion.

Test: TH (bazel build //bionic/... incl. libstdc++'s static variant)
Bug: 186489250
Bug: 186822597

Change-Id: I3e2fe748e4e3d3b656760da4807f342d67c8f45f
2021-05-04 02:06:41 +00:00
Colin Cross
0e446159bc Support blueprint_go_binary in PathForModuleSrc
Allow blueprint_go_binary to be used as test data by supporting it in
PathForModuleSrc.

Also make python use GetDirectDepsWithTag instead of VisitDirectDeps
so it doesn't fail on the dependency to a Blueprint (non-Android)
module.

Fixes: 186528269
Test: manual
Change-Id: Ibc1d7caf7bf1fa5db805c3b885a95df4baee0ecf
2021-05-03 13:35:32 -07:00
Rupert Shuttleworth
52e6672613 Add fmtlib_ndk back to the deny list because it fails in mixed builds postsubmit.
But add it to the mixed builds deny list instead of the bp2build deny list.

Test: Waiting for another postsubmit to run.
Change-Id: Ief51356758304b3f13c95df401e310d4f5e236f7
2021-05-03 10:05:55 -04:00
Rupert Shuttleworth
fb955387db Update info on some deny-list entries.
(Some info has been relocated to blockers in Buganizer)

Also remove libjemalloc5 and fmtlib_ndk from the deny list as they don't seem to need to be there at the moment.

Test: bazel build //bionic/...
Test: build/bazel/scripts/run_presubmits.sh

Change-Id: I87e9dd3d4a83291efbcc15d6b99187b57d45ad18
2021-05-03 04:47:03 -04:00
Treehugger Robot
cbaef6ff0f Merge "Add debug ramdisk variant." 2021-05-02 23:54:40 +00:00
Chris Parsons
c424b76f76 Support multilib properties in bp2build
This combines properties among "multilib" and "arch" stanzas in selects
generated by bp2build.

With this fix, libc_gdtoa may be removed from the denylist.

This change also refactors a portion of arch.go, specifically bp2build's
arch mutator, adding a number of comments along the way, to hopefully
make this code clearer for future readers.

Test: mixed_libc.sh
Change-Id: If2beea672957cfb1af6760406ba507181ec38f77
2021-04-30 13:21:36 -04:00
Lukács T. Berki
dac1db044b Merge "Handle the version_script property." 2021-04-30 14:50:19 +00:00
Lukacs T. Berki
1353e59690 Handle the version_script property.
Doesn't work when depends on arch/target/etc., but good enough for
libdl_android.

Bug: 186650430
Test: Presubmits.
Change-Id: Ib0facb41a89454717c74663e5e078aedd33d1b9c
2021-04-30 16:46:41 +02:00
Jingwen Chen
790324e69c bp2build: add bugs and update bp2build denylist.
This CL updates the error messages and reorganizes the bottom half of
the bp2build denylist.

Test: TH
Change-Id: Ib15d019ba9cd006a78474477af34c66b5e418348
2021-04-30 09:43:20 +00:00
Rupert Shuttleworth
47aa58420b Update reasons for modules being on the deny list (and add bug links).
Test: bp2build; bazel build //bionic/...
Test: build/bazel/scripts/run_presubmits.sh

Change-Id: I852146b9df57689c022cb4e6c5b9e4a764866822
2021-04-30 04:28:49 -04:00
Jingwen Chen
d01da05860 Group some modules together under a single bug for tracking purposes.
Test: TH
Change-Id: I3f75bbd5c1455ab42d589d884a705bf09ef0b825
2021-04-30 03:33:15 +00:00
Inseob Kim
08758f08e9 Add debug ramdisk variant.
A module will be installed to /debug_ramdisk if debug_ramdisk is set to
true.

This is a reland of f84e9c05e2, with a fix
that removes /first_stage_ramdisk.

Bug: 184004542
Test: soong test
Change-Id: I739de63cfec6b0fec5a90f7c4741fc4d884d209c
2021-04-29 22:58:17 +09:00
Jingwen Chen
53681ef590 bp2build: make libdl build.
This CL adds support for the static and shared props, forwarding
whole_static_libs and srcs to the underlying shared library's
static_deps and static library's srcs respectively.

Test: TH
Fixes: 186609667
Change-Id: I84f838361c7758b256b2a163af894c502de03109
2021-04-29 08:59:02 +00:00
Jingwen Chen
282881683f bp2build: convert //external/arm-optimized-routines/...
Also update modules in denylist that depend on arm-optimized-routines libraries.

Bug: 186388919
Test: bazel build //external/arm-optimized-routines/...
Test: TH
Change-Id: If449b30288a4f852e5fcf31d923eda6cec1eb043
2021-04-28 22:11:44 +00:00
Steven Moreland
1cc8f451d1 Merge "more no include_dir" 2021-04-28 17:24:38 +00:00
Treehugger Robot
6065b0666a Merge "Add GetEmbeddedPrebuilt and IsModulePrebuilt" 2021-04-28 15:58:04 +00:00
Treehugger Robot
12bcc130ea Merge "Update bp2build allow/denylisting for system" 2021-04-28 15:53:42 +00:00
Lukács T. Berki
331917a4c6 Merge "Remove libc_syscalls from the denylist." 2021-04-28 13:38:45 +00:00
Paul Duffin
f7c99f5983 Add GetEmbeddedPrebuilt and IsModulePrebuilt
Dedups the many repetitions of the code to obtain a *Prebuilt from a
module.

Bug: 177892522
Test: m nothing
Change-Id: I1ededbe9ee79e89ea6dd8882dfee4be0bf0b51b7
2021-04-28 14:02:04 +01:00
Liz Kammer
a3b5dcf9f2 Update bp2build allow/denylisting for system
Test: build/bazel/ci/bp2build.sh
Test: build/bazel/ci/mixed_libc.sh
Change-Id: I21b3e32f7a9b9235ea87d68cff425077c8a46ff9
2021-04-28 09:01:50 -04:00
Paul Duffin
8d817b70e6 Merge "Extract IsModuleInVersionedSdk" 2021-04-28 12:58:43 +00:00
Liz Kammer
8e72286b68 Merge "Make GetDirectDep implementation match comment" 2021-04-28 12:34:40 +00:00
Lukacs T. Berki
667bb27363 Remove libc_syscalls from the denylist.
It looks like eakammer@'s aosp/1684105 fixed it.

Test: Presubmits.
Change-Id: I166344bbf82ec4e4273cf30b7bb369dcb8ec4442
2021-04-28 11:54:46 +02:00
Lukács T. Berki
f28abd1097 Merge "Allowlist libpropertyinfoparser." 2021-04-28 09:32:11 +00:00
Paul Duffin
6a77e77cf9 Merge "Pass module to SdkMemberTypeDependencyTag.SdkMemberType" 2021-04-28 06:56:59 +00:00
Lukacs T. Berki
497f17d227 Allowlist libpropertyinfoparser.
Or at least as much of it as needed for Bionic.

Bug: 186388932
Test: Presubmits.
Change-Id: Ic984f50a4869244cbdb6946dd9cca4d9e08445b7
2021-04-28 08:21:37 +02:00
Rupert Shuttleworth
6036497a3c Remove libdl_static from the deny list in light of http://aosp/1688405
Unfortunately libdl has to stay on the deny list due to an unrelated clang error in CI.

Test: bazel build //bionic/... now works with libdl and libdl_static both removed from the deny list.

Test: ./build/bazel/ci/bp2build.sh passes locally

Change-Id: I1b3c3dd01bc535c73c2e88c81b7998fa7906b4c5
2021-04-27 20:25:21 -04:00
Paul Duffin
0c2e08312c Extract IsModuleInVersionedSdk
Bug: 177892522
Test: m nothing
Change-Id: I348d380a0d29abdd6a84420be52cc1b674f2a7ab
2021-04-28 00:39:52 +01:00
Christopher Parsons
1c4621af62 Merge "Mixed builds: propagate includes from cc_* targets" 2021-04-27 23:10:33 +00:00
Paul Duffin
eee466e439 Pass module to SdkMemberTypeDependencyTag.SdkMemberType
This change allows an SdkMemberTypeDependencyTag to select the
SdkMemberType to use to add a dependency based on the module.

Bug: 177892522
Test: m nothing
Change-Id: I2d6e51b615636dc7cd41da65808ef851dd8ae6ac
2021-04-27 23:23:20 +01:00
Roman Kiryanov
5796db599f Merge "Remove libqemu_pipe from minSdkVersionAllowlist" 2021-04-27 21:54:58 +00:00
Roman Kiryanov
fc48433640 Remove libqemu_pipe from minSdkVersionAllowlist
libqemu_pipe was retired.

Bug: 175046060
Test: presubmit
Signed-off-by: Roman Kiryanov <rkir@google.com>
Change-Id: I4ac17966ad2a7609a9d71b8884351d70b5996b9d
2021-04-27 13:05:48 -07:00
Liz Kammer
2b50ce669c Make GetDirectDep implementation match comment
The comment on the interface of GetDirectDep states if there are
multiple deps with different tags, the first will be returned; however,
the current behavior is to panic if there are multiple deps. The
behavior now:
* a single dep, return the module and tag
* a single module with different tags: return module with first tag
* multiple modules: panic
* no module: return nil, nil

Bug: 186488405
Test: ~/aosp/build/bazel/ci/bp2build.sh
Test: m nothing
Change-Id: Id1e7315e7874b4a683ad7357ed2793822315821f
2021-04-27 15:53:51 -04:00
Chris Parsons
f60ecf081e Mixed builds: propagate includes from cc_* targets
This allows us to remove libasync_safe from the mixed builds denylist.

Test: mixed_libc.sh CI script
Change-Id: Ibafd231284864078bf30340f919d39e5098843ce
2021-04-27 15:04:37 -04:00
Steven Moreland
f36a3ac8b8 more no include_dir
Add a few more paths.

Bug: N/A
Test: N/A
Change-Id: Ib9503c2c792c4e93e30be631406e7e8314e6af31
2021-04-27 18:03:55 +00:00
Steven Moreland
ac9dc817b8 Merge "start eating include_dirs from both ends" 2021-04-27 16:34:24 +00:00
Lukács T. Berki
c860588763 Merge "Reorganize and cull cc_library_static denylist." 2021-04-27 14:42:00 +00:00
Treehugger Robot
6de44e74c8 Merge "bp2build: fix exclude_srcs in subpackages." 2021-04-27 13:48:46 +00:00
Lukacs T. Berki
b5ac5af618 Reorganize and cull cc_library_static denylist.
Take two: this time, put libasync_safe on the mixed build denylist
because it seems to break things.

Test: Presubmits + testing the offending action using a Ninja
invocation. "m droid dist" also running.

Change-Id: I7912b6670980776d981d874dab157b0268693ab2
2021-04-27 15:00:45 +02:00
Jingwen Chen
e32e9e07d7 bp2build: arch-specific exclude_srcs and srcs.
OS-specific exclude_srcs and srcs will be done in a follow-up, due to
complexities from merging multiple select statements together.

Test: TH
Bug: 186153868
Change-Id: I01b881e9a5a7cd41b4a507f8be7e9e65eab37bdc
2021-04-27 11:02:07 +00:00
Jingwen Chen
4ecc67d3c5 bp2build: fix exclude_srcs in subpackages.
In a non-top level Android.bp file, exclude_srcs was not working at all
due to a bug in expandSrcsForBazel. GlobFiles was expanding a glob
relative to root, but the expandedExcludes list was relative to the
module dir, causing the glob function to not consider the
expandedExcludes list at all.

Add tests to demonstrate that this is working now.

Test: TH
Bug: 186388919
Change-Id: Ice8254231d085b39126e91b823a09ec328ee0ae0
2021-04-27 09:51:08 +00:00