Commit graph

35855 commits

Author SHA1 Message Date
Colin Cross
95fad7a56e Always propagate some environment variables to RBE
Always propagate LANG, LC_MESSAGES and PYTHONDONTWRITEBYTECODE
to RBE to get more consistent behavior between local actions and
RBE.

Bug: 182415460
Bug: 190593001
Test: treehugger
Change-Id: I726e6f02fd3ef77e158baf6fde77ffb7247a1375
2021-06-09 15:05:40 -07:00
Jingwen Chen
a4d9b86c8b Merge "bp2build: build libc.so." 2021-06-09 08:05:20 +00:00
Treehugger Robot
75851d2fb6 Merge "Only store what's used in SharedLibraryInfo" 2021-06-09 05:49:15 +00:00
Jingwen Chen
e8489563ff bp2build: build libc.so.
Test: TH

Bug: 183064430
Change-Id: Idfcf80b2415c23840d4b4ae9b826cf6f061dbef3
2021-06-09 05:33:40 +00:00
Treehugger Robot
f218e3d0c2 Merge "Handle no_libcrt in bp2build." 2021-06-09 00:48:06 +00:00
Jooyung Han
7f6e057f23 Merge "Interpret CRT object's min_sdk_version with ApiLevel" 2021-06-09 00:07:29 +00:00
Liz Kammer
d366c909ca Handle no_libcrt in bp2build.
Test: ci/bp2build.sh
Bug: 187928307
Change-Id: Ib80c4318169652b322e5d878c8784679e42f87dd
2021-06-08 17:18:22 -04:00
Liz Kammer
ef6dfea679 Only store what's used in SharedLibraryInfo
There was a reference to the static library provider, but only the
transitive static deps were used, so only store that part. Other members
were stored but unused anywhere.

Test: go test soong tests
Test: m nothing
Change-Id: I12a6b94806c052c3f0df3cab0a10f17042af1c38
2021-06-08 16:44:23 -04:00
Spandan Das
05f1a0a795 Merge "Port module_partition logic for RRO from Make to Soong" 2021-06-08 20:41:45 +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
Colin Cross
9eb611a3cc Merge changes I162b0f68,I1689b670,Id6d997ee,I9aae2a16
* changes:
  Don't use unsafe_ignore_missing_latest_api in TestJavaSdkLibraryDist
  Remove core_lib property from java_sdk_library
  Ignore owner property when computing java_sdk_library dist subdirectory
  Make the default java_sdk_library dist_group "unknown"
2021-06-08 17:02:59 +00:00
Martin Stjernholm
81b90d98db Merge "Remove use of fake soong.variables." 2021-06-08 13:55:35 +00:00
satayev
5831f70dab Merge "Add exemption for framework-sdkextensions-classpaths boot jar." 2021-06-08 13:45:56 +00:00
Martin Stjernholm
040e0443c3 Remove use of fake soong.variables.
Use the --soong-only flag instead to create it the proper way with the
config make step. This fixes build problems arising from the incomplete
soong.variables settings.

This partially relands https://r.android.com/1535202 so that we'll use
TARGET_PRODUCT=mainline_sdk in module SDK builds everywhere.
build-aml-prebuilts.sh isn't removed completely because we still need
the special case to create build_number.txt.

Test: art/build/build-art-module.sh --skip-apex && \
      packages/modules/ArtPrebuilt/update-art-module-prebuilts.py \
        --local-dist out/dist
  then check that the created prebuilt dex2oatd64 runs with the repro
  in b/190194345
Test: build/soong/scripts/build-mainline-modules.sh
  then
      prebuilts/runtime/mainline/update.py --local-dist .../out/dist
  in a master-art tree and check that art/build/build-art-module.sh
  works there
Bug: 190194345
Bug: 174315599
Change-Id: I86327b082b61c292f18c0a6b315d9add08002832
2021-06-08 11:36:53 +01:00
Anton Hansson
4aa0003362 Merge "Remove sourcepath argument from metalava invocations" 2021-06-08 09:40:22 +00:00
Anton Hansson
075da1904f Merge "Stop filtering html files from droidstubs input" 2021-06-08 09:31:58 +00:00
Anton Hansson
2be5d88b35 Merge changes I91abbd28,I111a69e6
* changes:
  Add a soong-only mode to soong-ui
  Various cleanup in soong_ui to aid new feature
2021-06-08 08:45:48 +00:00
Yo Chiang
c33cceb408 Merge "cc/sabi.go: Propagate ShouldCreateSourceAbiDump to reuseObjTag deps" 2021-06-08 06:02:07 +00:00
Jooyung Han
94a76ee868 Interpret CRT object's min_sdk_version with ApiLevel
min_sdk_version values should be interpreted before use.

