2019-08-28 03:03:00 +08:00
|
|
|
// Copyright 2019 The Android Open Source Project
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
|
|
|
package rust
|
|
|
|
|
|
|
|
import (
|
2020-11-11 23:59:52 +08:00
|
|
|
"path/filepath"
|
2019-08-28 03:03:00 +08:00
|
|
|
"strings"
|
|
|
|
|
|
|
|
"github.com/google/blueprint"
|
|
|
|
|
|
|
|
"android/soong/android"
|
2020-11-03 22:17:51 +08:00
|
|
|
"android/soong/rust/config"
|
2019-08-28 03:03:00 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
_ = pctx.SourcePathVariable("rustcCmd", "${config.RustBin}/rustc")
|
|
|
|
rustc = pctx.AndroidStaticRule("rustc",
|
|
|
|
blueprint.RuleParams{
|
2020-07-10 09:03:28 +08:00
|
|
|
Command: "$envVars $rustcCmd " +
|
2019-08-28 03:03:00 +08:00
|
|
|
"-C linker=${config.RustLinker} " +
|
2019-09-21 02:00:37 +08:00
|
|
|
"-C link-args=\"${crtBegin} ${config.RustLinkerArgs} ${linkFlags} ${crtEnd}\" " +
|
2020-08-14 06:46:21 +08:00
|
|
|
"--emit link -o $out --emit dep-info=$out.d.raw $in ${libFlags} $rustcFlags" +
|
|
|
|
" && grep \"^$out:\" $out.d.raw > $out.d",
|
2019-08-28 03:03:00 +08:00
|
|
|
CommandDeps: []string{"$rustcCmd"},
|
2019-11-06 04:16:46 +08:00
|
|
|
// Rustc deps-info writes out make compatible dep files: https://github.com/rust-lang/rust/issues/7633
|
2020-08-14 06:46:21 +08:00
|
|
|
// Rustc emits unneeded dependency lines for the .d and input .rs files.
|
|
|
|
// Those extra lines cause ninja warning:
|
|
|
|
// "warning: depfile has multiple output paths"
|
|
|
|
// For ninja, we keep/grep only the dependency rule for the rust $out file.
|
2019-11-06 04:16:46 +08:00
|
|
|
Deps: blueprint.DepsGCC,
|
|
|
|
Depfile: "$out.d",
|
2019-08-28 03:03:00 +08:00
|
|
|
},
|
2020-07-10 09:03:28 +08:00
|
|
|
"rustcFlags", "linkFlags", "libFlags", "crtBegin", "crtEnd", "envVars")
|
2020-04-09 21:56:02 +08:00
|
|
|
|
2021-03-20 06:06:02 +08:00
|
|
|
_ = pctx.SourcePathVariable("rustdocCmd", "${config.RustBin}/rustdoc")
|
|
|
|
rustdoc = pctx.AndroidStaticRule("rustdoc",
|
|
|
|
blueprint.RuleParams{
|
2021-04-28 08:12:02 +08:00
|
|
|
Command: "$envVars $rustdocCmd $rustdocFlags $in -o $outDir && " +
|
2021-03-20 06:06:02 +08:00
|
|
|
"touch $out",
|
|
|
|
CommandDeps: []string{"$rustdocCmd"},
|
|
|
|
},
|
|
|
|
"rustdocFlags", "outDir", "envVars")
|
|
|
|
|
2020-06-22 19:28:02 +08:00
|
|
|
_ = pctx.SourcePathVariable("clippyCmd", "${config.RustBin}/clippy-driver")
|
|
|
|
clippyDriver = pctx.AndroidStaticRule("clippy",
|
|
|
|
blueprint.RuleParams{
|
2020-07-22 01:28:27 +08:00
|
|
|
Command: "$envVars $clippyCmd " +
|
2020-06-22 19:28:02 +08:00
|
|
|
// Because clippy-driver uses rustc as backend, we need to have some output even during the linting.
|
|
|
|
// Use the metadata output as it has the smallest footprint.
|
2021-04-07 22:00:19 +08:00
|
|
|
"--emit metadata -o $out --emit dep-info=$out.d.raw $in ${libFlags} " +
|
|
|
|
"$rustcFlags $clippyFlags" +
|
|
|
|
" && grep \"^$out:\" $out.d.raw > $out.d",
|
2020-06-22 19:28:02 +08:00
|
|
|
CommandDeps: []string{"$clippyCmd"},
|
2021-04-07 22:00:19 +08:00
|
|
|
Deps: blueprint.DepsGCC,
|
|
|
|
Depfile: "$out.d",
|
2020-06-22 19:28:02 +08:00
|
|
|
},
|
2020-07-22 01:28:27 +08:00
|
|
|
"rustcFlags", "libFlags", "clippyFlags", "envVars")
|
2020-06-22 19:28:02 +08:00
|
|
|
|
2020-04-09 21:56:02 +08:00
|
|
|
zip = pctx.AndroidStaticRule("zip",
|
|
|
|
blueprint.RuleParams{
|
|
|
|
Command: "cat $out.rsp | tr ' ' '\\n' | tr -d \\' | sort -u > ${out}.tmp && ${SoongZipCmd} -o ${out} -C $$OUT_DIR -l ${out}.tmp",
|
|
|
|
CommandDeps: []string{"${SoongZipCmd}"},
|
|
|
|
Rspfile: "$out.rsp",
|
|
|
|
RspfileContent: "$in",
|
|
|
|
})
|
2020-07-10 09:03:28 +08:00
|
|
|
|
|
|
|
cp = pctx.AndroidStaticRule("cp",
|
|
|
|
blueprint.RuleParams{
|
|
|
|
Command: "cp `cat $outDir.rsp` $outDir",
|
|
|
|
Rspfile: "${outDir}.rsp",
|
|
|
|
RspfileContent: "$in",
|
|
|
|
},
|
|
|
|
"outDir")
|
2019-08-28 03:03:00 +08:00
|
|
|
)
|
|
|
|
|
2020-04-09 21:56:02 +08:00
|
|
|
type buildOutput struct {
|
2021-01-15 08:03:18 +08:00
|
|
|
outputFile android.Path
|
2020-04-09 21:56:02 +08:00
|
|
|
}
|
2019-08-28 03:03:00 +08:00
|
|
|
|
2020-04-09 21:56:02 +08:00
|
|
|
func init() {
|
|
|
|
pctx.HostBinToolVariable("SoongZipCmd", "soong_zip")
|
2019-08-28 03:03:00 +08:00
|
|
|
}
|
|
|
|
|
2020-06-24 17:32:48 +08:00
|
|
|
func TransformSrcToBinary(ctx ModuleContext, mainSrc android.Path, deps PathDeps, flags Flags,
|
2021-03-20 06:06:02 +08:00
|
|
|
outputFile android.WritablePath) buildOutput {
|
2020-02-11 21:24:25 +08:00
|
|
|
flags.GlobalRustFlags = append(flags.GlobalRustFlags, "-C lto")
|
2019-11-21 02:14:33 +08:00
|
|
|
|
2021-03-20 06:06:02 +08:00
|
|
|
return transformSrctoCrate(ctx, mainSrc, deps, flags, outputFile, "bin")
|
2019-08-28 03:03:00 +08:00
|
|
|
}
|
|
|
|
|
2020-06-24 17:32:48 +08:00
|
|
|
func TransformSrctoRlib(ctx ModuleContext, mainSrc android.Path, deps PathDeps, flags Flags,
|
2021-03-20 06:06:02 +08:00
|
|
|
outputFile android.WritablePath) buildOutput {
|
|
|
|
return transformSrctoCrate(ctx, mainSrc, deps, flags, outputFile, "rlib")
|
2019-08-28 03:03:00 +08:00
|
|
|
}
|
|
|
|
|
2020-06-24 17:32:48 +08:00
|
|
|
func TransformSrctoDylib(ctx ModuleContext, mainSrc android.Path, deps PathDeps, flags Flags,
|
2021-03-20 06:06:02 +08:00
|
|
|
outputFile android.WritablePath) buildOutput {
|
|
|
|
return transformSrctoCrate(ctx, mainSrc, deps, flags, outputFile, "dylib")
|
2019-08-28 03:03:00 +08:00
|
|
|
}
|
|
|
|
|
2020-06-24 17:32:48 +08:00
|
|
|
func TransformSrctoStatic(ctx ModuleContext, mainSrc android.Path, deps PathDeps, flags Flags,
|
2021-03-20 06:06:02 +08:00
|
|
|
outputFile android.WritablePath) buildOutput {
|
2020-02-11 21:24:25 +08:00
|
|
|
flags.GlobalRustFlags = append(flags.GlobalRustFlags, "-C lto")
|
2021-03-20 06:06:02 +08:00
|
|
|
return transformSrctoCrate(ctx, mainSrc, deps, flags, outputFile, "staticlib")
|
2019-10-19 05:49:46 +08:00
|
|
|
}
|
|
|
|
|
2020-06-24 17:32:48 +08:00
|
|
|
func TransformSrctoShared(ctx ModuleContext, mainSrc android.Path, deps PathDeps, flags Flags,
|
2021-03-20 06:06:02 +08:00
|
|
|
outputFile android.WritablePath) buildOutput {
|
2020-02-11 21:24:25 +08:00
|
|
|
flags.GlobalRustFlags = append(flags.GlobalRustFlags, "-C lto")
|
2021-03-20 06:06:02 +08:00
|
|
|
return transformSrctoCrate(ctx, mainSrc, deps, flags, outputFile, "cdylib")
|
2019-10-19 05:49:46 +08:00
|
|
|
}
|
|
|
|
|
2020-06-24 17:32:48 +08:00
|
|
|
func TransformSrctoProcMacro(ctx ModuleContext, mainSrc android.Path, deps PathDeps,
|
2021-03-20 06:06:02 +08:00
|
|
|
flags Flags, outputFile android.WritablePath) buildOutput {
|
|
|
|
return transformSrctoCrate(ctx, mainSrc, deps, flags, outputFile, "proc-macro")
|
2019-08-28 03:03:00 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func rustLibsToPaths(libs RustLibraries) android.Paths {
|
|
|
|
var paths android.Paths
|
|
|
|
for _, lib := range libs {
|
|
|
|
paths = append(paths, lib.Path)
|
|
|
|
}
|
|
|
|
return paths
|
|
|
|
}
|
|
|
|
|
2021-03-20 06:06:02 +08:00
|
|
|
func makeLibFlags(deps PathDeps) []string {
|
|
|
|
var libFlags []string
|
|
|
|
|
|
|
|
// Collect library/crate flags
|
|
|
|
for _, lib := range deps.RLibs {
|
|
|
|
libFlags = append(libFlags, "--extern "+lib.CrateName+"="+lib.Path.String())
|
|
|
|
}
|
|
|
|
for _, lib := range deps.DyLibs {
|
|
|
|
libFlags = append(libFlags, "--extern "+lib.CrateName+"="+lib.Path.String())
|
|
|
|
}
|
|
|
|
for _, proc_macro := range deps.ProcMacros {
|
|
|
|
libFlags = append(libFlags, "--extern "+proc_macro.CrateName+"="+proc_macro.Path.String())
|
|
|
|
}
|
|
|
|
|
|
|
|
for _, path := range deps.linkDirs {
|
|
|
|
libFlags = append(libFlags, "-L "+path)
|
|
|
|
}
|
|
|
|
|
|
|
|
return libFlags
|
|
|
|
}
|
|
|
|
|
|
|
|
func rustEnvVars(ctx ModuleContext, deps PathDeps) []string {
|
|
|
|
var envVars []string
|
|
|
|
|
|
|
|
// libstd requires a specific environment variable to be set. This is
|
|
|
|
// not officially documented and may be removed in the future. See
|
|
|
|
// https://github.com/rust-lang/rust/blob/master/library/std/src/env.rs#L866.
|
|
|
|
if ctx.RustModule().CrateName() == "std" {
|
|
|
|
envVars = append(envVars, "STD_ENV_ARCH="+config.StdEnvArch[ctx.RustModule().Arch().ArchType])
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(deps.SrcDeps) > 0 {
|
|
|
|
moduleGenDir := ctx.RustModule().compiler.CargoOutDir()
|
|
|
|
// We must calculate an absolute path for OUT_DIR since Rust's include! macro (which normally consumes this)
|
|
|
|
// assumes that paths are relative to the source file.
|
|
|
|
var outDirPrefix string
|
|
|
|
if !filepath.IsAbs(moduleGenDir.String()) {
|
|
|
|
// If OUT_DIR is not absolute, we use $$PWD to generate an absolute path (os.Getwd() returns '/')
|
|
|
|
outDirPrefix = "$$PWD/"
|
|
|
|
} else {
|
|
|
|
// If OUT_DIR is absolute, then moduleGenDir will be an absolute path, so we don't need to set this to anything.
|
|
|
|
outDirPrefix = ""
|
|
|
|
}
|
|
|
|
envVars = append(envVars, "OUT_DIR="+filepath.Join(outDirPrefix, moduleGenDir.String()))
|
|
|
|
}
|
|
|
|
|
|
|
|
return envVars
|
|
|
|
}
|
|
|
|
|
2020-06-24 17:32:48 +08:00
|
|
|
func transformSrctoCrate(ctx ModuleContext, main android.Path, deps PathDeps, flags Flags,
|
2021-03-20 06:06:02 +08:00
|
|
|
outputFile android.WritablePath, crate_type string) buildOutput {
|
2019-08-28 03:03:00 +08:00
|
|
|
|
|
|
|
var inputs android.Paths
|
2019-11-06 04:16:46 +08:00
|
|
|
var implicits android.Paths
|
2020-04-09 21:56:02 +08:00
|
|
|
var output buildOutput
|
2021-03-20 06:06:02 +08:00
|
|
|
var rustcFlags, linkFlags []string
|
2020-04-09 21:56:02 +08:00
|
|
|
var implicitOutputs android.WritablePaths
|
|
|
|
|
|
|
|
output.outputFile = outputFile
|
2020-12-22 01:11:10 +08:00
|
|
|
crateName := ctx.RustModule().CrateName()
|
2020-06-24 17:32:48 +08:00
|
|
|
targetTriple := ctx.toolchain().RustTriple()
|
2019-08-28 03:03:00 +08:00
|
|
|
|
2021-03-20 06:06:02 +08:00
|
|
|
envVars := rustEnvVars(ctx, deps)
|
2020-11-03 22:17:51 +08:00
|
|
|
|
2019-08-28 03:03:00 +08:00
|
|
|
inputs = append(inputs, main)
|
|
|
|
|
|
|
|
// Collect rustc flags
|
2019-09-21 02:00:37 +08:00
|
|
|
rustcFlags = append(rustcFlags, flags.GlobalRustFlags...)
|
2019-08-28 03:03:00 +08:00
|
|
|
rustcFlags = append(rustcFlags, flags.RustFlags...)
|
|
|
|
rustcFlags = append(rustcFlags, "--crate-type="+crate_type)
|
2020-12-22 01:11:10 +08:00
|
|
|
if crateName != "" {
|
|
|
|
rustcFlags = append(rustcFlags, "--crate-name="+crateName)
|
2019-11-01 10:38:29 +08:00
|
|
|
}
|
2019-08-28 03:03:00 +08:00
|
|
|
if targetTriple != "" {
|
|
|
|
rustcFlags = append(rustcFlags, "--target="+targetTriple)
|
2019-09-21 02:00:37 +08:00
|
|
|
linkFlags = append(linkFlags, "-target "+targetTriple)
|
2019-08-28 03:03:00 +08:00
|
|
|
}
|
2020-06-26 00:34:12 +08:00
|
|
|
|
|
|
|
// Suppress an implicit sysroot
|
|
|
|
rustcFlags = append(rustcFlags, "--sysroot=/dev/null")
|
|
|
|
|
2019-09-21 02:00:37 +08:00
|
|
|
// Collect linker flags
|
|
|
|
linkFlags = append(linkFlags, flags.GlobalLinkFlags...)
|
|
|
|
linkFlags = append(linkFlags, flags.LinkFlags...)
|
2019-08-28 03:03:00 +08:00
|
|
|
|
2021-03-20 06:06:02 +08:00
|
|
|
libFlags := makeLibFlags(deps)
|
2019-08-28 03:03:00 +08:00
|
|
|
|
|
|
|
// Collect dependencies
|
2019-11-06 04:16:46 +08:00
|
|
|
implicits = append(implicits, rustLibsToPaths(deps.RLibs)...)
|
|
|
|
implicits = append(implicits, rustLibsToPaths(deps.DyLibs)...)
|
|
|
|
implicits = append(implicits, rustLibsToPaths(deps.ProcMacros)...)
|
|
|
|
implicits = append(implicits, deps.StaticLibs...)
|
2021-01-22 04:23:29 +08:00
|
|
|
implicits = append(implicits, deps.SharedLibDeps...)
|
2020-12-01 22:25:22 +08:00
|
|
|
implicits = append(implicits, deps.srcProviderFiles...)
|
2020-07-10 09:03:28 +08:00
|
|
|
|
2019-11-06 04:16:46 +08:00
|
|
|
if deps.CrtBegin.Valid() {
|
|
|
|
implicits = append(implicits, deps.CrtBegin.Path(), deps.CrtEnd.Path())
|
2019-09-21 02:00:37 +08:00
|
|
|
}
|
2019-08-28 03:03:00 +08:00
|
|
|
|
2020-07-10 09:03:28 +08:00
|
|
|
if len(deps.SrcDeps) > 0 {
|
2021-02-25 23:30:57 +08:00
|
|
|
moduleGenDir := ctx.RustModule().compiler.CargoOutDir()
|
2020-07-10 09:03:28 +08:00
|
|
|
var outputs android.WritablePaths
|
|
|
|
|
|
|
|
for _, genSrc := range deps.SrcDeps {
|
2020-07-22 21:14:47 +08:00
|
|
|
if android.SuffixInList(outputs.Strings(), genSubDir+genSrc.Base()) {
|
2020-07-10 09:03:28 +08:00
|
|
|
ctx.PropertyErrorf("srcs",
|
|
|
|
"multiple source providers generate the same filename output: "+genSrc.Base())
|
|
|
|
}
|
2020-07-22 21:14:47 +08:00
|
|
|
outputs = append(outputs, android.PathForModuleOut(ctx, genSubDir+genSrc.Base()))
|
2020-07-10 09:03:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
ctx.Build(pctx, android.BuildParams{
|
|
|
|
Rule: cp,
|
2021-02-25 23:30:57 +08:00
|
|
|
Description: "cp " + moduleGenDir.Path().Rel(),
|
2020-07-10 09:03:28 +08:00
|
|
|
Outputs: outputs,
|
|
|
|
Inputs: deps.SrcDeps,
|
|
|
|
Args: map[string]string{
|
|
|
|
"outDir": moduleGenDir.String(),
|
|
|
|
},
|
|
|
|
})
|
|
|
|
implicits = append(implicits, outputs.Paths()...)
|
|
|
|
}
|
|
|
|
|
2021-02-22 17:52:22 +08:00
|
|
|
envVars = append(envVars, "ANDROID_RUST_VERSION="+config.RustDefaultVersion)
|
|
|
|
|
2020-07-22 01:28:27 +08:00
|
|
|
if flags.Clippy {
|
|
|
|
clippyFile := android.PathForModuleOut(ctx, outputFile.Base()+".clippy")
|
|
|
|
ctx.Build(pctx, android.BuildParams{
|
|
|
|
Rule: clippyDriver,
|
|
|
|
Description: "clippy " + main.Rel(),
|
|
|
|
Output: clippyFile,
|
|
|
|
ImplicitOutputs: nil,
|
|
|
|
Inputs: inputs,
|
|
|
|
Implicits: implicits,
|
|
|
|
Args: map[string]string{
|
|
|
|
"rustcFlags": strings.Join(rustcFlags, " "),
|
|
|
|
"libFlags": strings.Join(libFlags, " "),
|
|
|
|
"clippyFlags": strings.Join(flags.ClippyFlags, " "),
|
|
|
|
"envVars": strings.Join(envVars, " "),
|
|
|
|
},
|
|
|
|
})
|
|
|
|
// Declare the clippy build as an implicit dependency of the original crate.
|
|
|
|
implicits = append(implicits, clippyFile)
|
|
|
|
}
|
|
|
|
|
2019-08-28 03:03:00 +08:00
|
|
|
ctx.Build(pctx, android.BuildParams{
|
2020-04-09 21:56:02 +08:00
|
|
|
Rule: rustc,
|
|
|
|
Description: "rustc " + main.Rel(),
|
|
|
|
Output: outputFile,
|
|
|
|
ImplicitOutputs: implicitOutputs,
|
|
|
|
Inputs: inputs,
|
|
|
|
Implicits: implicits,
|
2019-08-28 03:03:00 +08:00
|
|
|
Args: map[string]string{
|
|
|
|
"rustcFlags": strings.Join(rustcFlags, " "),
|
2019-09-21 02:00:37 +08:00
|
|
|
"linkFlags": strings.Join(linkFlags, " "),
|
2019-08-28 03:03:00 +08:00
|
|
|
"libFlags": strings.Join(libFlags, " "),
|
2019-11-06 04:16:46 +08:00
|
|
|
"crtBegin": deps.CrtBegin.String(),
|
|
|
|
"crtEnd": deps.CrtEnd.String(),
|
2020-07-10 09:03:28 +08:00
|
|
|
"envVars": strings.Join(envVars, " "),
|
2019-08-28 03:03:00 +08:00
|
|
|
},
|
|
|
|
})
|
|
|
|
|
2020-04-09 21:56:02 +08:00
|
|
|
return output
|
|
|
|
}
|
2021-03-20 06:06:02 +08:00
|
|
|
|
|
|
|
func Rustdoc(ctx ModuleContext, main android.Path, deps PathDeps,
|
|
|
|
flags Flags) android.ModuleOutPath {
|
|
|
|
|
|
|
|
rustdocFlags := append([]string{}, flags.RustdocFlags...)
|
|
|
|
rustdocFlags = append(rustdocFlags, "--sysroot=/dev/null")
|
|
|
|
|
2021-04-28 08:12:02 +08:00
|
|
|
// Build an index for all our crates. -Z unstable options is required to use
|
|
|
|
// this flag.
|
|
|
|
rustdocFlags = append(rustdocFlags, "-Z", "unstable-options", "--enable-index-page")
|
|
|
|
|
2021-03-20 06:06:02 +08:00
|
|
|
targetTriple := ctx.toolchain().RustTriple()
|
|
|
|
|
|
|
|
// Collect rustc flags
|
|
|
|
if targetTriple != "" {
|
|
|
|
rustdocFlags = append(rustdocFlags, "--target="+targetTriple)
|
|
|
|
}
|
|
|
|
|
|
|
|
crateName := ctx.RustModule().CrateName()
|
2021-04-28 08:12:02 +08:00
|
|
|
rustdocFlags = append(rustdocFlags, "--crate-name "+crateName)
|
2021-03-20 06:06:02 +08:00
|
|
|
|
|
|
|
rustdocFlags = append(rustdocFlags, makeLibFlags(deps)...)
|
|
|
|
docTimestampFile := android.PathForModuleOut(ctx, "rustdoc.timestamp")
|
2021-04-28 08:12:02 +08:00
|
|
|
|
|
|
|
// Yes, the same out directory is used simultaneously by all rustdoc builds.
|
|
|
|
// This is what cargo does. The docs for individual crates get generated to
|
|
|
|
// a subdirectory named for the crate, and rustdoc synchronizes writes to
|
|
|
|
// shared pieces like the index and search data itself.
|
|
|
|
// https://github.com/rust-lang/rust/blob/master/src/librustdoc/html/render/write_shared.rs#L144-L146
|
|
|
|
docDir := android.PathForOutput(ctx, "rustdoc")
|
2021-03-20 06:06:02 +08:00
|
|
|
|
|
|
|
ctx.Build(pctx, android.BuildParams{
|
|
|
|
Rule: rustdoc,
|
|
|
|
Description: "rustdoc " + main.Rel(),
|
|
|
|
Output: docTimestampFile,
|
|
|
|
Input: main,
|
|
|
|
Implicit: ctx.RustModule().unstrippedOutputFile.Path(),
|
|
|
|
Args: map[string]string{
|
|
|
|
"rustdocFlags": strings.Join(rustdocFlags, " "),
|
|
|
|
"outDir": docDir.String(),
|
|
|
|
"envVars": strings.Join(rustEnvVars(ctx, deps), " "),
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
return docTimestampFile
|
|
|
|
}
|