Add debugging to why linux-x64 doesn't work

This commit is contained in:
Felix Schütt
2023-01-04 11:52:30 +01:00
parent 683c60c255
commit 0fbcbeed66

View File

@@ -9,10 +9,10 @@ use std::collections::BTreeMap;
use std::env; use std::env;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::process::Command; use std::process::Command;
use std::process::Stdio;
use wasmer::*; use wasmer::*;
use wasmer_object::{emit_serialized, get_object_for_target}; use wasmer_object::{emit_serialized, get_object_for_target};
use wasmer_types::ModuleInfo; use wasmer_types::ModuleInfo;
use webc::{ParseOptions, WebCMmap}; use webc::{ParseOptions, WebCMmap};
/// The `prefixer` returns the a String to prefix each of the /// The `prefixer` returns the a String to prefix each of the
@@ -1286,10 +1286,20 @@ fn link_exe_from_dir(
cmd.args(files_winsdk); cmd.args(files_winsdk);
} }
println!("running cmd: {cmd:?}");
let compilation = cmd let compilation = cmd
.stdout(Stdio::inherit())
.stderr(Stdio::inherit())
.output() .output()
.context(anyhow!("Could not execute `zig`: {cmd:?}"))?; .context(anyhow!("Could not execute `zig`: {cmd:?}"))?;
println!(
"file {} exists: {:?}",
out_path.display(),
out_path.exists()
);
if !compilation.status.success() { if !compilation.status.success() {
return Err(anyhow::anyhow!(String::from_utf8_lossy( return Err(anyhow::anyhow!(String::from_utf8_lossy(
&compilation.stderr &compilation.stderr
@@ -1298,7 +1308,9 @@ fn link_exe_from_dir(
} }
// remove file if it exists - if not done, can lead to errors on copy // remove file if it exists - if not done, can lead to errors on copy
let _ = std::fs::remove_file(&normalize_path(&format!("{}", output_path.display()))); let output_path_normalized = normalize_path(&format!("{}", output_path.display()));
println!("removing {output_path_normalized}");
let _ = std::fs::remove_file(&output_path_normalized);
std::fs::copy( std::fs::copy(
&normalize_path(&format!("{}", out_path.display())), &normalize_path(&format!("{}", out_path.display())),
&normalize_path(&format!("{}", output_path.display())), &normalize_path(&format!("{}", output_path.display())),