Commit graph

3036 commits

Author SHA1 Message Date
Inseob Kim
5219c0e4bf Fix ndk and aml arch order
Some codes assume that the first arch is the primary arch. But ndk/aml
arch order have been [arm, arm64, x86, x86_64]. This fixes the order to
workaround possible breakage while building ndk.

Bug: 187196593
Test: OUT_DIR=out build/soong/scripts/build-ndk-prebuilts.sh
Change-Id: I33164a7e7c64a23f2cc1860acb24a2584f4dffad
2021-06-18 05:26:39 +00:00
Inseob Kim
800d114003 Add install_in_root to cc_binary
To support init_first_stage, install_in_root property is added to
cc_binary. The output is installed to {partition}, rather than
{partition}/{mount_point}/bin.

Bug: 187196593
Test: build init_first_stage
Change-Id: Ibc351645308676ed188f748972eb6312c9cbd64f
2021-06-18 05:25:44 +00:00
Jingwen Chen
442b1a4070 Use IsEnvTrue for USE_BAZEL_ANALYSIS check.
Make this consistent with the check in soong_ui: https://cs.android.com/android/platform/superproject/+/master:build/soong/ui/build/config.go;l=930;drc=0b55bdb7af7ab2a039fefc88086f0ee41c00ac69

Change-Id: I8d57fafa954ce3dd041cc38250819531125d81ac
Test: TH
2021-06-17 07:02:23 +00:00
Lukács T. Berki
84a1601804 Merge "Update some comments about the image mutator." 2021-06-15 15:50:11 +00:00
Lukacs T. Berki
2f5c340b49 Update some comments about the image mutator.
Test: It's just comment changes.
Change-Id: Idac69f5369caad028f3daa6aa5c1088d697c07e2
2021-06-15 15:49:51 +02:00
Chris Parsons
94a0bba5a9 Support cc_library_shared for mixed builds
Authors: cparsons, eakammer, jingwen

This CL also contains .toc file integration between Bazel and Make.

Fixes: b/190524879

Test: build/bazel/ci/mixed_droid.sh

Co-authored-by: Christopher Parsons <cparsons@google.com>
Co-authored-by: Liz Kammer <eakammer@google.com>
Co-authored-by: Jingwen Chen <jingwen@google.com>

Change-Id: If484042a58cb9f0db6d30a460f415f5684b4cbf6
2021-06-15 12:40:28 +00:00
Paul Duffin
4dbf6cfbae Improve error reporting when a rule cannot be found
Outputs the list of available rules on separate lines.

Test: m nothing
Change-Id: I845064e032f0a47d00883ff775c4f7b4fee7631e
2021-06-14 17:23:52 +01:00
Paul Duffin
cc1bd8364a Merge "Make copyBootJarsToPredefinedLocations simpler and less fragile" 2021-06-14 08:20:50 +00:00
Liz Kammer
2d7bbe3883 Append _alwayslink to prebuilt whole static deps
This allows us to support prebuilt archives that are part of whole
static deps.

Test: build/bazel/ci/bp2build.sh
Bug: 190716727

Change-Id: I913dbd8f85a1974fbd53c0cbaa49211db18ea45f
2021-06-11 08:10:50 -04:00
Paul Duffin
5f148ca7cf Make copyBootJarsToPredefinedLocations simpler and less fragile
Previously, copyBootJarsToPredefinedLocations relied on all its
parameters having the same length and the same order. That made it
quite fragile as changes to one of the parameters without corresponding
changes to the other would cause failures. It also combined the
retrieval of the boot dex jars from the modules, handling of missing
boot dex jar files and the generation of the rules to copy the files.

This change separates the retrieval of boot dex jars and handling of
missing files from the copying of those files while at the same time
making the function less fragile by replacing the three ordered
parameters with two maps that shared common keys.

Bug: 179354495
Test: m nothing
Change-Id: Idbcd24a7e8af89f7895a20aeddc58502dcbaad03
2021-06-10 14:28:10 +01:00
Liz Kammer
c49e682f37 Handle simple symlinks in mixed builds
Bug: 180945121
Test: build/bazel/ci/mixed_libc.sh
Change-Id: I49fba569a41dcb8cd4c2e58560817443697f58f1
2021-06-09 10:40:32 -04:00
Jingwen Chen
e8489563ff bp2build: build libc.so.
Test: TH

