From df229cb00a1b9d464ffabfc2e6385a0895dbbe47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thi=C3=A9baud=20Weksteen?= Date: Wed, 10 Feb 2021 14:07:57 +0100 Subject: [PATCH] Enable size measurement for Rust binaries Bug: 172339742 Test: m out/soong/binary_sizes.pb Change-Id: Ibc9feaa1c806b888d8850303ab7eeaf5e5337e35 --- rust/Android.bp | 1 + rust/builder.go | 3 +++ 2 files changed, 4 insertions(+) diff --git a/rust/Android.bp b/rust/Android.bp index 8b2aa30d0..a29c474b1 100644 --- a/rust/Android.bp +++ b/rust/Android.bp @@ -8,6 +8,7 @@ bootstrap_go_package { deps: [ "soong", "soong-android", + "soong-bloaty", "soong-cc", "soong-rust-config", ], diff --git a/rust/builder.go b/rust/builder.go index 56fe03118..547d70569 100644 --- a/rust/builder.go +++ b/rust/builder.go @@ -21,6 +21,7 @@ import ( "github.com/google/blueprint" "android/soong/android" + "android/soong/bloaty" "android/soong/rust/config" ) @@ -249,6 +250,8 @@ func transformSrctoCrate(ctx ModuleContext, main android.Path, deps PathDeps, fl implicits = append(implicits, clippyFile) } + bloaty.MeasureSizeForPath(ctx, outputFile) + ctx.Build(pctx, android.BuildParams{ Rule: rustc, Description: "rustc " + main.Rel(),