Revert "Split Rust crate builds into compile and link phases."

This reverts commit e7c71c344d.
The intermediates created by the separated rust compile steps are very
large, on the order of 60GB.  This is more than CI can support for now,
revert the split into compile and link phases.  This comes at the expense
of incremental build time, especially when modifying C/C++ sources that
are dependencies of rust modules.

Bug: 293349612
Test: builds
Change-Id: I81169e7d0727330c8de5e7688dcdc87fe7b8d3b5
This commit is contained in:
Colin Cross
2023-10-02 11:39:17 -07:00
parent 0af40657ff
commit 004bd3f526
15 changed files with 111 additions and 232 deletions

View File

@@ -256,7 +256,6 @@ func TestDepsTracking(t *testing.T) {
`)
module := ctx.ModuleForTests("fizz-buzz", "linux_glibc_x86_64").Module().(*Module)
rustc := ctx.ModuleForTests("librlib", "linux_glibc_x86_64_rlib_rlib-std").Rule("rustc")
rustLink := ctx.ModuleForTests("fizz-buzz", "linux_glibc_x86_64").Rule("rustLink")
// Since dependencies are added to AndroidMk* properties, we can check these to see if they've been picked up.
if !android.InList("librlib.rlib-std", module.Properties.AndroidMkRlibs) {
@@ -279,16 +278,16 @@ func TestDepsTracking(t *testing.T) {
t.Errorf("-lstatic flag not being passed to rustc for static library %#v", rustc.Args["rustcFlags"])
}
if !strings.Contains(rustLink.Args["linkFlags"], "cc_stubs_dep.so") {
t.Errorf("shared cc_library not being passed to rustc linkFlags %#v", rustLink.Args["linkFlags"])
if !strings.Contains(rustc.Args["linkFlags"], "cc_stubs_dep.so") {
t.Errorf("shared cc_library not being passed to rustc linkFlags %#v", rustc.Args["linkFlags"])
}
if !android.SuffixInList(rustLink.OrderOnly.Strings(), "cc_stubs_dep.so") {
t.Errorf("shared cc dep not being passed as order-only to rustc %#v", rustLink.OrderOnly.Strings())
if !android.SuffixInList(rustc.OrderOnly.Strings(), "cc_stubs_dep.so") {
t.Errorf("shared cc dep not being passed as order-only to rustc %#v", rustc.OrderOnly.Strings())
}
if !android.SuffixInList(rustLink.Implicits.Strings(), "cc_stubs_dep.so.toc") {
t.Errorf("shared cc dep TOC not being passed as implicit to rustc %#v", rustLink.Implicits.Strings())
if !android.SuffixInList(rustc.Implicits.Strings(), "cc_stubs_dep.so.toc") {
t.Errorf("shared cc dep TOC not being passed as implicit to rustc %#v", rustc.Implicits.Strings())
}
}