Commit graph

239 commits

Author SHA1 Message Date
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
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
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
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
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
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
Liz Kammer
cc86ac88a8 Revert "Reorganize and cull cc_library_static denylist."
This reverts commit cba7b0c43c.

Reason for revert: mixed_droid failing: libbacktrace fails due to libasync_safe, linkerconfig (and others) due to duplicate symbols

Change-Id: Ib6dd6bbb6f76048a7abd0970d457cf75921beae6
2021-04-26 22:17:48 +00:00
Lukacs T. Berki
cba7b0c43c Reorganize and cull cc_library_static denylist.
Test: Presubmits.
Change-Id: Ia82d5b6975fe53888798db0378635ec36b43603e
2021-04-26 18:54:28 +02:00
Liz Kammer
dbe1ef2149 Merge "Add bp2build arch-specific paths mutator" 2021-04-23 12:50:05 +00:00
Lukacs T. Berki
f8645b93b4 Update error messages.
For libm and libseccomp_policy in particular.

Test: Presubmits.
Change-Id: I778a466b7736e25aa4486335976847e8c5cf645f
2021-04-23 09:07:28 +02:00
Rupert Shuttleworth
5baca302df Add libc_openbsd to mixed builds deny list.
Test: USE_BAZEL_ANALYSIS=1 m linkerconfig
Change-Id: I59386d7d70a9a3c0cabe1b641284dfbd131d532d
2021-04-22 13:41:37 -04:00
Rupert Shuttleworth
e5c719e124 Allow more cc_library_static targets to build.
- libc_openbsd_large_stack
- libc_openbsd

Also update the lib_dns comment as it makes more progress now (still fails).

Test: bp2build; bazel build //bionic/...
Test: USE_BAZEL_ANALYSIS=1 m libc

Change-Id: I54f104d359779420d181f195ecbfc9e1269e30be
2021-04-22 01:46:06 -04:00
Liz Kammer
4562a3b218 Add bp2build arch-specific paths mutator
Adds deps for properties tagged `android:"path"` within arch, multilib,
and target properties.

Test: build/bazel/ci/bp2build.sh
Test: m nothing
Bug: 185217298
Change-Id: I0230da399d2c4e984b837f69523fa09eadba3ff1
2021-04-21 18:21:50 -04:00
Rupert Shuttleworth
2a4fc3ecdc Generate BUILD files for every directory that has an Android.bp file.
Test: Added an integration test
Test: bazel build --package_path=out/soong/workspace //bionic/...

Change-Id: Ie34bd23ab3c5428e6c9c9919e5fb6fcb4e709adc
2021-04-21 07:15:50 -04:00
Chris Parsons
bab4d7e3bc Add a denylist for specifically mixed builds
This allows us to, for certain modules, enable bp2build, but disable
mixed builds.
This facilitates easier iteration on these two features, as modules can
be incrementally "fixed" for bp2build, even if they are not ready for
mixed builds integration.

Test: USE_BAZEL_ANALYSIS=1 m libc
Test: Manually verified that note_* modules exist in bionic/libc/BUILD
Test: bazel build //bionic/....
Change-Id: I3462c8398680140cfc953443d96196143b8ad0a3
2021-04-19 12:30:02 -04:00
Liz Kammer
cefa3c75be Denylist two targets that fail for non-x86_64
Test: demo.sh full
Fixes: 185582610

Change-Id: I620029eaaa7dc46d2434c382867b08eacbd9eb91
2021-04-16 11:51:06 -04:00
Rupert Shuttleworth
c143cc50dd Transform paths to headers in include dirs to take package boundaries into account.
This allows the following cc_library_static targets to build with bp2build:

- libc_freebsd
- libc_freebsd_large_stack
- libc_openbsd_ndk
- libc_gdtoa  (* but still fails for mixed builds)
- libc_aeabi
- libc_static_dispatch
- libc_dynamic_dispatch

This also allows a number of other cc_library_static targets to progress further in their builds.

Test: Added unit test
Test: bp2build-sync.py write; bazel build //bionic/...

