Skip to content

Commit 734c8c9

Browse files
committed
fix errors from unused code in opt-dist
1 parent 453bc91 commit 734c8c9

File tree

3 files changed

+1
-116
lines changed

3 files changed

+1
-116
lines changed

src/tools/opt-dist/src/main.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use log::LevelFilter;
33

44
use crate::environment::{create_environment, Environment};
55
use crate::exec::Bootstrap;
6-
use crate::tests::run_tests;
76
use crate::timer::Timer;
87
use crate::training::{gather_llvm_bolt_profiles, gather_llvm_profiles, gather_rustc_profiles};
98
use crate::utils::io::reset_directory;
@@ -12,7 +11,6 @@ use crate::utils::{clear_llvm_files, format_env_variables, print_free_disk_space
1211
mod environment;
1312
mod exec;
1413
mod metrics;
15-
mod tests;
1614
mod timer;
1715
mod training;
1816
mod utils;
@@ -126,7 +124,7 @@ fn main() -> anyhow::Result<()> {
126124
.parse_default_env()
127125
.init();
128126

129-
let mut build_args: Vec<String> = std::env::args().skip(1).collect();
127+
let build_args: Vec<String> = std::env::args().skip(1).collect();
130128
log::info!("Running optimized build pipeline with args `{}`", build_args.join(" "));
131129
log::info!("Environment values\n{}", format_env_variables());
132130

src/tools/opt-dist/src/tests.rs

-101
This file was deleted.

src/tools/opt-dist/src/utils/io.rs

-12
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use anyhow::Context;
22
use camino::Utf8Path;
33
use fs_extra::dir::CopyOptions;
4-
use std::fs::File;
54

65
/// Delete and re-create the directory.
76
pub fn reset_directory(path: &Utf8Path) -> anyhow::Result<()> {
@@ -35,14 +34,3 @@ pub fn delete_directory(path: &Utf8Path) -> anyhow::Result<()> {
3534
.context(format!("Cannot remove directory {path}"))?;
3635
Ok(())
3736
}
38-
39-
pub fn unpack_archive(path: &Utf8Path, dest_dir: &Utf8Path) -> anyhow::Result<()> {
40-
log::info!("Unpacking directory `{path}` into `{dest_dir}`");
41-
42-
assert!(path.as_str().ends_with(".tar.xz"));
43-
let file = File::open(path.as_std_path())?;
44-
let file = xz::read::XzDecoder::new(file);
45-
let mut archive = tar::Archive::new(file);
46-
archive.unpack(dest_dir.as_std_path())?;
47-
Ok(())
48-
}

0 commit comments

Comments
 (0)