Bug: n/a
Test: m (in REL)
Change-Id: Ia45f5c7aeb4efcd8daef1deaf54f333dcdd1379d
2021-06-08 09:49:48 +09:00
Dan Albert
ad66593085 Disable ABI dumps on Darwin.
I'm not sure why these targets are getting built as part of the sdk
build anyway, but we don't need them.

Test: treehugger
Bug: http://b/156513478
Bug: http://b/190394921
Change-Id: I1ea0e75f459ad7cad648f96b67a4f2424d36fda7
2021-06-07 13:22:30 -07: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
Anton Hansson
556e8149cb Remove sourcepath argument from metalava invocations
This is no longer required to find package.html files, so remove it.

Bug: 153703940
Test: m checkapi
Change-Id: I80ec219cb9ef8922094336a5d45652c8e59aa113
2021-06-07 16:04:46 +01:00
Anton Hansson
edd61643be Stop filtering html files from droidstubs input
Metalava now expects html files to be specified explicitly. This
filtering was originally added because jdiff could not cope with html
inputs, but jdiff support has been removed in r.android.com/1455335.

Bug: 153703940
Test: m checkapi
Change-Id: I34164b633bab2892e3a1c0fd0257fcf98d537655
2021-06-07 16:02:53 +01:00
Liz Kammer
d5c00287f0 Merge "Disable from mixed builds broken targets." 2021-06-07 14:57:47 +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
Anton Hansson
0b55bdb7af Add a soong-only mode to soong-ui
The previous --skip-kati flag could be interpreted as "do not run kati
to re-generate ninja file". Add a more specific flag for the "soong
only" build use-case, where we do not load the kati-generated ninja
files at all.

Bug: 189187214
Test: build/soong/soong_ui.bash \
  --make-mode \
  --soong-only
  --skip-soong-tests \
  TARGET_PRODUCT=mainline_sdk \
  SOONG_ALLOW_MISSING_DEPENDENCIES=true \
  SOONG_SDK_SNAPSHOT_VERSION=unversioned \
  SOONG_SDK_SNAPSHOT_USE_SRCJAR=true \
  out/soong/mainline-sdks/art-module-sdk.zip
Change-Id: I91abbd28af517d4b550ebc6d88fd64947caf9545
Merged-In: I91abbd28af517d4b550ebc6d88fd64947caf9545
(cherry picked from commit 546de4a1f3)
2021-06-07 14:34:40 +01:00
Anton Hansson
5a7861a272 Various cleanup in soong_ui to aid new feature
- Rename the "BuildX" variables to "RunX"
- Remove redundant comments
- Inline all the "what to do" based on config in build.go
- Inline some constants only used in one place

Bug: 189187214
Test: m nothing
Test: build/soong/build_test.bash
Change-Id: I111a69e642212d7938d4971283545e0d9acbb01a
Merged-In: I111a69e642212d7938d4971283545e0d9acbb01a
(cherry picked from commit d274ea9196)
2021-06-07 14:34:40 +01:00
Anton Hansson
70336cd2fa Make soong create sourcepath dirs
Sourcepath is set to dir of the Android.bp, but that dir does not
necessarily have any inputs for the metalava invocation defined in that
Android.bp. This leads to problems when metalava tries to read a
non-existent dir, so create it first.

Bug: 153703940
Test: m sdk dist
Change-Id: I8c2ca45c8f066cabf3247b9652a7094cefc047a9
Merged-In: I8c2ca45c8f066cabf3247b9652a7094cefc047a9
(cherry picked from commit 7eff3a8fc3)
2021-06-07 14:34:39 +01:00
Yi-Yo Chiang
21d1c6d637 cc/sabi.go: Propagate ShouldCreateSourceAbiDump to reuseObjTag deps
`reuseObjTag` is a dependency from the shared variant of a `cc_library`
to the static variant. When such dependency exist, the shared variant
would reuse the object files of the static variant.
Thus if the shared variant requires ABI dump, then the static variant
would need to generate ABI dump as well.

Bug: 190339664
Test: m findlsdump
Change-Id: I015328d74acbeb89ff7622397e59b68864af34a4
2021-06-07 20:29:11 +08:00
Lukacs T. Berki
1af9316e0a Remove sort_bss_symbols_by_size.
Its only use was removed in aosp/1717013.

