Commit graph

38737 commits

Author SHA1 Message Date
Serik Beketayev
319c773900 [IRadioConfig] Add to VNDK variant list
Test: build
Bug: 198331805
Change-Id: Ibacc996f42c4bfa12b135247a2cebe1e28bbff09
Merged-In: Ibacc996f42c4bfa12b135247a2cebe1e28bbff09
2021-09-20 17:32:30 -07:00
Jingwen Chen
b3c3d9a2d5 Merge "Fix bp2build-progress generating an empty converted_modules list, and duplicate module names." 2021-09-21 00:24:36 +00:00
Aurimas Liutikas
e992a52d0e Merge "Enable compose kotlinc plugin when depending on the compose runtime" 2021-09-20 23:28:33 +00:00
Martin Stjernholm
531d8fdc2a Remove workaround for modules with missing BCP fragments, as they are
present now.

#codehealth

Test: presubmits
Bug: 192868581
Change-Id: I8370525849ea589af0bf4f8d3fd081f3004516a1
2021-09-20 23:47:24 +01:00
Colin Cross
80bb3164b9 Merge "Add support for d8 --main-dex-rules" 2021-09-20 20:22:44 +00:00
Treehugger Robot
e646717cdf Merge "Increase timeouts in Test_runWithTimeout" 2021-09-20 19:53:57 +00:00
Treehugger Robot
77cdde7d91 Merge "Fix statusfile used in dexpreopt" 2021-09-20 19:53:38 +00:00
Chris Parsons
953b35623a bp2build: reference static variants directly
Previously, when referencing a cc_library as a static_lib from a
converted module, the corresponding target would depend on the "root
target" of that cc_library. This resulted in a superfluous dependency on
the shared target of the cc_library dependency. This superfluous
dependency could sometimes result in cycles.

This change ensures the static target name is directly specified in such
cases.

Test: mixed_libc.sh CI
Test: USE_BAZEL_ANALYSIS=1 m fmtlib
Change-Id: I36ee9f0a9017b1e9d73df9e3174669107f0afd4f
2021-09-20 15:15:29 -04:00
Spandan Das
3d5cd4d109 Fix statusfile used in dexpreopt
https://android-review.googlesource.com/c/platform/build/soong/+/1820496/1/scripts/manifest_check.py#361
caused a regression wrt to statusfile creation. Specifically it inverted
the logic used to create the status file. This file is used in
dexpreopt, thereby affecting all odex files

Test: In internal git, m <an_odex_file>. File size is restored to
pre-regression value
Bug: 199921980
Bug: 200329228

Change-Id: If1e61ac8e2b95455dacc6e7b9431c8f6e1f339b3
2021-09-20 18:24:56 +00:00
Martin Stjernholm
bacf6a1a6a Merge "Show less ambiguous paths in the error when it fails to match the given output file." 2021-09-20 17:44:01 +00:00
Liz Kammer
59c0eaedca Remove arch-variant from some python properties
Version and package should not vary based on architecture.

Test: m nothing
Change-Id: Id9cb655d9c25caee3b6068a261b3db36e1654467
2021-09-20 12:56:17 -04:00
Alexander Smundak
dd6149122c Merge "Share version settings with product config makefile." 2021-09-20 16:56:10 +00:00
Colin Cross
a1ff7c6926 Enable compose kotlinc plugin when depending on the compose runtime
When a module depends on the compose runtime add a -Xplugin argument
to the kotlinc flags that enables the compose compiler plugin.

Bug: 196351110
Test: TestKotlinCompose
Change-Id: I423a3c4d12df42804a24b672a40a165bc8dd165f
2021-09-20 09:12:42 -07:00
Treehugger Robot
3769a27c5e Merge "Add test to TestJavaStableSdkVersion for legacy core platform" 2021-09-20 14:04:35 +00:00
Martin Stjernholm
a4aaa47a00 Show less ambiguous paths in the error when it fails to match the given
output file.

PathRelativeToTop should give an unambiguous path that can be used for
matching, as opposed to Rel().

Test: `m nothing` with a test with an invalid Output() call
Change-Id: I6d501df6acb0a1700f1480bd4250320f69278c39
2021-09-20 14:17:09 +01:00
Martin Stjernholm
3536614edd Merge changes I464e6ebd,Iaf7655e4
* changes:
  Make it possible to pass an error message with an invalid optional path.
  Replace OptionalPath.valid flag by checking the path itself.
