use crate::native;
use crate::tool::{self, SourceType, Tool};
use crate::toolstate::ToolState;
-use crate::util::{self, dylib_path, dylib_path_var};
+use crate::util::{self, add_link_lib_path, dylib_path, dylib_path_var};
use crate::Crate as CargoCrate;
use crate::{envify, DocTests, GitRepo, Mode};
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct RustdocJSStd {
- pub host: Interned<String>,
pub target: Interned<String>,
}
}
fn make_run(run: RunConfig<'_>) {
- run.builder.ensure(RustdocJSStd { host: run.host, target: run.target });
+ run.builder.ensure(RustdocJSStd { target: run.target });
}
fn run(self, builder: &Builder<'_>) {
if let Some(ref nodejs) = builder.config.nodejs {
let mut command = Command::new(nodejs);
- command.args(&["src/tools/rustdoc-js-std/tester.js", &*self.host]);
+ command
+ .arg(builder.src.join("src/tools/rustdoc-js/tester.js"))
+ .arg("--crate-name")
+ .arg("std")
+ .arg("--resource-suffix")
+ .arg(crate::channel::CFG_RELEASE_NUM)
+ .arg("--doc-folder")
+ .arg(builder.doc_out(self.target))
+ .arg("--test-folder")
+ .arg(builder.src.join("src/test/rustdoc-js-std"));
builder.ensure(crate::doc::Std { target: self.target, stage: builder.top_stage });
builder.run(&mut command);
} else {
let mut cmd = builder.tool_cmd(Tool::Tidy);
cmd.arg(builder.src.join("src"));
cmd.arg(&builder.initial_cargo);
- if !builder.config.vendor {
- cmd.arg("--no-vendor");
- }
if builder.is_verbose() {
cmd.arg("--verbose");
}
}
}
+#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
+pub struct ExpandYamlAnchors;
+
+impl Step for ExpandYamlAnchors {
+ type Output = ();
+ const ONLY_HOSTS: bool = true;
+
+ /// Ensure the `generate-ci-config` tool was run locally.
+ ///
+ /// The tool in `src/tools` reads the CI definition in `src/ci/builders.yml` and generates the
+ /// appropriate configuration for all our CI providers. This step ensures the tool was called
+ /// by the user before committing CI changes.
+ fn run(self, builder: &Builder<'_>) {
+ builder.info("Ensuring the YAML anchors in the GitHub Actions config were expanded");
+ try_run(
+ builder,
+ &mut builder.tool_cmd(Tool::ExpandYamlAnchors).arg("check").arg(&builder.src),
+ );
+ }
+
+ fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
+ run.path("src/tools/expand-yaml-anchors")
+ }
+
+ fn make_run(run: RunConfig<'_>) {
+ run.builder.ensure(ExpandYamlAnchors);
+ }
+}
+
fn testdir(builder: &Builder<'_>, host: Interned<String>) -> PathBuf {
builder.out.join(host).join("test")
}
let llvm_config = builder.ensure(native::Llvm { target: builder.config.build });
if !builder.config.dry_run {
let llvm_version = output(Command::new(&llvm_config).arg("--version"));
+ // Remove trailing newline from llvm-config output.
+ let llvm_version = llvm_version.trim_end();
cmd.arg("--llvm-version").arg(llvm_version);
}
if !builder.is_rust_llvm(target) {
cmd.arg("--system-llvm");
}
+ // Tests that use compiler libraries may inherit the `-lLLVM` link
+ // requirement, but the `-L` library path is not propagated across
+ // separate compilations. We can add LLVM's library path to the
+ // platform-specific environment variable as a workaround.
+ if !builder.config.dry_run && suite.ends_with("fulldeps") {
+ let llvm_libdir = output(Command::new(&llvm_config).arg("--libdir"));
+ add_link_lib_path(vec![llvm_libdir.trim().into()], &mut cmd);
+ }
+
// Only pass correct values for these flags for the `run-make` suite as it
// requires that a C++ compiler was configured which isn't always the case.
if !builder.config.dry_run && suite == "run-make-fulldeps" {