Bug: 183064430
Change-Id: Idfcf80b2415c23840d4b4ae9b826cf6f061dbef3
2021-06-09 05:33:40 +00:00
Spandan Das
5d1b929f21 Port module_partition logic for RRO from Make to Soong
The default partition for RRO is "product/" in Make, but it was
"system/" in Soong. This CL ports the logic from Make to Soong

To implement this, a new function PathForModuleInPartitionInstall is
created that enables callers to provide the relevant partition

Bug: 158407753
Test: from build/soong, ran go test ./java
Change-Id: I05b02eae7fe57189aaad5109c26cccc5823518ef
2021-06-08 17:53:31 +00:00
Liz Kammer
2f26595072 Merge changes I4a5ea40c,I40ab16e3
* changes:
  Handle excludes_{shared,static}_libs
  Extract function to handle configurable excludes
2021-06-07 16:42:38 +00:00
Liz Kammer
01b64bb216 Disable from mixed builds broken targets.
Test: build/bazel/ci/mixed_libc.sh
Change-Id: Ic478f5591874320750edea6097f1e415b1db9efa
2021-06-07 10:53:17 -04:00
Dan Albert
07538bb56b Merge "Use libabigail to track NDK ABIs." 2021-06-04 21:06:00 +00:00
Liz Kammer
47535c51fa Handle excludes_{shared,static}_libs
Bug: 188497994
Test: bp2build.sh
Change-Id: I4a5ea40cbd804e8542fe33143e4926abc0c6164f
2021-06-04 10:15:36 -04:00
Liz Kammer
9abd62d133 Use maps in bazel *attribute types
This is to simplify the process of resolving label + exclude labels
across the various configuration axes we have and across the various
properties/modules that use this behavior.

Test: ci/bp2build.sh && ci/mixed_droid.sh
Change-Id: I8efae3e75ddb365384f5caaf5bb504a5206618d3
2021-06-03 17:37:56 -04:00
Dan Albert
f1d14c7e67 Use libabigail to track NDK ABIs.
The local diffing behavior is currently flagged off so we can land
this in stages.

Test: pytest cc
Test: treehugger
Test: development/tools/update_ndk_abi.sh
Test: m ndk
Bug: http://b/156513478
Change-Id: Iccb314411bc74ea3ddfea8b85b0539709295f65a
2021-06-03 14:29:03 -07:00
Colin Cross
37b3626f2c Merge "Remove registerOverrideMutator" 2021-06-03 17:30:05 +00:00
Jingwen Chen
c306326fea Merge "bp2build: split as, c, and cpp srcs for cc_library" 2021-06-03 10:15:27 +00:00
Jingwen Chen
14a8bda31e bp2build: split as, c, and cpp srcs for cc_library
This CL adds support for cc_library to correctly split c, as and cpp
srcs in shared/static nested props, as well as splitting
the *filegroup* deps in those props, where each filegroup is expanded
into its own c, cpp and as srcs filegroups. This ensures that the
correct sources go into cc_library_static's underlying cc_libraries for
c, cpp and as sources respectively.

See the bp2build conversion test for a better visualization.

Bug: 183064430

Test: TH
Change-Id: I29add5140672d042adff65527d8b65f4a5f0a05b
2021-06-03 05:00:37 +00:00
Christopher Parsons
abca1d19a4 Merge "Clear mixed build denylist." 2021-06-02 14:18:23 +00:00
Jingwen Chen
adf5564f94 Merge "Fix OUT_DIR lookup in mixed builds." 2021-06-02 03:22:18 +00:00
Chris Parsons
45cffa4479 Clear mixed build denylist.
Test: mixed_libc and mixed_droid CI
Change-Id: Ib9c37fba00a7c13c38b77171a7ddc59ef82ec515
2021-06-01 16:59:34 -04:00
Jingwen Chen
8c52358ad7 Fix OUT_DIR lookup in mixed builds.
In mixed builds, Bazel operates in <root>/out/soong/workspace, but the real
OUT_DIR is just <root>out/, not <root>/out/soong/workspace/out. This CL
ensures that the correct OUT_DIR is passed to mixed builds's bazel by
making OUT_DIR absolute.

