Commit Graph

27773 Commits

Author SHA1 Message Date
Treehugger Robot
748ecd135f Merge "Pass Config to NewTestContext instead of ctx.Register" am: ceed6be00d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1480601

Change-Id: Idc791387f2ced40abe768395717fee33e3650e4f
2020-11-14 06:12:21 +00:00
Treehugger Robot
ceed6be00d Merge "Pass Config to NewTestContext instead of ctx.Register" 2020-11-14 05:58:58 +00:00
Patrice Arruda
62c4767433 Remove unnecessary break and default statements in metrics.go file. am: 33e7f6a0ca
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1498207

Change-Id: Ia0b372fc8173b137061773e12e85b121d0187344
2020-11-14 01:43:39 +00:00
Patrice Arruda
047210ca6c Add tracer to runBazel function. am: b7cf9ba175
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1498206

Change-Id: Ib944e3e27b24e759286a145f6dbf52b0e14783af
2020-11-14 01:43:37 +00:00
Patrice Arruda
9bfa4625c2 Enable bazel metrics from ninja build. am: 18cb70d645
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1498204

Change-Id: Ied5eff56e861052efcabef1732affec0a69968c7
2020-11-14 01:43:34 +00:00
Patrice Arruda
713775b1c0 Define the bazel_metrics directory in $OUT. am: af880da0c4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1498164

Change-Id: Iad8a5a3ab9e16e5f97dc01e2ee34422ed892bbf4
2020-11-14 01:43:31 +00:00
Patrice Arruda
a5e6074855 Add bazel profile related functions in paths.go am: 24a086b3dc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1498163

Change-Id: I568e1fe40c12a5f63ccb3fcb793f3b10d7bdfde1
2020-11-14 01:43:28 +00:00
Patrice Arruda
5439d1cf68 Define UseBazel in Config am: 0c1c456643
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1496658

Change-Id: I713abab31350b3f81a5787bc875fd7943f8e1510
2020-11-14 01:42:54 +00:00
Patrice Arruda
33e7f6a0ca Remove unnecessary break and default statements in metrics.go file.
break and default statements are not needed inside of a switch
statement.

Bug: b/173028918
Test: USE_BAZEL m nothing
Change-Id: I14aa8cbae3a9b3c859f147c5134600f1e75c6a89
2020-11-13 13:15:09 -08:00
Patrice Arruda
b7cf9ba175 Add tracer to runBazel function.
Added a tracer named "bazel" in runBazel function to capture topline
metrics when running bazel.

Bug: b/173028918
Test: * USE_BAZEL=1 m nothing and checked soong_metrics file using
        printproto command to verify that bazel topline metrics
	were captured.
Change-Id: I5cb0728a4da48545dc701cc79627c318d5d9a29d
2020-11-13 13:14:51 -08:00
Patrice Arruda
18cb70d645 Enable bazel metrics from ninja build.
Generate the bazel profile file that contains the metrics of
executing the ninja build phase of Soong.

Bug: b/173028918
Test: * m nothing and check out dir that there is no bazel_metrics dir.
      * USE_BAZEL=1 m nothing and checked
        out/bazel_metrics/build_bazel_profile.gz existed.
      * m nothing and checked out/bazel_metrics does not exist.
Change-Id: I797d1eecf5c2c260ade8b55dc69c237bfd0fcbd4
2020-11-13 11:37:06 -08:00
Patrice Arruda
af880da0c4 Define the bazel_metrics directory in $OUT.
$OUT/bazel_metrics directory is created in order to dump the
set of bazel profile files being created from a single build
execution. The directory is created from soong_ui.

Bug: b/173028918
Test: * m nothing and check out dir that there is no bazel_metrics dir.
      * USE_BAZEL=1 and checked out/bazel_metrics was created.
      * Ran m nothing and verified that out/bazel_metrics directory is
        deleted to ensure no metrics is uploaded or collected from the
	pipeline.

Change-Id: I1d3c2471065fae6931f35cef7f0f35fd84f76bef
2020-11-13 11:16:21 -08:00
Patrice Arruda
24a086b3dc Add bazel profile related functions in paths.go
Bazel executions occurs in soong_ui and soong_cmd. To collection all
bazel metrics, several path functions are defined to return the path
to store a bazel profile gzipped file.

Bug: b/173028918
Test: m nothing
Change-Id: I78926c66f853233b3977aca22e8a3fcf28edda53
2020-11-13 11:16:21 -08:00
Patrice Arruda
0c1c456643 Define UseBazel in Config
The UseBazel() function will be used in several places to perform
different functionality such as setting up the metrics path.

Bug: b/173028918
Test: m nothing
Change-Id: Ie94073b8f0552ec7528e1cc2f3be74b693dc3135
2020-11-13 11:16:21 -08:00
Christopher Parsons
74de7a4d5b Merge "Stop first pass of mixed bazel builds before writing ninja" am: 9414a8be12
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1493282

