Commit graph

58637 commits

Author SHA1 Message Date
Jingwen Chen
17e0b7607a Merge "bp2build: disallow bp2build_available definition with neverallow." 2022-10-10 13:38:03 +00:00
Treehugger Robot
8e4a787ae7 Merge "Allow overriding rro category in override_runtime_resource_overlay" 2022-10-07 22:39:26 +00:00
Treehugger Robot
41a7fedd39 Merge "Fix incrementality bug with merged BUILD files" 2022-10-07 22:21:26 +00:00
Cole Faust
fd88414b4c Fix incrementality bug with merged BUILD files
The merged build files should be added as ninja dependencies,
so we rerun when they're changed.

Fixes: 246552590
Test: m bp2build, m bp2build again and observe it didn't rerun. Then add a comment in external/protobuf/BUILD.bazel, run m bp2build again, and observe it reruns
Change-Id: I26ed035cc0a894500a192f9aa3371fb46519689b
2022-10-07 13:11:45 -07:00
Zi Wang
aa981edcf0 Incorporate bpf into mixed builds
Bug: 240163393
Test: TestBpfWithBazel in bpf_test.go
Change-Id: I1d24a9c0d1d6911987c730bf1b5b7e02d6e73a5e
2022-10-07 18:30:45 +00:00
Jeremy Meyer
7e671297c7 Allow overriding rro category in override_runtime_resource_overlay
Bug: 240322840
Test: unit tests
Change-Id: I6b07cf57dc113e3805346e50ef9896471df9f53c
2022-10-07 18:21:34 +00:00
Yu Liu
f1e6126cb0 Merge "Add libprofile-clang-extras when coverage is enabled." 2022-10-07 17:46:10 +00:00
Trevor Radcliffe
4e503ec09d Merge "Split ldflags in bp2build" 2022-10-07 17:31:29 +00:00
Paul Duffin
6e8f980324 Merge "Properly skip TestBootImageConfig on non-Linux platforms" 2022-10-07 16:50:54 +00:00
Lais Andrade
dd0cc36b27 Merge "Revert "Enable new python path behavior by default"" 2022-10-07 13:28:30 +00:00
Treehugger Robot
d504adbead Merge "apex_key bp2build: disambiguate module and src deps." 2022-10-07 10:55:50 +00:00
Paul Duffin
85d8bdc10e Properly skip TestBootImageConfig on non-Linux platforms
Bug: 245956352
Test: m nothing
Change-Id: I6402573b378eee77d802829ec5dfacf4c514d3b8
2022-10-07 11:48:17 +01:00
Lais Andrade
4d5cc709fa Revert "Enable new python path behavior by default"
This reverts commit 5fe655d1c7.

Reason for revert: DroidMonitor: Potential culprit for Bug b/251688241 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Change-Id: I1ea4df27557fc891d8f0156ec5681f9b0c601c98
2022-10-07 10:09:09 +00:00
Jingwen Chen
a4b7eed0bd bp2build: disallow bp2build_available definition with neverallow.
..other than the specified directories.

Test: CI

Bug: 251197532
Fixes: 251197532
Change-Id: Iec6407c915d2554bbfb62aea4591783208c4f633
2022-10-07 09:54:16 +00:00
Sorin Basca
538911b686 Merge "Revert^2 "Use the toolchain from JDK 17"" 2022-10-07 05:10:30 +00:00
Treehugger Robot
be5f83ef1b Merge "Enable new python path behavior by default" 2022-10-07 01:02:30 +00:00
Paul Duffin
3a56f5e0e0 Skip TestBootImageConfig on non-Linux platforms
Bug: 245956352
Test: m nothing
Change-Id: I4c0bfd24febd308d8efa62da9603795a7e5ed222
2022-10-06 21:39:21 +01:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
a44a4e079f Merge "Add Soong tests for cc_prebuilt_binary for bad srcs" 2022-10-06 17:48:15 +00:00
Treehugger Robot
e81503e161 Merge "Fix Errorf format string for error" 2022-10-06 17:43:07 +00:00
Paul Duffin
5b0bba9ff5 Merge changes I948c7e51,If917cfbc,I7845b793,Ia815537e
* changes:
  Prevent bootImageVariant.licenseMetadataFile being set twice
  Test bootImageConfig/Variant fields
  Add Config,RunningInsideUnitTest
  Add CommonOs to Config.Targets
