Skip to content

Commit

Permalink
fix errors from unused code in opt-dist
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshuawuyts committed Jul 12, 2023
1 parent 453bc91 commit 734c8c9
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 116 deletions.
4 changes: 1 addition & 3 deletions src/tools/opt-dist/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use log::LevelFilter;

use crate::environment::{create_environment, Environment};
use crate::exec::Bootstrap;
use crate::tests::run_tests;
use crate::timer::Timer;
use crate::training::{gather_llvm_bolt_profiles, gather_llvm_profiles, gather_rustc_profiles};
use crate::utils::io::reset_directory;
Expand All @@ -12,7 +11,6 @@ use crate::utils::{clear_llvm_files, format_env_variables, print_free_disk_space
mod environment;
mod exec;
mod metrics;
mod tests;
mod timer;
mod training;
mod utils;
Expand Down Expand Up @@ -126,7 +124,7 @@ fn main() -> anyhow::Result<()> {
.parse_default_env()
.init();

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

Expand Down
101 changes: 0 additions & 101 deletions src/tools/opt-dist/src/tests.rs

This file was deleted.

12 changes: 0 additions & 12 deletions src/tools/opt-dist/src/utils/io.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use anyhow::Context;
use camino::Utf8Path;
use fs_extra::dir::CopyOptions;
use std::fs::File;

/// Delete and re-create the directory.
pub fn reset_directory(path: &Utf8Path) -> anyhow::Result<()> {
Expand Down Expand Up @@ -35,14 +34,3 @@ pub fn delete_directory(path: &Utf8Path) -> anyhow::Result<()> {
.context(format!("Cannot remove directory {path}"))?;
Ok(())
}

pub fn unpack_archive(path: &Utf8Path, dest_dir: &Utf8Path) -> anyhow::Result<()> {
log::info!("Unpacking directory `{path}` into `{dest_dir}`");

assert!(path.as_str().ends_with(".tar.xz"));
let file = File::open(path.as_std_path())?;
let file = xz::read::XzDecoder::new(file);
let mut archive = tar::Archive::new(file);
archive.unpack(dest_dir.as_std_path())?;
Ok(())
}

0 comments on commit 734c8c9

Please sign in to comment.