Change-Id: I71742565c16594448a41a6428a5c993171ec4cb4
2021-04-14 17:05:36 -04:00
Rupert Shuttleworth
43b04926b2 Add reasons for cc_library_static modules to be on the deny list.
Test: bp2build-sync.py write; bazel build //bionic/...
Change-Id: I8fc7036136adbcf16dc31d9691a8d18b99e3c3ae
2021-04-13 08:54:20 -04:00
Jingwen Chen
0a92ed74ad bp2build/mixed builds denylist note_memtag_heap_async and sync temporarily.
This adds the two modules to the bp2build/mixed builds denylist while we
investigate b/185079815.

Test: TH
Change-Id: I6d67c5c24502ac48bdc90a005ddef86c46eab0b7
2021-04-12 05:37:42 +00:00
Jingwen Chen
6393098ecf bp2build: cc_library converter for //bionic/libdl:libdl_android
This CL contains the converter for libdl_android, a cc_library that
expands into a cc_shared_library and a regular cc_library.

Test: TH
Test: bp2build; bazel test //build/bazel/tests/...

Change-Id: If70641a538211b0d6b2aac0e4d0d06912318304d
2021-04-09 09:42:53 +00:00
Chris Parsons
eefc9e6a62 Fix note_memtag bionic libraries in mixed builds
Required fixes:
  - Set MakeLinkType for libraries, even in mixed build mode.
  - Set snapshot header information to empty list, which passes
        validation logic for depending modules

Fixing these libraries also requires a Starlark change to
cc_library_static.bzl, which will be submitted separately.

Additionally, this adds better error messaging in the event that
output files are missing from a mixed-build library.

Test: USE_BAZEL_ANALYSIS=1 m libc
Test: USE_BAZEL_ANALYSIS=1 m runtime-module-sdk
Change-Id: Iad2c4d46359986fb0a43263292a15ed45fabbac7
2021-04-05 15:27:55 -04:00
Christopher Parsons
012ae1f4e0 Merge "Use correct includes for mixed build gen headers" 2021-04-05 19:03:47 +00:00
Chris Parsons
e59af4e1c0 Use correct includes for mixed build gen headers
Previously, genrules which were used as generated_headers only
propagated the old Soong gen directory as an include path, even if the
genrule was managed by Bazel. With this chance, the gen directory of the
Baze output files are used in mixed-build mode.

Test: USE_BAZEL_ANALYSIS=1 m libc
Test: m libc
Change-Id: I3913c4e5b0354421ba1fe43d1f6ef4d1e729a058
2021-04-02 18:27:21 -04:00
Jingwen Chen
91220d7334 Add os/target configurable selects for label list attributes.
This CL is pretty large, so I recommend starting with reading the newly
added tests for the expected behavior.

This change works in conjunction with the linked CLs in the Gerrit topic.
Those CLs add support for new platform() definitions for OS targets
specified in Soong's arch.go, which are configurable through
Android.bp's `target {}` property. It works similary to previous CLs
adding support for the `arch {}` property.

These configurable props are keyed by the OS: android, linux_bionic,
windows, and so on. They map to `select` statements in label list
attributes, which this CL enables for cc_library_headers' header_libs
and export_header_lib_headers props.

This enables //bionic/libc:libc_headers to be generated correctly, from:

    cc_library_headers {
        name: "libc_headers",
        target: {
            android: {
                header_libs: ["libc_headers_arch"],
                export_header_lib_headers: ["libc_headers_arch"],
            },
            linux_bionic: {
                header_libs: ["libc_headers_arch"],
                export_header_lib_headers: ["libc_headers_arch"],
            },
        },
        // omitted props
    }

to:

    cc_library_headers(
        name = "libc_headers",
        deps = [] + select({
            "//build/bazel/platforms/os:android": [
                ":libc_headers_arch",
            ],
            "//build/bazel/platforms/os:linux_bionic": [
                ":libc_headers_arch",
            ],
            "//conditions:default": [],
        }),
    )

Test: TH
Test: Verify generated //bionic/libc:libc_headers
Fixes: 183597786