2022-10-06 17:20:41 +00:00
Chih-hung Hsieh
55d3e2ba14 Merge "Add TIDY_EXTERNAL_VENDOR" 2022-10-06 17:12:05 +00:00
Treehugger Robot
0656d7d670 Merge "apex bp2build: refactor module names to be more meaningful." 2022-10-06 16:57:08 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
7a11dc8689 Fix Errorf format string for error
Also go ahead and mark `checkOverrides` as a `t.Helper()`

Test: go test
Change-Id: I368aabf4d032c02773416f27affa12eb40e77b40
2022-10-06 15:24:11 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
b1bd77048d Add Soong tests for cc_prebuilt_binary for bad srcs
Test: TestPrebuiltBinary{NoSrcsNoError,MultipleSrcs}
Change-Id: I1c803e38bae68e452cebf6208412cefed900c7f6
2022-10-06 14:10:49 +00:00
Jingwen Chen
34feb1471a apex bp2build: refactor module names to be more meaningful.
Numbered module names weren't obvious.

Test: presubmits
Change-Id: Iee921e2965d1664ed1bccd934ab80f913eff6356
2022-10-06 13:02:30 +00:00
Paul Duffin
20d90e3e51 Prevent bootImageVariant.licenseMetadataFile being set twice
Previously, in a build containing source and prebuilt art
bootclasspath_fragments, the bootImageVariant.licenseMetadataFile was
set twice with the source always being set after the prebuilt and
so winning.

This change only sets bootImageVariant.licenseMetadataFile for the
active module so it will use the prebuilt's license file if that is
preferred.

Bug: 245956352
Test: m nothing
Change-Id: I948c7e5123169452f67c85ad98c4bbdb90a5d2de
2022-10-06 11:06:53 +01:00
Paul Duffin
8eb4573b23 Test bootImageConfig/Variant fields
Most of the fields in the bootImageConfig/Variant structs are assigned
inside a Once func so are guaranteed to be only set once. However, some
are assigned outside. This change adds comprehensive tests for those
structs and verifies that the constant fields are preserved and the
mutated fields have the correct value.

The check for the constant fields is added in a new TestBootImageConfig
test.

The check for the mutated fields is added into
TestSnapshotWithBootclasspathFragment_ImageName as that test checks an
art bootclasspath_fragment in the following configurations:
* source on its own
* prebuilt on its own
* source and prebuilt with source preferred
* source and prebuilt with prebuilt

It reveals a couple of interesting facts:
* All the *installs fields are set to the same value irrespective of
  whether the source or prebuilt is preferred. The information is
  constructed solely from information already within the
  bootImageConfig/Variant and so can be moved within Once.

* The licenseMetadataFile is incorrect when prebuilt is preferred.
  That is due to both the source and prebuilt modules setting it and
  the source module always wins as the source module depends on the
  prebuilt so always runs its GenerateAndroidBuildActions after it.

Those issues will be cleaned up in following changes.

Bug: 245956352
Test: m nothing
Change-Id: If917cfbcb3b1c842a8682d51cc1ee1fed1c51add
2022-10-06 11:06:51 +01:00
Paul Duffin
741355826f Add Config,RunningInsideUnitTest
Sometimes it is necessary for some functionality to be disabled while
running in unit tests, e.g. functionality that requires external
information such as error prone tools and configuration. Sometimes it
is necessary for some functionality to be enabled while running in
unit tests, e.g. functionality that makes state available for
testing but which is not necessary at runtime.

Previously, that was done by checking to see if TestProductVariables
was nil. This change adds a method to abstract that.

Bug: 245956352
Test: m nothing
Change-Id: I7845b79328e7180623161a9bf897568089da4e4f
2022-10-06 11:01:59 +01:00
Paul Duffin
de13a3a232 Add CommonOs to Config.Targets
Previously, CommonOs was not added to Config.Targets for the test which
caused AndroidMk to crash when trying to determine if a target needed
the 2ND_ prefix added to some make variables.

Bug: 245956352
Test: m nothing
Change-Id: Ia815537ee5ce8e83df9a01c57250aa888453d138
2022-10-06 10:24:47 +01:00
Paul Duffin
298b6b0c19 Merge changes I3c73920d,I03b09e51,I09069828
* changes:
  Remove deviceInstalls from bootImageVariant
  Remove profilePathOnHost from bootImageConfig
  Document bootImageConfig and bootImageVariant structs