Change-Id: Iea811eb57f9c751dd54ea3f48be6b05c322b5d42
2020-11-13 18:35:32 +00:00
Christopher Parsons
9414a8be12 Merge "Stop first pass of mixed bazel builds before writing ninja" 2020-11-13 18:18:07 +00:00
Martin Stjernholm
5c42f525c4 Set up BuildNumberFile in soong.variables. am: c488743e14
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1488760

Change-Id: Ia71620135db89f2014800dc5a2f542f8a5aef630
2020-11-13 16:01:54 +00:00
Martin Stjernholm
c488743e14 Set up BuildNumberFile in soong.variables.
Necessary for some build steps. aapt2 is one example, although it still
has problems because part of its build logic is in make.

This isn't strictly required for any supported build target at the
moment, but the error when it fails can be confusing so let's add it
anyway.

Test: build/soong/scripts/build-aml-prebuilts.sh art-module-sdk \
  art-module-test-exports conscrypt-module-sdk \
  conscrypt-module-test-exports conscrypt-module-host-exports \
  runtime-module-sdk runtime-module-host-exports \
  i18n-module-test-exports i18n-module-sdk platform-mainline-sdk \
  platform-mainline-test-exports
Bug: 172548608
Change-Id: I88526a85f288287c3a138f8cbb6fd04ad28c3795
2020-11-13 15:40:17 +00:00
Chris Parsons
3060ec7731 Stop first pass of mixed bazel builds before writing ninja
This shaves off ~20s, which is ~11%, of `m nothing` with mixed builds.

Test: Manual verification with mixed builds of aosp_flame.
Change-Id: Ief1bc56c92329e899c829fc1374eea9ee9b94fb7
2020-11-12 22:30:46 +00:00
Colin Cross
ae8600b507 Pass Config to NewTestContext instead of ctx.Register
Prepare for using Config when adding singletons by passing
Config to NewTestContext and NewContext instead of to ctx.Register.
This will enable a followup change to store SingletonMakeVarsProviders
registered on the Context in the Config, which is necessary to run
multiple tests in parallel without data races.

Test: all soong tests
Change-Id: Id229629a4e42ff4487d317241673837726c075fc
2020-11-12 10:07:49 -08:00
Ivan Lozano
b722c7eb8c Merge "rust: Fix absolute path OUT_DIR bug" am: 45e0c95f85
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1496656

Change-Id: Ib59430b33818e97b634026f0ec15cc96b61a3348
2020-11-12 16:16:15 +00:00
Ivan Lozano
45e0c95f85 Merge "rust: Fix absolute path OUT_DIR bug" 2020-11-12 15:23:39 +00:00
Jingwen Chen
f9599567db Merge "Export Ninja file paths to lunch repo rule from bazel.go" am: 44db598b3e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1493287

Change-Id: I136748a0e71939379f93c294bce7144adb4a7799
2020-11-12 09:05:13 +00:00
Anton Hansson
afe209bdad Merge "Make apex modules support tagged dists" am: fabdd28fdb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1496336

Change-Id: Icc629fc71d06bec56e7eb04e14aa369741239e2f
2020-11-12 09:01:20 +00:00
Jingwen Chen
44db598b3e Merge "Export Ninja file paths to lunch repo rule from bazel.go" 2020-11-12 08:32:50 +00:00
Anton Hansson
fabdd28fdb Merge "Make apex modules support tagged dists" 2020-11-12 08:30:55 +00:00
Jingwen Chen
a26ac3caee Export Ninja file paths to lunch repo rule from bazel.go
This ensures that the lunch repo rule always reads the right Ninja file.

Test: USE_BAZEL=1 m
Test: m

Change-Id: I7f670dd538f46c4dae5ea537b857ff04520b60e7
2020-11-12 08:01:33 +00:00
Zach Johnson
1ec2ec156f Merge "rust_grpcio well known types support, default deps" am: c0ea1701cb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1490423

Change-Id: I0a26238b9edea981c7076df2958ff20422d3d091
2020-11-12 00:04:55 +00:00
Zach Johnson
c0ea1701cb Merge "rust_grpcio well known types support, default deps" 2020-11-11 23:22:27 +00:00
Rupert Shuttleworth
d8b257c7a1 Merge "Perform Bazel cleanup using "--batch --max_idle_secs=1" instead of a trap." am: eb165fd950
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1493518

Change-Id: I1f7a496e0a2132198da7c965546f48f61e52aabd
2020-11-11 21:30:36 +00:00
Rupert Shuttleworth
eb165fd950 Merge "Perform Bazel cleanup using "--batch --max_idle_secs=1" instead of a trap." 2020-11-11 20:56:10 +00:00
Zach Johnson
3df4e6364b rust_grpcio well known types support, default deps
The usage of the well known type Empty requires a hack in the module
above the grpc implementation, this is now the generated stem_mod.rs

This also adds additional implicit dependencies that are required by
the grpc protobuf generated code. This includes the addition of a
'header_libs' property for library dependencies which export include
paths required by protos.

We also now include both the protos and the grpcio in the library
variant via the mod_stem.rs.