Bug: 187928080
Test: Presubmits.
Change-Id: If6acbfe8ba21ec4dc34166768ba1bde3bb78123c
2021-06-07 09:23:15 +02:00
Dan Albert
07538bb56b Merge "Use libabigail to track NDK ABIs." 2021-06-04 21:06:00 +00:00
Pirama Arumuga Nainar
e36a3d9d0d Merge "[cc] Cleanup unused function" 2021-06-04 20:31:00 +00:00
satayev
1b75a3ce62 Add exemption for framework-sdkextensions-classpaths boot jar.
As long as we have boot jars defined in make, we should try to keep
global.UpdatableBootJars as a source of truth when it comes to classpath
configuration. However, for testing purposes there is a need to add
java libraries to bootclasspath that aren't present in
PRODUCT_UPDATABLE_BOOT_JARS variable.

Ideally, we would unconditionally add all contents to the config for
test apexes, however, I don't fully understand apex merging to support
it.

Bug: 180105615
Test: atest sdkextensions_classpaths_e2e_tests
Change-Id: I552f93289c27b3713e75dcda1faed909b0bfcef2
2021-06-04 19:42:54 +01:00
Pirama Arumuga Nainar
bd20ccb83e [cc] Cleanup unused function
Test: TH
Change-Id: I7c7fd1ada1303e8006b27923f124c836a4776d8b
2021-06-04 11:33:33 -07:00
Christopher Parsons
fa4ab8a7f4 Merge "Support mixedbuilds for static variant cc_library" 2021-06-04 15:09:21 +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
74deed445b Extract function to handle configurable excludes
This allows it to be used for other modules types and other properties
(e.g. static_libs & exclude_static_libs).

Test: go test soong tests
Bug: 188497994
Change-Id: I40ab16e3b540ece0a6684558b32f7e8e25df6f24
2021-06-04 10:15:34 -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
Chris Parsons
bcc9b88d49 Support mixedbuilds for static variant cc_library
Test: mixed_droid CI
Change-Id: I3126b528b375462d78e8146b5432d1e5cec20829
2021-06-03 16:52:46 -04:00
Colin Cross
37b3626f2c Merge "Remove registerOverrideMutator" 2021-06-03 17:30:05 +00:00
Ivan Lozano
42b7157ff6 Merge changes I4976d3e1,I4c53b937,I502eaa4b
* changes:
  Rust rlib vendor snapshot support.
  Export cc functions for snapshotting Rust rlibs.
  Rust cdylib/statliclib support for vendor snapshot.
2021-06-03 16:54:14 +00:00
Chris Gross
471370b2e2 Merge "Use broader permissions when archiving files." 2021-06-03 16:42:25 +00:00
Ivan Lozano
39f901a137 Merge "Export cc vendor functions for usage by rust." 2021-06-03 15:50:36 +00:00
Ivan Lozano
3149e6ed18 Rust rlib vendor snapshot support.
Adds support for snapshotting Rust rlibs. This allows us
vendor-specific code that uses rlib-only linkage until dylib
snapshot support is added.

Bug: 184042776
Test: m nothing # new Soong tests pass
Test: Example test Rust vendor module builds
Test: m dist vendor-snapshot # includes rlibs
Change-Id: I4976d3e1efec0ee778cc97730d45be471dffb678
2021-06-03 08:36:09 -04:00
Ivan Lozano
d1dec54988 Export cc functions for snapshotting Rust rlibs.
Export additional fuctions, structs, and interfaces from cc for use in
the rust package to allow for rlib snapshotting.

Bug: 184042776
Test: m nothing
Change-Id: I4c53b9378d5d5b5973dbd23ab692cdfb2ede60b9
2021-06-03 08:34:47 -04:00
Ivan Lozano
1921e8003d Rust cdylib/statliclib support for vendor snapshot.
Adds support for platform vendor_available Rust FFI libraries and
binaries to be included in the vendor snapshot.

Because rlib and dylibs are not yet in snapshots, libstd cannot be
included in a vendor snapshot. As a result, vendor-specific Rust code
can't be guaranteed to work with the platform-provided vendor_available
modules built with a newer toolchain. For now, a check is added
indicating vendor-specific Rust code is unsupported.

This changes the linkage for vendor variants of these modules to default
to rlib linkage since dylibs cannot be included in the snapshot yet.

Bug: 184042776
Test: m nothing # new Soong tests pass
Change-Id: I502eaa4bb962eb87ff868fcf49b435f0d2f982e6
2021-06-03 08:32:05 -04:00
Ivan Lozano
d67a6b0a88 Export cc vendor functions for usage by rust.
This CL exports and refactors some cc vendor-snapshot related functions
so they can be reused by rust modules to support vendor snapshotting.

Bug: 184042776
Test: m nothing
Change-Id: I12706e62ce0ac3b2b4298085fafc1d77b8e0a0c4
2021-06-03 08:31:55 -04: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