Skip to content

Commit

Permalink
Remove the expand-yaml-anchors tool
Browse files Browse the repository at this point in the history
  • Loading branch information
Kobzol committed Apr 25, 2024
1 parent e2960f4 commit e199ee3
Show file tree
Hide file tree
Showing 11 changed files with 2 additions and 309 deletions.
34 changes: 0 additions & 34 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1256,14 +1256,6 @@ dependencies = [
"mdbook",
]

[[package]]
name = "expand-yaml-anchors"
version = "0.1.0"
dependencies = [
"yaml-merge-keys",
"yaml-rust",
]

[[package]]
name = "expect-test"
version = "1.5.0"
Expand Down Expand Up @@ -2244,12 +2236,6 @@ dependencies = [
"regex",
]

[[package]]
name = "linked-hash-map"
version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f"

[[package]]
name = "lint-docs"
version = "0.1.0"
Expand Down Expand Up @@ -6553,26 +6539,6 @@ dependencies = [
"lzma-sys",
]

[[package]]
name = "yaml-merge-keys"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fd236a7dc9bb598f349fe4a8754f49181fee50284daa15cd1ba652d722280004"
dependencies = [
"lazy_static",
"thiserror",
"yaml-rust",
]

[[package]]
name = "yaml-rust"
version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85"
dependencies = [
"linked-hash-map",
]

[[package]]
name = "yansi-term"
version = "0.1.2"
Expand Down
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ members = [
"src/tools/miri/cargo-miri",
"src/tools/rustdoc-themes",
"src/tools/unicode-table-generator",
"src/tools/expand-yaml-anchors",
"src/tools/jsondocck",
"src/tools/jsondoclint",
"src/tools/llvm-bitcode-linker",
Expand Down
26 changes: 0 additions & 26 deletions src/bootstrap/src/core/build_steps/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,6 @@ use crate::core::config::TargetSelection;
use crate::utils::helpers::output;
use crate::Mode;

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ExpandYamlAnchors;

impl Step for ExpandYamlAnchors {
type Output = ();

/// Runs the `expand-yaml_anchors` tool.
///
/// This tool in `src/tools` reads the CI configuration files written in YAML and expands the
/// anchors in them, since GitHub Actions doesn't support them.
fn run(self, builder: &Builder<'_>) {
builder.info("Expanding YAML anchors in the GitHub Actions configuration");
builder.run_delaying_failure(
builder.tool_cmd(Tool::ExpandYamlAnchors).arg("generate").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);
}
}

#[derive(Debug, PartialOrd, Ord, Clone, Hash, PartialEq, Eq)]
pub struct BuildManifest;

Expand Down
35 changes: 0 additions & 35 deletions src/bootstrap/src/core/build_steps/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1146,8 +1146,6 @@ HELP: to skip test's attempt to check tidiness, pass `--skip src/tools/tidy` to
builder.info("tidy check");
builder.run_delaying_failure(&mut cmd);

builder.ensure(ExpandYamlAnchors);

builder.info("x.py completions check");
let [bash, zsh, fish, powershell] = ["x.py.sh", "x.py.zsh", "x.py.fish", "x.py.ps1"]
.map(|filename| builder.src.join("src/etc/completions").join(filename));
Expand Down Expand Up @@ -1175,39 +1173,6 @@ HELP: to skip test's attempt to check tidiness, pass `--skip src/tools/tidy` to
}
}

#[derive(Debug, 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<'_>) {
// NOTE: `.github/` is not included in dist-src tarballs
if !builder.src.join(".github/workflows/ci.yml").exists() {
builder.info("Skipping YAML anchors check: GitHub Actions config not found");
return;
}
builder.info("Ensuring the YAML anchors in the GitHub Actions config were expanded");
builder.run_delaying_failure(
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: TargetSelection) -> PathBuf {
builder.out.join(host.triple).join("test")
}
Expand Down
1 change: 0 additions & 1 deletion src/bootstrap/src/core/build_steps/tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,6 @@ bootstrap_tool!(
RemoteTestClient, "src/tools/remote-test-client", "remote-test-client";
RustInstaller, "src/tools/rust-installer", "rust-installer";
RustdocTheme, "src/tools/rustdoc-themes", "rustdoc-themes";
ExpandYamlAnchors, "src/tools/expand-yaml-anchors", "expand-yaml-anchors";
LintDocs, "src/tools/lint-docs", "lint-docs";
JsonDocCk, "src/tools/jsondocck", "jsondocck";
JsonDocLint, "src/tools/jsondoclint", "jsondoclint";
Expand Down
2 changes: 0 additions & 2 deletions src/bootstrap/src/core/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,6 @@ impl<'a> Builder<'a> {
),
Kind::Test => describe!(
crate::core::build_steps::toolstate::ToolStateCheck,
test::ExpandYamlAnchors,
test::Tidy,
test::Ui,
test::Crashes,
Expand Down Expand Up @@ -908,7 +907,6 @@ impl<'a> Builder<'a> {
install::Src,
),
Kind::Run => describe!(
run::ExpandYamlAnchors,
run::BuildManifest,
run::BumpStage0,
run::ReplaceVersionPlaceholder,
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/src/core/config/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ pub enum Subcommand {
Arguments:
This subcommand accepts a number of paths to tools to build and run. For
example:
./x.py run src/tools/expand-yaml-anchors
./x.py run src/tools/bump-stage0
At least a tool needs to be called.")]
/// Run tools contained in this repository
Run {
Expand Down
2 changes: 1 addition & 1 deletion src/ci/docker/host-x86_64/mingw-check/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ COPY host-x86_64/mingw-check/validate-error-codes.sh /scripts/

ENV RUN_CHECK_WITH_PARALLEL_QUERIES 1

ENV SCRIPT python3 ../x.py --stage 2 test src/tools/expand-yaml-anchors && \
ENV SCRIPT python3 ../x.py --stage 2 \
# Check library crates on all tier 1 targets.
# We disable optimized compiler built-ins because that requires a C toolchain for the target.
# We also skip the x86_64-unknown-linux-gnu target as it is well-tested by other jobs.
Expand Down
2 changes: 0 additions & 2 deletions src/ci/github-actions/jobs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# This file contains definitions of CI job parameters that are loaded
# dynamically in CI from ci.yml.
# You *do not* need to re-run `src/tools/expand-yaml-anchors` when you
# modify this file.
runners:
- &base-job
env: { }
Expand Down
8 changes: 0 additions & 8 deletions src/tools/expand-yaml-anchors/Cargo.toml

This file was deleted.

0 comments on commit e199ee3

Please sign in to comment.