From 872e8463db9846335cc7c7a8d5ffdb463af9d73e Mon Sep 17 00:00:00 2001 From: Ivan Lozano Date: Wed, 30 Oct 2024 19:30:48 +0000 Subject: rust: Shorten name of generated Rust staticlibs Some modules may have very long module names. Combined with the intermediates produced by rustc, this may result in filepaths that are too long. We can mitigate this somewhat by changing the generated crate name for the staticlib to not be based on the parent module name. Bug: 376452102 Test: m blueprint_tests Test: m Change-Id: I2d6210d32f7f65ddfa4d1cf1be433c1610b24949 --- rust/builder.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'rust/builder.go') diff --git a/rust/builder.go b/rust/builder.go index f469f56f8..a1e17fc3f 100644 --- a/rust/builder.go +++ b/rust/builder.go @@ -170,6 +170,9 @@ func TransformSrctoRlib(ctx ModuleContext, mainSrc android.Path, deps PathDeps, return transformSrctoCrate(ctx, mainSrc, deps, flags, outputFile, getTransformProperties(ctx, "rlib")) } +// TransformRlibstoStaticlib is assumed to be called from the cc module, and +// thus needs to reconstruct the common set of flags which need to be passed +// to the rustc compiler. func TransformRlibstoStaticlib(ctx android.ModuleContext, mainSrc android.Path, deps []cc.RustRlibDep, outputFile android.WritablePath) android.Path { -- cgit v1.2.3-59-g8ed1b