update reference to zig-cache

This commit is contained in:
Luke Boswell 2024-07-28 17:10:40 +10:00
parent c47915a691
commit 5f95b59c42
No known key found for this signature in database
GPG key ID: F6DB3C9DB47377B0
4 changed files with 10 additions and 7 deletions

3
.gitignore vendored
View file

@ -24,7 +24,10 @@
# Ignore the following directories and file extensions
target
generated-docs
# todo remove after upgrade to zig 0.13.0
zig-cache
zig-out
.zig-cache
.direnv

View file

@ -71,7 +71,7 @@ fn generate_bc_file(bitcode_path: &Path, zig_object: &str, file_name: &str) {
// workaround for github.com/ziglang/zig/issues/9711
#[cfg(target_os = "macos")]
let _ = fs::remove_dir_all("./zig-cache");
let _ = fs::remove_dir_all("./.zig-cache");
let mut zig_cmd = zig();
@ -137,7 +137,7 @@ fn get_zig_files(dir: &Path, cb: &dyn Fn(&Path)) -> io::Result<()> {
let entry = entry?;
let path_buf = entry.path();
if path_buf.is_dir() {
if !path_buf.ends_with("zig-cache") {
if !path_buf.ends_with(".zig-cache") {
get_zig_files(&path_buf, cb).unwrap();
}
} else {

View file

@ -119,7 +119,7 @@ fn copy_zig_builtins_to_target_dir(bitcode_path: &Path) {
});
}
// recursively copy all the .zig files from this directory, but do *not* recurse into zig-cache/
// recursively copy all the .zig files from this directory, but do *not* recurse into .zig-cache/
fn cp_unless_zig_cache(src_dir: &Path, target_dir: &Path) -> io::Result<()> {
// Make sure the destination directory exists before we try to copy anything into it.
std::fs::create_dir_all(target_dir).unwrap_or_else(|err| {
@ -146,8 +146,8 @@ fn cp_unless_zig_cache(src_dir: &Path, target_dir: &Path) -> io::Result<()> {
err
);
});
} else if src_path.is_dir() && src_filename != "zig-cache" {
// Recursively copy all directories except zig-cache
} else if src_path.is_dir() && src_filename != ".zig-cache" {
// Recursively copy all directories except .zig-cache
cp_unless_zig_cache(&src_path, &target_dir.join(src_filename))?;
}
}
@ -199,7 +199,7 @@ fn get_zig_files(dir: &Path, cb: &dyn Fn(&Path)) -> io::Result<()> {
let entry = entry?;
let path_buf = entry.path();
if path_buf.is_dir() {
if !path_buf.ends_with("zig-cache") {
if !path_buf.ends_with(".zig-cache") {
get_zig_files(&path_buf, cb).unwrap();
}
} else {

View file

@ -10,7 +10,7 @@ fn main() {
// out_dir == "<project_root>/target/[<platform>/]<profile>/build/wasi_libc_sys_<hex>/"
let out_dir = env::var("OUT_DIR").unwrap();
let zig_cache_dir = PathBuf::from(&out_dir).join("zig-cache");
let zig_cache_dir = PathBuf::from(&out_dir).join(".zig-cache");
// out_file == "<project_root>/target/[<platform>/]<profile>/lib/wasi-libc.a"
let mut out_file = PathBuf::from(&out_dir);