2022-10-06 09:20:22 +00:00
Jingwen Chen
1d873331ad apex_key bp2build: disambiguate module and src deps.
(and remove unused keyName field.)

The private_key and public_key props of an apex_key can point to either
a module or a string. If it's a module, then respect it. If it's a
string, there's additional product variable lookup to find the apex_key
files in product_vars's DefaultAppCertificate parent dir.

This is similar to android_app_certificate.

Test: presubmits
Change-Id: Ib258da14cb0c2df8b5f817fcbc46afebcf225db8
2022-10-06 05:56:05 +00:00
Treehugger Robot
51ad4cbf09 Merge "Add aosp_riscv64 to build_test skipped products" 2022-10-06 05:14:08 +00:00
Usta (Tsering) Shrestha
48f0d04275 Merge "Add timing of bp2build steps" 2022-10-06 04:41:21 +00:00
Colin Cross
774a1bfd7f Add aosp_riscv64 to build_test skipped products
aosp_riscv64 isn't ready for build_test yet, it still requires
ALLOW_MISSING_DEPENDENCIES=true to build.

Bug: 250918230
Change-Id: I9151fa84bf6ad0fa67dd06d3268311ae716b5185
Test: none
2022-10-06 01:29:51 +00:00
Yu Liu
f27bb3bf19 Add libprofile-clang-extras when coverage is enabled.
Bug: 233660582
Test: Manually verified the lib and related flags are present when
coverage is enabled.

Change-Id: I7f03fbe56acd31016687751d10c73f2e92b2fa8c
2022-10-05 16:48:08 -07:00
Inseob Kim
a12594a4b6 Merge "Add overrides support for snapshots" 2022-10-05 23:43:00 +00:00
Chih-Hung Hsieh
140c40a217 Add TIDY_EXTERNAL_VENDOR
Allow external/vendor owners and toolchain developers
to run clang-tidy with external/vendor files,
by setting TIDY_EXTERNAL_VENDOR=1 or true
instead of touching .bp or .go files.

Bug: 244631413
Test: TIDY_EXTERNAL_VENDOR=1 make tidy-soong_subset
Change-Id: I0c903f32eb0e5daa0f8dfa2f6dc892b8f8c4ebcc
2022-10-05 16:10:40 -07:00
Treehugger Robot
8f9ae520e7 Merge "Allow sdk_version: "system_server_current" modules to access module-lib APIs" 2022-10-05 22:05:25 +00:00
Colin Cross
ec731a83e3 Merge "Use MinApiForArch to set minSdkVersion for apexes" 2022-10-05 22:03:22 +00:00
Usta Shrestha
a117c58308 Add timing of bp2build steps
Bug: b/239044089
Test: run build/bazel/ci/incremental_build --bazel-mode com.android.adbd and see the additional metrics in summary.csv
Change-Id: I2c3b9cead2ee43c700a9ad52e669a64aab1499ce
2022-10-05 21:35:40 +00:00
Colin Cross
a497606f1d Merge changes I154a6f3a,I79f0c20a,I605ae9af,I647c7305,I95e96e3e, ...
* changes:
  Move fuzzer's CollectAllSharedDependencies into GenerateAndroidBuildActions
  Support AllowMissingDependencies in prebuilt_apex modules
  Support AllowMissingDependencies for apex dependencies
  Add AllowMissingDependencies support for prebuilt_etc module with no src property
  Make OutputFileForModule work for AllowMissingDependencies
  Fix panics when target arch is riscv64
2022-10-05 21:25:17 +00:00
Spandan Das
e191ae76b6 Merge "Move API providing modules from bp2build to api_bp2build workspace" 2022-10-05 19:40:01 +00:00
Cole Faust
5fe655d1c7 Enable new python path behavior by default
Now that usages have been updated, enable the new
behavior by default. If everything goes well with
this, we can then remove the flags.

Bug: 245583294
Bug: 247578564
Test: Presubmits
Change-Id: Idac8d2dc0f96ae750dba4a99b32525676d0d6f25
2022-10-05 11:51:26 -07:00
Chih-hung Hsieh
1832b5ccf1 Merge "Remove flags rejected by RBE input processor" 2022-10-05 18:19:37 +00:00
Paul Duffin
d0b9fca6d2 Allow sdk_version: "system_server_current" modules to access module-lib APIs
Previously, a java module with sdk_version: "system_server_current",
would only be able to access the system server or public API of a
java_sdk_library. This change allows it to access the system server,
module lib, system and public APIs in that order.

