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

View File

@@ -5,6 +5,7 @@ use std::fs;
use std::io::prelude::*; use std::io::prelude::*;
use std::path::PathBuf; use std::path::PathBuf;
use std::process::Command; use std::process::Command;
use std::process::Stdio;
use tempfile::TempDir; use tempfile::TempDir;
use wasmer_integration_tests_cli::*; use wasmer_integration_tests_cli::*;
@@ -66,7 +67,10 @@ impl WasmerCreateExe {
println!("(integration-test) running create-exe: {cmd}"); println!("(integration-test) running create-exe: {cmd}");
let output = output.output()?; let output = output
.stdout(Stdio::inherit())
.stderr(Stdio::inherit())
.output()?;
if !output.status.success() { if !output.status.success() {
bail!( bail!(
@@ -130,7 +134,10 @@ impl WasmerCreateObj {
println!("(integration-test) running create-obj: {cmd}"); println!("(integration-test) running create-obj: {cmd}");
let output = output.output()?; let output = output
.stdout(Stdio::inherit())
.stderr(Stdio::inherit())
.output()?;
if !output.status.success() { if !output.status.success() {
bail!( bail!(