Fix extension store test failure on main due to wasi-sdk download

This commit is contained in:
Max Brunsfeld 2024-03-07 10:53:17 -08:00
parent 86748a09e7
commit 27518f4280

View File

@ -351,16 +351,19 @@ impl ExtensionBuilder {
return Ok(clang_path); return Ok(clang_path);
} }
let mut tar_out_dir = wasi_sdk_dir.clone();
tar_out_dir.set_extension("archive");
fs::remove_dir_all(&wasi_sdk_dir).ok(); fs::remove_dir_all(&wasi_sdk_dir).ok();
fs::remove_dir_all(&tar_out_dir).ok();
let mut response = self.http.get(&url, AsyncBody::default(), true).await?; let mut response = self.http.get(&url, AsyncBody::default(), true).await?;
let mut tar_out_dir = wasi_sdk_dir.clone();
tar_out_dir.set_extension(".output");
let body = BufReader::new(response.body_mut()); let body = BufReader::new(response.body_mut());
let body = GzipDecoder::new(body); let body = GzipDecoder::new(body);
let tar = Archive::new(body); let tar = Archive::new(body);
tar.unpack(&tar_out_dir).await?; tar.unpack(&tar_out_dir)
.await
.context("failed to unpack wasi-sdk archive")?;
let inner_dir = fs::read_dir(&tar_out_dir)? let inner_dir = fs::read_dir(&tar_out_dir)?
.next() .next()