The apiScope structs define the characteristics of each of the
different API scopes used as required by the java_sdk_library. They are
organized into a hierarchy which is used for two different purposes.

The first purpose is to define an extension hierachy. If scope X
extends Y then X provides a superset of all API elements (classes,
fields, methods, etc) provided by Y. That is reflected in the fact that
the .txt file for X would be a delta on the .txt file for Y. So, system
extends public and so system_current.txt only contains additional API
elements to add to current.txt.

The second purpose is when a java_sdk_library/import is asked to
provide a specific API scope. e.g. a library that has:
    sdk_version: "module_current"
will ask each of the SDK libraries it depends upon for a module-lib
API. However, not all of them will provide an API for that scope. In
that case it will find the closest suitable API scope.

Previously, it did that by traversing up the API extension until it
found an API scope that it did provide and return that. As
system_server_current extended the public API that meant that a library
which has:
    sdk_version: "system_server_current"
would provide a system server API if available, and if not fall
straight back to public. That meant that the library could not access
system or module-lib APIs even though it is running in the system
server which should be able to access all APIs.

One way to fix this would have been to just have system server API
scope extend module-lib but that would have had a number of nasty
side effects:
* It would have created a significant overhead as every module that
  provides a system server API would also have to provide a module-lib
  and system API, along with their corresponding .txt files.
* Each existing java_sdk_library that provided a system server API
  would need those .txt files created.
* Generating sdk snapshots for older releases would have been more
  complicated.
* It would have confused developers.

All of that would be unnecessary because the system server API scope is
intended to be provided by libraries that are used solely by the system
server so there is no point in them providing anything other than a
system server API.

So, instead a separate access hierarchy was added which is the same as
the extension hierarchy for all existing scopes except for the
system server scope, which instead of just being able to access the
public API will be able to access the module-lib scope, which can in
turn access system and it can in turn access public.

That achieves what we want which is a library that is loaded into the
system server to be able to access all API scopes.

Bug: 204176972
Test: m nothing
Change-Id: I854df63fcaeba32afbc1eb0d1a501238022673d0
2022-10-05 17:22:59 +01:00
Jihoon Kang
0b5f7f153f Merge "Specify jnilib partition in Android-<target>.mk" 2022-10-05 16:19:51 +00:00
Paul Duffin
e10a9f2e5e Remove deviceInstalls from bootImageVariant
The use of this field to return information from buildBootImageVariant
up the call stack to one of the callers resulted in data races being
detected. This change simply passes the deviceInstalls up the call
stack.

Bug: 245956352
Test: m nothing
      go test -race ./sdk/... -run TestSnapshotWithBootclasspathFragment_ImageName -test.count 100
      # Run the previous command without this change and sometimes it
      # shows the data race around deviceInstalls. When run with this
      # change it reports no data races.
Change-Id: I3c73920dcb17a6c89a63c6a9c3a0bb049a98a690
2022-10-05 12:33:02 +01:00
Paul Duffin
9f6ac0bb42 Remove profilePathOnHost from bootImageConfig
The use of this field to return information from bootImageProfileRule
up the call stack to one of the users resulted in data races being
detected. This change simply returns the profile path back up the call
stack.

Bug: 245956352
Test: m nothing
      go test -race ./sdk/... -run TestSnapshotWithBootclasspathFragment_ImageName -test.count 100
      # Run the previous command without this change and sometimes it
      # shows the data race around profilePathOnHost. With this change
      # that data race is not reported. Although there is still another
      # data race.
Change-Id: I03b09e514cc94f2a6c9d5117d3b2f130cc2e4f5b
2022-10-05 12:33:02 +01:00
Paul Duffin
a8df7e1c5b Document bootImageConfig and bootImageVariant structs
Add warnings to the structs to explain how they are supposed to be used
and deprecate fields that are used incorrectly.

Bug: 245956352
Test: m nothing
Change-Id: I090698287b96fd37102b88beb5d7252977bddc54
2022-10-05 12:32:02 +01:00
Sorin Basca
7e094b33b7 Revert^2 "Use the toolchain from JDK 17"
This reverts commit be3a561aac.

Reason for revert: Reland switch to JDK 17
Bug: 233029164
Test: TH

Change-Id: Ifa69e3fd50b853153a9c23756269ff12e72d7e9f
2022-10-05 08:23:17 +00:00