Add debugging for where the "path not found" error comes from

This commit is contained in:
Felix Schütt
2023-01-03 17:55:19 +01:00
parent 9cd8d09eaa
commit 4c61969777
2 changed files with 22 additions and 2 deletions

View File

@@ -195,11 +195,14 @@ pub struct Volume {
impl CreateExe {
/// Runs logic for the `compile` subcommand
pub fn execute(&self) -> Result<()> {
println!("create execute 1");
let path = normalize_path(&format!("{}", self.path.display()));
let target_triple = self.target_triple.clone().unwrap_or_else(Triple::host);
let mut cc = self.cross_compile.clone();
let target = utils::target_triple_to_target(&target_triple, &self.cpu_features);
println!("create execute 2");
let starting_cd = env::current_dir()?;
let input_path = starting_cd.join(&path);
let output_path = starting_cd.join(&self.output);
@@ -215,6 +218,8 @@ impl CreateExe {
None => None,
};
println!("create execute 3");
let cross_compilation = utils::get_cross_compile_setup(
&mut cc,
&target_triple,
@@ -223,6 +228,8 @@ impl CreateExe {
url_or_version,
)?;
println!("create execute 4");
if input_path.is_dir() {
return Err(anyhow::anyhow!("input path cannot be a directory"));
}
@@ -246,6 +253,8 @@ impl CreateExe {
};
std::fs::create_dir_all(&tempdir)?;
println!("create execute 5");
let atoms =
if let Ok(pirita) = WebCMmap::parse(input_path.clone(), &ParseOptions::default()) {
// pirita file
@@ -274,6 +283,8 @@ impl CreateExe {
)
}?;
println!("create execute 6");
get_module_infos(&tempdir, &atoms, object_format)?;
let mut entrypoint = get_entrypoint(&tempdir)?;
create_header_files_in_dir(&tempdir, &mut entrypoint, &atoms, &self.precompiled_atom)?;
@@ -287,6 +298,8 @@ impl CreateExe {
&self.precompiled_atom,
)?;
println!("create execute 7");
if self.target_triple.is_some() {
eprintln!(
"✔ Cross-compiled executable for `{}` target compiled successfully to `{}`.",