Change-Id: I01016cc2cc9a71449f02300d747f01decebf3f6e
2021-04-02 08:17:34 +00:00
Rupert Shuttleworth
760fb185be Annotate bp2buildModuleDoNotConvertList with reasons for modules being blocked.
Test: bp2build write; bazel build //bionic/...
Change-Id: I6065c945dbb8747c85aa554eefb355afe58d2078
2021-04-01 04:38:08 +00:00
Chris Parsons
b164b381b2 Register bp2build module types even outside generation
Without this fix, mixed builds are silently disabled, as a recent change
disabled mixed builds for all module types which are not listed in this
map. This map should be populated for both bp2build generation and for
mixed builds.

Test: lunch aosp_flame && USE_BAZEL_ANALYSIS=1 m libc
Change-Id: Ib2a3fb2de2e7a5204ef01355522ae569e0424dc7
2021-03-31 12:26:01 -04:00
Rupert Shuttleworth
4f43fe96bd Store the bp2build module opt-out list as a list instead of a map.
Test: bp2build-sync.py write; bazel build //bionic/...
Change-Id: I3f68f4c62446841aa795bb84161d1fa82510ae9d
2021-03-30 14:13:16 +00:00
Rupert Shuttleworth
b33f9d87c4 Remove lib_dns from bp2build converter denylist (module name typo, should be libc_dns).
Test: TH.
Change-Id: I636b7d6d09e96f6e25525ca48783281892a1eb02
2021-03-25 22:23:00 +00:00
Rupert Shuttleworth
a9e182440d Don't convert libc_dns using the cc_library_static bp2build converter.
Test: Manually ran bp2build-incremental presubmit in a new AOSP checkout.
Change-Id: I063f6f244c34c4456af77fb25579f95d724e8893
2021-03-25 21:56:15 +00:00
Jingwen Chen
5d72cba25c bp2build: add a per-module denylist.
This speeds up development of experimental converters.

Test: TH
Change-Id: I1623d3dbf63c8ed777646d64560d77b38edf9213
2021-03-25 09:29:26 +00:00
Jingwen Chen
12b4c2706d bp2build: add allowlist for package-level conversions.
This CL adds the support for specifying lists of directories in
build/soong/android/bazel.go, which are then written into
out/soong/bp2build/MANIFEST. Using this configuration,
modules/directories can either default to bp2build_available: true or
false, while still retaining the ability to opt-in or out at the module level.

It also ensures that ConvertWithBp2Build returns true iff the module
type has a registered bp2build converter.

Test: go tests
Test: demo.sh full
Test: TreeHugger presubmits for bp2build and mixed builds.

Change-Id: I0e0f6f4b1b2ec045f2f1c338f7084defc5d23a55
2021-03-24 02:27:19 -04:00
Liz Kammer
bdc609972c Support autoconverted modules in mixed builds
modules converted with bp2build_available are will also be available to
be used in mixed builds.

Test: build/bazel/scripts/milestone-2/demo.sh full
Test: go tests
Change-Id: I49f16ec3ba5bb11dfed8066af069c27eb04371fb
2021-03-16 15:11:49 -04:00
Liz Kammer
ba3ea16f14 Use handcrafted build targets in bp2build
If both bp2build_available and label are specified, label will be
preferred.

Initially, we copy the entire BUILD.bazel file. Eventually we may move
this to use bazel query for a more accurate result.

Test: go test *
Test: build/bazel/scripts/milestone-2/demo.sh full
Test: GENERATE_BAZEL_FILES=true m nothing
      edit bionic/libc/tools/BUILD.bazel
      GENERATE_BAZEL_FILES=true m nothing and verify changes picked up
Bug: 180516554
Change-Id: I43025583300e6b10d2c18032cd4a76237b578d59
2021-03-15 13:09:25 -04:00
Liz Kammer
ea6666fba9 Move bazel.Properties to a BazelModuleBase
This allows more direct access to the bazel label and whether the module
is bp2build available.

Test: go test *
Change-Id: I23375835d20fa53d7d94127b2dc2d5bb20487bfb
2021-02-23 10:58:57 -05:00