Bug: 172592789
Bug: 171504899
Test: m nothing
Test: Example rust_grpcio module build command includes dependencies,
      include paths.
Change-Id: I187a13cd5cdea991828a1020314de16727e4f74e
2020-11-11 12:09:26 -08:00
Ivan Lozano
1776a2ac6f rust: Fix absolute path OUT_DIR bug
The OUT_DIR for rustc is incorrectly calculated when Soong's OUT_DIR
is set to an absolute path through OUT_DIR_COMMON_BASE. This breaks
compilation when rustc is unable to find files that have beein included
through the include! macro.

Bug: 172952634
Test: OUT_DIR_COMMON_BASE=/some/abs/path m
Change-Id: Id447630a7774c1dec655f65dd227c144a159e1b1
2020-11-11 11:25:48 -05:00
Paul Duffin
aa50b67217 Merge "Switch boot jars package check to using dex jars" am: 68ecbaf614
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1479315

Change-Id: I625ce32e7d0fcdcdeeb70a1960d9aa19c955a17b
2020-11-11 13:08:58 +00:00
Paul Duffin
68ecbaf614 Merge "Switch boot jars package check to using dex jars" 2020-11-11 12:53:23 +00:00
Anton Hansson
82d502a7b2 Make apex modules support tagged dists
Bug: 172951145
Test: m dist my_dist_target (with patch in bug)
Change-Id: I0da4568a49ea48efbf864614a7e7c647f251a7ce
2020-11-11 12:34:20 +00:00
Mathew Inwood
1917bee275 Merge "Temporarily move APIs to blocked list." am: 82d5b6726b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1494179

Change-Id: Ic84c50eb4cbf2be78dc2ffeee3125779e10d5c7e
2020-11-11 09:32:43 +00:00
Mathew Inwood
82d5b6726b Merge "Temporarily move APIs to blocked list." 2020-11-11 09:13:48 +00:00
Paul Duffin
14301ccfd1 Merge "Remove support for droidstubs in sdk/module_exports" am: 99a7622885
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1492857

Change-Id: I6d37857cc9cdcec8249b7ccd4917936a77efa850
2020-11-10 18:42:41 +00:00
Paul Duffin
2d8e1a7e59 Switch boot jars package check to using dex jars
The switch to use dex jars instead of class jars means that a boot jar
that is defined by a dex_import module will now be checked against the
package_allowed_list.txt so it is possible that it will detect
previously unreported problems.

Test: m check-boot-jars - for failing and passing cases
Bug: 171479578
Bug: 125517186
Change-Id: Ie614898dade0fb43c9418d7afb9138169db6f097
2020-11-10 17:37:43 +00:00
Paul Duffin
99a7622885 Merge "Remove support for droidstubs in sdk/module_exports" 2020-11-10 17:34:00 +00:00
Anton Hansson
00d7ec3375 Merge "Remove dead code" am: a1b3314286
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1488756

Change-Id: I4a6eed71a609eef6f01a39b3487270833af31615
2020-11-10 14:49:21 +00:00
Anton Hansson
a1b3314286 Merge "Remove dead code" 2020-11-10 14:35:13 +00:00
Paul Duffin
0b578e9241 Merge "Use glob for java_sdk_library_import stub_srcs" am: 37fa489a9e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1492856

Change-Id: Ie98d496daed02eecf6d17d9c27da4951bdeebe0b
2020-11-10 14:02:35 +00:00
Treehugger Robot
dcb4b40201 Merge "Rust bindgen should use r399163b." am: 13c1df6a2f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1493281

Change-Id: Ic52596d266cc33ce414ea2937c4bb0b82433047f
2020-11-10 14:01:49 +00:00
Paul Duffin
a3cb6cf2e5 Remove support for droidstubs in sdk/module_exports
The droidstubs support in sdk/module_exports was a temporary measure
to work around the fact that some APIs were being defined by direct use
of droidstubs instead of java_sdk_library.

This change removes that support as those APIs have all been switched
from droidstubs to use java_sdk_library so droidstubs support is no
longer needed.

Bug: 168301990
Test: m nothing
Change-Id: I3517bed29b030438a0423a6cb8c248992a988222
2020-11-10 13:55:17 +00:00
Paul Duffin
37fa489a9e Merge "Use glob for java_sdk_library_import stub_srcs" 2020-11-10 13:54:23 +00:00
Treehugger Robot
13c1df6a2f Merge "Rust bindgen should use r399163b." 2020-11-10 13:42:40 +00:00
Mathew Inwood
59093e3769 Temporarily move APIs to blocked list.
Bug: 170729553
Test: m

Change-Id: I62db78941785fd1bd336cfe81c8e9763e08a0eb0
2020-11-10 13:08:58 +00:00
Treehugger Robot
0c7f3f741f Merge "Allow extra startup and build args to be passed to Bazel." am: ccd3f1d66f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1493517

Change-Id: I2c79e37b6e7a63468e318652a8737d791e0adf6d
2020-11-10 08:04:12 +00:00