2021-09-20 13:03:20 +00:00
Martin Stjernholm
c32dd1c0ab Make it possible to pass an error message with an invalid optional path.
This is useful to delay errors until the paths need to be used.

Test: m nothing
Change-Id: I464e6ebd04b06c5e17617e8ee4e65a3320f1168f
2021-09-20 14:02:11 +01:00
Martin Stjernholm
2fee27f3c9 Replace OptionalPath.valid flag by checking the path itself.
Test: m nothing
Change-Id: Iaf7655e4676d2beeb7c7ac3bcba11a7dad4a01a3
2021-09-20 14:02:11 +01:00
Jingwen Chen
310bc8f5f4 bp2build: Refactor metrics collection to use exported functions.
This CL splits the metric count into handcrafted, generated, and
unconverted modules.

Test: CI
Test: m bp2build, the metrics reported are identical.
Change-Id: I80e3d2fd2989222bd40b6433b4a1924b4943d0ba
2021-09-20 11:54:00 +00:00
Jingwen Chen
afb84bd78f Fix bp2build-progress generating an empty converted_modules list, and
duplicate module names.

We were using the value receiver on AddConvertedModule before, which
didn't actually mutate the internal slice state.

Test: Run bp2build-progress.py
Change-Id: Ic60f8f6214a91dc129abf62c57dd0b85efffb283
2021-09-20 10:31:46 +00:00
Jingwen Chen
0c7ca97876 Merge "bp2build: add converted modules to codegen metrics, and remove the compat layer." 2021-09-20 08:27:34 +00:00
Martin Stjernholm
14cdd71152 Add a function to match modules through a variation map.
Can be a more convenient alternative than specifying the full subdir
concatenation of the variants. E.g. common arch and os variations don't
have to be hardcoded.

Test: `m nothing` with https://r.android.com/1801128
Change-Id: Ic2966e109d61dfee6a2b4fcbcbf8f73274babca9
2021-09-17 23:52:03 +01:00
Colin Cross
2f08bc1a5c Increase timeouts in Test_runWithTimeout
Under load sometimes the 1 millisecond timeouts are not run before
a 1 second sleep finishes, or `echo foo` is not run before a 1
second timeoutt.  Increase the long sleeps and timeouts to 10 seconds.
This doesn't affect normal test runtime as the command should timeout
after 1 millisecond.

Bug: 199207577
Test: Test_runWithTimeout
Change-Id: I31166850a473b9cde37906a62d026580e7a7bd3f
2021-09-17 21:36:29 +00:00
Zach Johnson
5145e9d917 Add NFC to the Rust allowlist
rustfmt & preupload checks are being checked in shortly

Bug: 197333653
Test: compile
Change-Id: I91f14dc9a58d04fda6ae77de2ea5d85f481d0563
2021-09-17 12:08:44 -07:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
4aeaf37bb7 Merge changes from topic "mixed-build-cc-library-shared"
* changes:
  Expose TocFile via CcInfo
  Clean up StarlarkFunctionBody for getCcInfoType
  Incorporate cc_library_shared into mixed builds
2021-09-17 14:29:17 +00:00
Anton Hansson
f8ea3729ca Add back the api_srcs argument
This arg provides the ability to pass sources to the metalava
invocations that are part of a java_sdk_library without affecting
the runtime library.

This is useful in various scenarios, e.g.: when javadoc in some source
files affects the metalava behavior. For example, the javadoc-generation
javadoc tags @paramDoc, @returnDoc etc. Passing these as a library does
not work because class files do not contain javadoc.

Bug: 186197911
Test: manually inspect module stub src for doc enhancements
Merged-In: I2ce98f891283514e1896c52d9335550c1f5435fb
Change-Id: I2ce98f891283514e1896c52d9335550c1f5435fb
2021-09-17 13:42:44 +00:00
Jingwen Chen
30204afc67 Merge "Remove __bp2build__ prefix trimming." 2021-09-17 13:01:17 +00:00
Jiakai Zhang
2c6ede11cc Merge changes I9c94a54a,Idc0c73a7
* changes:
  Preopt system server jars with updatable bootclasspath.
  Preopt APEX system server jars from prebuilts.
2021-09-17 11:20:10 +00:00
Jiakai Zhang
c9f9d56ed4 Merge "Revert^2 "Preopt APEX system server jars."" 2021-09-17 11:19:51 +00:00
Jingwen Chen
6117450ead bp2build: add converted modules to codegen metrics, and remove the
compat layer.

The list of converted modules is used for tracking bp2build progress.

