Skip to content

Commit decce9f

Browse files
committed
Remove src/tools/rust-demangler
1 parent 06d99cd commit decce9f

File tree

16 files changed

+5
-450
lines changed

16 files changed

+5
-450
lines changed

Cargo.lock

-8
Original file line numberDiff line numberDiff line change
@@ -3352,14 +3352,6 @@ dependencies = [
33523352
"wasmparser",
33533353
]
33543354

3355-
[[package]]
3356-
name = "rust-demangler"
3357-
version = "0.0.1"
3358-
dependencies = [
3359-
"regex",
3360-
"rustc-demangle",
3361-
]
3362-
33633355
[[package]]
33643356
name = "rustbook"
33653357
version = "0.1.0"

Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ members = [
2323
"src/tools/remote-test-client",
2424
"src/tools/remote-test-server",
2525
"src/tools/rust-installer",
26-
"src/tools/rust-demangler",
2726
"src/tools/rustdoc",
2827
"src/tools/rls",
2928
"src/tools/rustfmt",

config.example.toml

+1-3
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,7 @@
321321
#
322322
# If `extended = false`, the only one of these built by default is rustdoc.
323323
#
324-
# If `extended = true`, they're all included, with the exception of
325-
# rust-demangler which additionally requires `profiler = true` to be set.
324+
# If `extended = true`, they are all included.
326325
#
327326
# If any enabled tool fails to build, the installation fails.
328327
#tools = [
@@ -334,7 +333,6 @@
334333
# "rust-analyzer-proc-macro-srv",
335334
# "analysis",
336335
# "src",
337-
# "rust-demangler", # if profiler = true
338336
#]
339337

340338
# Verbosity level: 0 == not verbose, 1 == verbose, 2 == very verbose, 3 == print environment variables on each rustc invocation

src/bootstrap/src/core/build_steps/clippy.rs

-1
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,6 @@ lint_any!(
322322
RemoteTestServer, "src/tools/remote-test-server", "remote-test-server";
323323
Rls, "src/tools/rls", "rls";
324324
RustAnalyzer, "src/tools/rust-analyzer", "rust-analyzer";
325-
RustDemangler, "src/tools/rust-demangler", "rust-demangler";
326325
Rustdoc, "src/tools/rustdoc", "clippy";
327326
Rustfmt, "src/tools/rustfmt", "rustfmt";
328327
RustInstaller, "src/tools/rust-installer", "rust-installer";

src/bootstrap/src/core/build_steps/dist.rs

+3-90
Original file line numberDiff line numberDiff line change
@@ -1444,62 +1444,6 @@ impl Step for Rustfmt {
14441444
}
14451445
}
14461446

1447-
#[derive(Debug, PartialOrd, Ord, Clone, Hash, PartialEq, Eq)]
1448-
pub struct RustDemangler {
1449-
pub compiler: Compiler,
1450-
pub target: TargetSelection,
1451-
}
1452-
1453-
impl Step for RustDemangler {
1454-
type Output = Option<GeneratedTarball>;
1455-
const DEFAULT: bool = true;
1456-
const ONLY_HOSTS: bool = true;
1457-
1458-
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
1459-
// While other tools use `should_build_extended_tool` to decide whether to be run by
1460-
// default or not, `rust-demangler` must be build when *either* it's enabled as a tool like
1461-
// the other ones or if `profiler = true`. Because we don't know the target at this stage
1462-
// we run the step by default when only `extended = true`, and decide whether to actually
1463-
// run it or not later.
1464-
let default = run.builder.config.extended;
1465-
run.alias("rust-demangler").default_condition(default)
1466-
}
1467-
1468-
fn make_run(run: RunConfig<'_>) {
1469-
run.builder.ensure(RustDemangler {
1470-
compiler: run.builder.compiler_for(
1471-
run.builder.top_stage,
1472-
run.builder.config.build,
1473-
run.target,
1474-
),
1475-
target: run.target,
1476-
});
1477-
}
1478-
1479-
fn run(self, builder: &Builder<'_>) -> Option<GeneratedTarball> {
1480-
let compiler = self.compiler;
1481-
let target = self.target;
1482-
1483-
// Only build this extended tool if explicitly included in `tools`, or if `profiler = true`
1484-
let condition = should_build_extended_tool(builder, "rust-demangler")
1485-
|| builder.config.profiler_enabled(target);
1486-
if builder.config.extended && !condition {
1487-
return None;
1488-
}
1489-
1490-
let rust_demangler =
1491-
builder.ensure(tool::RustDemangler { compiler, target, extra_features: Vec::new() });
1492-
1493-
// Prepare the image directory
1494-
let mut tarball = Tarball::new(builder, "rust-demangler", &target.triple);
1495-
tarball.set_overlay(OverlayKind::RustDemangler);
1496-
tarball.is_preview(true);
1497-
tarball.add_file(rust_demangler, "bin", 0o755);
1498-
tarball.add_legal_and_readme_to("share/doc/rust-demangler");
1499-
Some(tarball.generate())
1500-
}
1501-
}
1502-
15031447
#[derive(Debug, PartialOrd, Ord, Clone, Hash, PartialEq, Eq)]
15041448
pub struct Extended {
15051449
stage: u32,
@@ -1557,7 +1501,6 @@ impl Step for Extended {
15571501

15581502
add_component!("rust-docs" => Docs { host: target });
15591503
add_component!("rust-json-docs" => JsonDocs { host: target });
1560-
add_component!("rust-demangler"=> RustDemangler { compiler, target });
15611504
add_component!("cargo" => Cargo { compiler, target });
15621505
add_component!("rustfmt" => Rustfmt { compiler, target });
15631506
add_component!("rls" => Rls { compiler, target });
@@ -1621,7 +1564,7 @@ impl Step for Extended {
16211564

16221565
let xform = |p: &Path| {
16231566
let mut contents = t!(fs::read_to_string(p));
1624-
for tool in &["rust-demangler", "miri", "rust-docs"] {
1567+
for tool in &["miri", "rust-docs"] {
16251568
if !built_tools.contains(tool) {
16261569
contents = filter(&contents, tool);
16271570
}
@@ -1662,7 +1605,7 @@ impl Step for Extended {
16621605
prepare("rust-analysis");
16631606
prepare("clippy");
16641607
prepare("rust-analyzer");
1665-
for tool in &["rust-docs", "rust-demangler", "miri", "rustc-codegen-cranelift"] {
1608+
for tool in &["rust-docs", "miri", "rustc-codegen-cranelift"] {
16661609
if built_tools.contains(tool) {
16671610
prepare(tool);
16681611
}
@@ -1702,8 +1645,6 @@ impl Step for Extended {
17021645
"rust-analyzer-preview".to_string()
17031646
} else if name == "clippy" {
17041647
"clippy-preview".to_string()
1705-
} else if name == "rust-demangler" {
1706-
"rust-demangler-preview".to_string()
17071648
} else if name == "miri" {
17081649
"miri-preview".to_string()
17091650
} else if name == "rustc-codegen-cranelift" {
@@ -1723,7 +1664,7 @@ impl Step for Extended {
17231664
prepare("cargo");
17241665
prepare("rust-analysis");
17251666
prepare("rust-std");
1726-
for tool in &["clippy", "rust-analyzer", "rust-docs", "rust-demangler", "miri"] {
1667+
for tool in &["clippy", "rust-analyzer", "rust-docs", "miri"] {
17271668
if built_tools.contains(tool) {
17281669
prepare(tool);
17291670
}
@@ -1847,25 +1788,6 @@ impl Step for Extended {
18471788
.arg(etc.join("msi/remove-duplicates.xsl")),
18481789
);
18491790
}
1850-
if built_tools.contains("rust-demangler") {
1851-
builder.run(
1852-
Command::new(&heat)
1853-
.current_dir(&exe)
1854-
.arg("dir")
1855-
.arg("rust-demangler")
1856-
.args(heat_flags)
1857-
.arg("-cg")
1858-
.arg("RustDemanglerGroup")
1859-
.arg("-dr")
1860-
.arg("RustDemangler")
1861-
.arg("-var")
1862-
.arg("var.RustDemanglerDir")
1863-
.arg("-out")
1864-
.arg(exe.join("RustDemanglerGroup.wxs"))
1865-
.arg("-t")
1866-
.arg(etc.join("msi/remove-duplicates.xsl")),
1867-
);
1868-
}
18691791
if built_tools.contains("miri") {
18701792
builder.run(
18711793
Command::new(&heat)
@@ -1943,9 +1865,6 @@ impl Step for Extended {
19431865
if built_tools.contains("rust-docs") {
19441866
cmd.arg("-dDocsDir=rust-docs");
19451867
}
1946-
if built_tools.contains("rust-demangler") {
1947-
cmd.arg("-dRustDemanglerDir=rust-demangler");
1948-
}
19491868
if built_tools.contains("rust-analyzer") {
19501869
cmd.arg("-dRustAnalyzerDir=rust-analyzer");
19511870
}
@@ -1972,9 +1891,6 @@ impl Step for Extended {
19721891
if built_tools.contains("miri") {
19731892
candle("MiriGroup.wxs".as_ref());
19741893
}
1975-
if built_tools.contains("rust-demangler") {
1976-
candle("RustDemanglerGroup.wxs".as_ref());
1977-
}
19781894
if built_tools.contains("rust-analyzer") {
19791895
candle("RustAnalyzerGroup.wxs".as_ref());
19801896
}
@@ -2016,9 +1932,6 @@ impl Step for Extended {
20161932
if built_tools.contains("rust-analyzer") {
20171933
cmd.arg("RustAnalyzerGroup.wixobj");
20181934
}
2019-
if built_tools.contains("rust-demangler") {
2020-
cmd.arg("RustDemanglerGroup.wixobj");
2021-
}
20221935
if built_tools.contains("rust-docs") {
20231936
cmd.arg("DocsGroup.wixobj");
20241937
}

src/bootstrap/src/core/build_steps/install.rs

-16
Original file line numberDiff line numberDiff line change
@@ -265,22 +265,6 @@ install!((self, builder, _config),
265265
);
266266
}
267267
};
268-
RustDemangler, alias = "rust-demangler", Self::should_build(_config), only_hosts: true, {
269-
// NOTE: Even though `should_build` may return true for `extended` default tools,
270-
// dist::RustDemangler may still return None, unless the target-dependent `profiler` config
271-
// is also true, or the `tools` array explicitly includes "rust-demangler".
272-
if let Some(tarball) = builder.ensure(dist::RustDemangler {
273-
compiler: self.compiler,
274-
target: self.target
275-
}) {
276-
install_sh(builder, "rust-demangler", self.compiler.stage, Some(self.target), &tarball);
277-
} else {
278-
builder.info(
279-
&format!("skipping Install RustDemangler stage{} ({})",
280-
self.compiler.stage, self.target),
281-
);
282-
}
283-
};
284268
Rustc, path = "compiler/rustc", true, only_hosts: true, {
285269
let tarball = builder.ensure(dist::Rustc {
286270
compiler: builder.compiler(builder.top_stage, self.target),

src/bootstrap/src/core/build_steps/test.rs

-59
Original file line numberDiff line numberDiff line change
@@ -432,65 +432,6 @@ impl Step for Rustfmt {
432432
}
433433
}
434434

435-
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
436-
pub struct RustDemangler {
437-
stage: u32,
438-
host: TargetSelection,
439-
}
440-
441-
impl Step for RustDemangler {
442-
type Output = ();
443-
const ONLY_HOSTS: bool = true;
444-
445-
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
446-
run.path("src/tools/rust-demangler")
447-
}
448-
449-
fn make_run(run: RunConfig<'_>) {
450-
run.builder.ensure(RustDemangler { stage: run.builder.top_stage, host: run.target });
451-
}
452-
453-
/// Runs `cargo test` for rust-demangler.
454-
fn run(self, builder: &Builder<'_>) {
455-
let stage = self.stage;
456-
let host = self.host;
457-
let compiler = builder.compiler(stage, host);
458-
459-
let rust_demangler = builder.ensure(tool::RustDemangler {
460-
compiler,
461-
target: self.host,
462-
extra_features: Vec::new(),
463-
});
464-
let mut cargo = tool::prepare_tool_cargo(
465-
builder,
466-
compiler,
467-
Mode::ToolRustc,
468-
host,
469-
"test",
470-
"src/tools/rust-demangler",
471-
SourceType::InTree,
472-
&[],
473-
);
474-
475-
let dir = testdir(builder, compiler.host);
476-
t!(fs::create_dir_all(dir));
477-
478-
cargo.env("RUST_DEMANGLER_DRIVER_PATH", rust_demangler);
479-
cargo.add_rustc_lib_path(builder);
480-
481-
run_cargo_test(
482-
cargo,
483-
&[],
484-
&[],
485-
"rust-demangler",
486-
"rust-demangler",
487-
compiler,
488-
host,
489-
builder,
490-
);
491-
}
492-
}
493-
494435
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
495436
pub struct Miri {
496437
target: TargetSelection,

src/bootstrap/src/core/build_steps/tool.rs

-1
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,6 @@ tool_extended!((self, builder),
905905
// But `builder.cargo` doesn't know how to handle ToolBootstrap in stages other than 0,
906906
// and this is close enough for now.
907907
Rls, "src/tools/rls", "rls", stable=true, tool_std=true;
908-
RustDemangler, "src/tools/rust-demangler", "rust-demangler", stable=false, tool_std=true;
909908
Rustfmt, "src/tools/rustfmt", "rustfmt", stable=true, add_bins_to_sysroot = ["rustfmt", "cargo-fmt"];
910909
);
911910

src/bootstrap/src/core/builder.rs

-5
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,6 @@ impl<'a> Builder<'a> {
737737
tool::Rls,
738738
tool::RustAnalyzer,
739739
tool::RustAnalyzerProcMacroSrv,
740-
tool::RustDemangler,
741740
tool::Rustdoc,
742741
tool::Clippy,
743742
tool::CargoClippy,
@@ -775,7 +774,6 @@ impl<'a> Builder<'a> {
775774
clippy::RemoteTestServer,
776775
clippy::Rls,
777776
clippy::RustAnalyzer,
778-
clippy::RustDemangler,
779777
clippy::Rustdoc,
780778
clippy::Rustfmt,
781779
clippy::RustInstaller,
@@ -844,7 +842,6 @@ impl<'a> Builder<'a> {
844842
test::Miri,
845843
test::CargoMiri,
846844
test::Clippy,
847-
test::RustDemangler,
848845
test::CompiletestTest,
849846
test::CrateRunMakeSupport,
850847
test::RustdocJSStd,
@@ -905,7 +902,6 @@ impl<'a> Builder<'a> {
905902
dist::Rls,
906903
dist::RustAnalyzer,
907904
dist::Rustfmt,
908-
dist::RustDemangler,
909905
dist::Clippy,
910906
dist::Miri,
911907
dist::LlvmTools,
@@ -932,7 +928,6 @@ impl<'a> Builder<'a> {
932928
install::Cargo,
933929
install::RustAnalyzer,
934930
install::Rustfmt,
935-
install::RustDemangler,
936931
install::Clippy,
937932
install::Miri,
938933
install::LlvmTools,

src/bootstrap/src/utils/tarball.rs

-5
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ pub(crate) enum OverlayKind {
2323
Clippy,
2424
Miri,
2525
Rustfmt,
26-
RustDemangler,
2726
Rls,
2827
RustAnalyzer,
2928
RustcCodegenCranelift,
@@ -58,9 +57,6 @@ impl OverlayKind {
5857
"src/tools/rustfmt/LICENSE-APACHE",
5958
"src/tools/rustfmt/LICENSE-MIT",
6059
],
61-
OverlayKind::RustDemangler => {
62-
&["src/tools/rust-demangler/README.md", "LICENSE-APACHE", "LICENSE-MIT"]
63-
}
6460
OverlayKind::Rls => &["src/tools/rls/README.md", "LICENSE-APACHE", "LICENSE-MIT"],
6561
OverlayKind::RustAnalyzer => &[
6662
"src/tools/rust-analyzer/README.md",
@@ -85,7 +81,6 @@ impl OverlayKind {
8581
match self {
8682
OverlayKind::Rust => builder.rust_version(),
8783
OverlayKind::Llvm => builder.rust_version(),
88-
OverlayKind::RustDemangler => builder.release_num("rust-demangler"),
8984
OverlayKind::Cargo => {
9085
builder.cargo_info.version(builder, &builder.release_num("cargo"))
9186
}

src/doc/rustc/src/instrument-coverage.md

+1-7
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,6 @@ One option for a Rust demangler is [`rustfilt`], which can be installed with:
4949
cargo install rustfilt
5050
```
5151
52-
Another option, if you are building from the Rust compiler source distribution, is to use the `rust-demangler` tool included in the Rust source distribution, which can be built with:
53-
54-
```shell
55-
$ ./x.py build rust-demangler
56-
```
57-
5852
[`rustfilt`]: https://crates.io/crates/rustfilt
5953

6054
## Compiling with coverage enabled
@@ -164,7 +158,7 @@ $ llvm-cov show -Xdemangler=rustfilt target/debug/examples/formatjson5 \
164158

165159
Some of the more notable options in this example include:
166160

167-
- `--Xdemangler=rustfilt` - the command name or path used to demangle Rust symbols (`rustfilt` in the example, but this could also be a path to the `rust-demangler` tool)
161+
- `--Xdemangler=rustfilt` - the command name or path used to demangle Rust symbols (`rustfilt` in the example)
168162
- `target/debug/examples/formatjson5` - the instrumented binary (from which to extract the coverage map)
169163
- `--instr-profile=<path-to-file>.profdata` - the location of the `.profdata` file created by `llvm-profdata merge` (from the `.profraw` file generated by the instrumented binary)
170164
- `--name=<exact-function-name>` - to show coverage for a specific function (or, consider using another filter option, such as `--name-regex=<pattern>`)

0 commit comments

Comments
 (0)