Also add STANDALONE_BAZEL to build_test's Bazel smoke test.

Test: TH
Change-Id: If8b4058d43bf821f5196016f9b0ad38edfe18716
2021-06-01 12:07:40 +00:00
Chris Parsons
2affc3bf59 Remove elements from denylist that are obsolete
Test: mixed_droid CI
Change-Id: Ib4b4a5114362feea358da5a989b41bc01f1f7010
2021-05-27 18:06:51 -04:00
Martin Stjernholm
664b2cf89a Merge "Drop "prebuilt_" prefixes from names registered in ApexInfo.InApexXxx." 2021-05-27 09:24:55 +00:00
Colin Cross
4ab2dd1afe Merge changes I0116f5f4,I950c9b54,I967f5c42
* changes:
  Treat java libraries in classpath fragments as directly in apex
  Make CopyDirectlyInAnyApex match the documentation
  Remove unused cc.copyDirectlyInAnyApexDependencyTag
2021-05-27 00:56:52 +00:00
Martin Stjernholm
be10503d3a Drop "prebuilt_" prefixes from names registered in ApexInfo.InApexXxx.
Neither InApexVariants nor InApexModules should have them. This allows
us to get rid of InApexVariantByBaseName as well.

Test: m nothing
Test: m nothing SOONG_CONFIG_art_module_source_build=false
Bug: 180325915
Change-Id: Icbe4e025ce1a4c8dd258ff95d326ca2f27905188
2021-05-26 17:05:17 +01:00
Colin Cross
4d4f7d6114 Make CopyDirectlyInAnyApex match the documentation
CopyDirectlyInAnyApex was documented to copy from child to parent, but
was copying from parent to child.  It is unused, so reverse it to
match the documentation.

Bug: 183759446
Test: next CL
Change-Id: I950c9b5416d66e83d76ca489aeb5e0572e005d5d
2021-05-25 18:28:38 -07:00
Rupert Shuttleworth
c194ffbcf3 Make GetTargetProperties() aware of more complex targets, like 'android_arm', instead of just 'android'.
Test: Added new unit test and updated existing tests.

Test: bazel build //bionic/... //external/... //frameworks/... //system/...

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

Change-Id: I250d1964f5cf42b92ddb929379d35d8c844423f7
2021-05-25 19:40:16 -04:00
Chris Parsons
26caa1b2de Mixed build denylist rollback
Previous changes broke mixed_droid CI, and reverting the denylist
changes should get the build green.

More rigorous testing and fixes to follow.

Test: `m linker` which was previously broken.
Change-Id: I9c009d3456ea0c553148316665c97bfb372606d7
2021-05-25 17:24:06 -04:00
Chris Parsons
990c4f4fc3 Rollforward "Split asm and c flags and srcs in..."
This fixes a test and rolls forward I28cf7437ee96cdf2fdbcb1eda2303691cff08ba4

Test: m nothing
Test: See I28cf7437ee96cdf2fdbcb1eda2303691cff08ba4
Change-Id: I0e450c28e70087e406e7b562d7e772785f177379
2021-05-25 12:15:52 -04:00
Colin Cross
4f9d8d6482 Merge "Revert "Split asm and c flags and srcs in bp2build output"" 2021-05-25 15:21:36 +00:00
Colin Cross
52aa4e1fd4 Revert "Split asm and c flags and srcs in bp2build output"
Revert submission 1714835-roboleaf-asm-c

Reason for revert: TestCcLibraryStaticProductVariableSelects fails everywhere
Reverted Changes:
I28cf7437e:Split asm and c flags and srcs in bp2build output
I2b47e6b55:Split libraries by language in cc_library_static

Change-Id: I85d39a462f0a5b3f5ff3d685906813fab9f01358
2021-05-25 15:20:39 +00:00
Christopher Parsons
ed73b76513 Merge "Split asm and c flags and srcs in bp2build output" 2021-05-25 14:58:32 +00:00
Jingwen Chen
962a8f0253 Merge changes I3ecdeaab,I43720641
* changes:
  Make BUILD file merging slightly smarter.
  bp2build/b: exit early in GENERATE_BAZEL_FILES=1.