The module_name_to_label aliases weren't really adding much value to
mixed builds, so let's drop the feature for now and simplify the code.

Test: CI
Test: USE_BAZEL_ANALYSIS=1 m droid
Change-Id: I3269344cfe6d1c72c108d66c6e820bc0ec19bb34
2021-09-17 08:47:16 +00:00
Jingwen Chen
16d90a8954 Remove __bp2build__ prefix trimming.
This is no longer needed after r.android.com/1792714

Test: CI
Change-Id: I808c3124cf1a4f3ebe5d25e41f346a818c3cc57c
2021-09-17 07:16:59 +00:00
Colin Cross
5ea963e60a Add support for d8 --main-dex-rules
d8 supports --main-dex-rules to replace the old mainDexClasses
script.

Test: m checkbuild
Change-Id: Ieddcf4de50cc13509c06bbffe9f1314ee3dd23b6
2021-09-16 19:14:30 -07:00
Chih-hung Hsieh
935ae2c51d Merge "Use ccCmd to generate clang-tidy dependent file" 2021-09-17 01:59:23 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
62585e8436 Expose TocFile via CcInfo
To reflect what's provided in SharedLibraryInfoProvider

Move the logic for identifying the toc file into Starlark
instead of the Soong Go code.

Adapt TestGetCcInfoParseResults to expect the toc as well.

Test: build/bazel/cquery/request_type_test.go:TestGetCcInfoParseResults
Test: cc/library_test.go:TestCcLibrarySharedWithBazel
Test: build/bazel/ci/mixed_{libc,droid}.sh
Change-Id: I40ad47158cb98b14ca03c21e351988818cb01770
2021-09-16 20:55:10 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
4fbc62196d Clean up StarlarkFunctionBody for getCcInfoType
Instead of repeating, pull repetition into vars

Test: build/bazel/ci/mixed_{libc,droid}.sh
Change-Id: If3c8387ac0aeb6364e7e4bc58a4e3a39c3c708d5
2021-09-16 20:54:57 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
bc4e734e59 Incorporate cc_library_shared into mixed builds
The infrastructure is already there via its need in
`cc_library`. Therefore, just enable it by setting
the `bazelHandler` in `LibrarySharedFactory`, and
add a test to verify the functionality.

Bug: 198817980
Test: cc/library_test.go:TestCcLibrarySharedWithBazel
Change-Id: Ibff80616632af59a0e409110f8645e028f99c7d6
2021-09-16 18:13:52 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
ac5097fcf4 Create bp2build converter for cc_shared_library
Factor out shareable code with cc_static_library

Remove `Linkstatic` field for shared cases,
because it's redundant with the rule

Bug: 198241907
Test: cc_library_shared_conversion_test.go
Test: mixed_{libc,droid}.sh
Change-Id: I5be3b66f812893bce41edb425fbd143ab22d9051
2021-09-16 15:00:56 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
a5474e36c5 Remove Linkstatic field for static cases
With the explicit implementation of cc_library_shared,
this is now redundant for both, so remove it.

Test: cc_library_static_conversion_test.go
Test: mixed_{libc,droid}.sh
Change-Id: I6e7733ca08c254562e95e70d93c9f519719d8a18
2021-09-16 15:00:47 +00:00
Martin Stjernholm
33ce5d6c0e Merge "Remove fallback code path for missing BCP fragments that is no longer necessary." 2021-09-16 14:38:01 +00:00
Treehugger Robot
a66a9f1a14 Merge "Prevent systemserverclasspath_fragment from depending on prebuilts" 2021-09-16 11:34:03 +00:00
Paul Duffin
25322e4d98 Prevent systemserverclasspath_fragment from depending on prebuilts
When TARGET_BUILD_APPS is set then TARGET_BUILD_USE_PREBUILT_SDKS=true
which causes all java_sdk_library_import modules to be treated as
prefer:true.

That breaks the build when the systemserverclasspath_fragment's content
property references a source java_sdk_library module that has a
corresponding java_sdk_library_import prebuilt module.

This fixes the issue by marking the dependency from the
systemserverclasspath_fragment to the source module as one that must
not be replaced with a reference to the prebuilt module.

Test: - update art prebuilts to include service-art
      m TARGET_BUILD_APPS=Calendar apps_only
      - fails before, works afterwards
Bug: 199116972
Change-Id: Ia2d8ce7bb7e644336a42c901f7fb8ea50fd67909
2021-09-16 11:12:51 +01:00
Paul Duffin
1ea7c9fa52 Add test to TestJavaStableSdkVersion for legacy core platform
Adds a test case to TestJavaStableSdkVersion for the case where a
module uses sdk_version: "core_platform" but is in the list of modules
that can use the legacy version.

