Skip to content

Commit

Permalink
temp: display wasm file path
Browse files Browse the repository at this point in the history
  • Loading branch information
burmecia committed Oct 23, 2024
1 parent b4d035f commit 0b5722c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions wrappers/src/fdw/wasm_fdw/wasm_fdw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ fn download_component(
return Ok(Component::from_file(engine, file_path)?);
}

report_info(&format!(
"==curr dir {}",
std::env::current_dir().unwrap().display()
));

if url.starts_with("warg://") || url.starts_with("wargs://") {
let url = url
.replacen("warg://", "http://", 1)
Expand Down Expand Up @@ -107,6 +112,8 @@ fn download_component(
fs::write(&path, bytes)?;
}

report_info(&format!("==path {}", path.display()));

Ok(Component::from_file(engine, &path).inspect_err(|_| {
// remove the cache file if it cannot be loaded as component
let _ = fs::remove_file(&path);
Expand Down Expand Up @@ -146,10 +153,6 @@ impl ForeignDataWrapper<WasmFdwError> for WasmFdw {
config.wasm_component_model(true);
let engine = Engine::new(&config)?;

report_info(&format!(
"==curr dir {}",
std::env::current_dir().unwrap().display()
));
let component =
download_component(&rt, &engine, pkg_url, pkg_name, pkg_version, pkg_checksum)?;

Expand Down

0 comments on commit 0b5722c

Please sign in to comment.