diff options
author | 2023-10-23 21:40:13 +0000 | |
---|---|---|
committer | 2023-10-25 17:29:46 +0000 | |
commit | c5cf99079714bd6d152d0178e4958e455476b211 (patch) | |
tree | 815c2389b8c921d80eec430d9bac3eaf00499037 /rust/builder.go | |
parent | c2d3ffcae3a91871d3e0bb5ac8b1ffbdd76cd46c (diff) |
fix some moved code from revert of aosp/2518976
aosp/2768553 reverted aosp/2518976, but there was some code that was
moved in between these two commits. This commit removes a code block
for some envvars that were moved in aosp/2638675, and adds back the code
for the ANDROID_RUST_DARWIN envvar.
Change-Id: I9ac09c608fe64340535ac493ab7f07ecb9b9c335
Diffstat (limited to 'rust/builder.go')
-rw-r--r-- | rust/builder.go | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/rust/builder.go b/rust/builder.go index fe2d03a0b..72e5be18b 100644 --- a/rust/builder.go +++ b/rust/builder.go @@ -238,6 +238,10 @@ func rustEnvVars(ctx ModuleContext, deps PathDeps) []string { } } + if ctx.Darwin() { + envVars = append(envVars, "ANDROID_RUST_DARWIN=true") + } + return envVars } @@ -346,19 +350,6 @@ func transformSrctoCrate(ctx ModuleContext, main android.Path, deps PathDeps, fl implicits = append(implicits, outputs.Paths()...) } - envVars = append(envVars, "ANDROID_RUST_VERSION="+config.GetRustVersion(ctx)) - - if ctx.RustModule().compiler.CargoEnvCompat() { - if _, ok := ctx.RustModule().compiler.(*binaryDecorator); ok { - envVars = append(envVars, "CARGO_BIN_NAME="+strings.TrimSuffix(outputFile.Base(), outputFile.Ext())) - } - envVars = append(envVars, "CARGO_CRATE_NAME="+ctx.RustModule().CrateName()) - pkgVersion := ctx.RustModule().compiler.CargoPkgVersion() - if pkgVersion != "" { - envVars = append(envVars, "CARGO_PKG_VERSION="+pkgVersion) - } - } - if flags.Clippy { clippyFile := android.PathForModuleOut(ctx, outputFile.Base()+".clippy") ctx.Build(pctx, android.BuildParams{ |