This required storing the lookup map in the Config to allow it to be
customized for the test.

Bug: 180399951
Test: m nothing
Change-Id: I404705c3fd8a559649c6ab2624856cf78f49f85c
2021-09-16 11:12:43 +01:00
Paul Duffin
9428970dac Improve the documentation in the android/sdk.go file
Makes it adhere to the go standard practice of prefixing documentation
comments with the name of the type/func/method.

Bug: 195754365
Test: m nothing
Change-Id: Idf3fe827edc9b6d67d12a99a4b27539ac938ea95
2021-09-16 09:06:50 +01:00
Paul Duffin
05732954c6 Remove unnecessary archTypeSpecificInfo.optimizableProperties()
The method is provided by an embedded type.

Bug: 195754365
Test: m nothing
Change-Id: I08ede08a393dbabf40f064befaf73ef2947380bd
2021-09-16 09:05:41 +01:00
Paul Duffin
f68f85a3ca Move setting of link type properties to linkPropertyInfo
Bug: 195754365
Test: m nothing
Change-Id: Ica90a42cd8e4a79251271164f137dcdf60b3bd55
2021-09-16 09:05:41 +01:00
Jiakai Zhang
519c5c82e5 Revert^2 "Preopt APEX system server jars."
This reverts commit 92346c4832.

Reason for revert: Fixed build error.

The build error is fixed by ag/15841934. This CL remains unchanged. This
CL will be submitted AFTER ag/15841934 is submitted.

Bug: 200024131
Test: 1. Patch this CL and ag/15841934 into internal master.
  2. sudo vendor/google/build/build_test.bash

Change-Id: I5f2b8357846fc7dda56e25ebe6ffb095e8047ec8
2021-09-16 06:25:26 +00:00
Chih-Hung Hsieh
8e09f2627d Use ccCmd to generate clang-tidy dependent file
* After this change, make libtinyxml2-tidy should generate
  correct out/.../libtinyxml2.tidy.d file.
  Touching one of the dependent files, e.g., tinyxml2.h,
  should invoke clang-tidy but not to recompile tinyxml2.o.
* Note that linking libraries still depend on .tidy targets,
  so make libtinyxml2 will call clang-tidy, regnerate
  tinyxml2.tidy.d, tinyxml2.tidy, tinyxml2.o.d, tinyxml2.o.
* A clang-tidy rule uses the same $cFlags for both clang and clang-tidy.
  To share it and avoid over long command lines, we use modern shell
  array variables and cannot use old bourne shell.

Bug: 199169329
Test: WITH_TIDY=1 make
Test: WITH_TIDY=1 make libtinyxml2-tidy | grep tinyxml2
Test: touch external/tinyxml2/tinyxml2.h; make libtinyxml2-tidy | grep tinyxml2
Change-Id: I6175add58d7313ee50c9308b78c9290a60770052
2021-09-16 02:25:52 +00:00
Treehugger Robot
b1a12462a9 Merge "Share cFlags, tidyFlags, etc. in a module" 2021-09-16 02:20:25 +00:00
Martin Stjernholm
b1e61cb8bc Remove fallback code path for missing BCP fragments that is no longer
necessary.

#codehealth

Test: m nothing
Bug: 179354495
Change-Id: Iaddf163e69b52cef82d522311e81bef9bdb4aa8d
2021-09-16 00:55:53 +01:00
Chih-Hung Hsieh
b8082295b6 Share cFlags, tidyFlags, etc. in a module
* In builder.go, share common flags in a module.
  * This replaces the sharing of cflags/cppflags/asflags in cc.go.
  * A unit test in apex_test.go now fails and is commented out.
    It is a failing test hidden by old optimization in cc.go.
* In module.go, expand the reference variable $someflags<n>,
  or ${someflags<n>} to keep many existing unit tests work as is.
* The build.ninja size was reduced from 8.1GB to 6.2GB,
  for aosp_arm64-eng WITH_TIDY=1 USE_RBE=true,
  and from 7.5GB to 5.6GB when USE_RBE is 0.
  Content of build.ninja is also more readable and searchable.
  Read/write build.ninja times are also reduced,
  depending on disk I/O speed.

Test: make WITH_TIDY=1
Change-Id: I17f96adf4844136d52e5d40f57a19d9e290162b7
2021-09-15 16:05:41 -07:00