2021-05-25 08:56:21 +00:00
Jingwen Chen
4910976314 Make BUILD file merging slightly smarter.
This change enables checked-in BUILD files like
prebuilts/clang/host/linux-x86/BUILD.bazel to be merged cleanly with the
bp2build generated one into the synthetic workspace.

The checked-in BUILD file contains a package() declaration that bp2build
also generates. To avoid double declaration, the BUILD file writer now
checks if the BazelTargets contain handcrafted targets. If so, it
delegates the package declaration to the handcrafted BUILD file instead.

This change also sorts the bp2build targets before the handcrafted ones,
and adds a section header to demarcate the two sets of targets.

Test: TH
Change-Id: I3ecdeaab3226b895b623daf0791d24a657f7a7c6
2021-05-25 07:01:55 +00:00
Chris Parsons
af24cdd99f Split asm and c flags and srcs in bp2build output
This allows removal of almost all current items from the mixed build
denylist, which were previously broken due to being unable to separately
control flags for compilations of different languages within the same
target.

Note that this does not appropriately implement asm/c srcs and flags for
either the shared variant or the static variant. This will require a
followup.

Test: bp2build.sh and mixed_libc.sh CI scripts
Test: Updated b2build tests

Change-Id: I28cf7437ee96cdf2fdbcb1eda2303691cff08ba4
2021-05-24 21:49:14 -04:00
Liz Kammer
e3e4a5f2d8 Handle arch/os-specific product variables
Bug: 183595873
Test: go test bp2build tests
Change-Id: I36e93ae1eb2943555dd304d5bdf62d995e77b437
2021-05-24 14:32:38 -04:00
Christopher Parsons
dbfafc0a3c Merge "Propagate unexported deps via implementation_deps" 2021-05-21 21:29:59 +00:00
Colin Cross
90463fe8cb Merge "Allow missing java_sdk_library files in AllowMissingDependencies builds" 2021-05-21 15:07:49 +00:00
satayev
a4cf238f4d Merge "Populate individual classpath_fragments' classpaths.proto configs." 2021-05-21 10:21:49 +00:00
Jingwen Chen
78257e5b6b Add a comment to absolutePath on why it's not exported.
Change-Id: Ib6595e8af3d845861d4c5988750e3c43280bb697
Test: TH
2021-05-21 02:37:00 +00:00
Colin Cross
18f840c45e Allow missing java_sdk_library files in AllowMissingDependencies builds
java_sdk_library modules in builds with AllowMissingDependencies may
be missing defaults modules that cause them to look for api files that
they normally wouldn't need.  Move the error to runtime so it doesn't
block the build unless the branch tries to build that module.

Test: prebuilts/build-tools/build-prebuilts.sh in aosp-build-tools
Change-Id: I279b0cd8493779f972c0ac02235967c10b35a5a0
2021-05-20 18:00:37 -07:00
satayev
8fab6f86af Populate individual classpath_fragments' classpaths.proto configs.
To avoid duplicates on *CLASSPATH environ variables at runtime, remove
split entries from platform-*classpath, i.e. all updatable jars that
have their own classpath fragments should not appear in the
platform-*classpath's classpaths.proto config.

Bug: 180105615
Test: m && launch_cvd; atest CtsClasspathsTestCases
Change-Id: Id2759ab8e106cc183e695bf3509a6ab60ab0ef2a
Merged-In: Id2759ab8e106cc183e695bf3509a6ab60ab0ef2a
2021-05-20 20:06:03 +01:00
Martin Stjernholm
408ffd8cca Plumb through OtherModuleFarDependencyVariantExists from blueprint.
Test: m nothing
Bug: 188398129
Change-Id: I64147293b6c51b437219e76e9e372fe56b977722
2021-05-20 16:43:04 +00:00
Chris Parsons
d6358775c8 Propagate unexported deps via implementation_deps
Test: bp2build and mixed_libc CI
Test: Manually verified that libc_bionic_ndk compilation gets the
appropriate headers (and no extra headers) from downstream

Change-Id: I79eb6e8ec1d415bd50d12105da4cf97101f95474
2021-05-20 12:05:24 -04:00
Liz Kammer
50d601731b Merge "Dump bazel product config in Soong" 2021-05-20 14:09:18 +00:00