mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 06:44:46 +00:00
update reference to zig-cache
This commit is contained in:
parent
c47915a691
commit
5f95b59c42
4 changed files with 10 additions and 7 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -24,7 +24,10 @@
|
||||||
# Ignore the following directories and file extensions
|
# Ignore the following directories and file extensions
|
||||||
target
|
target
|
||||||
generated-docs
|
generated-docs
|
||||||
|
|
||||||
|
# todo remove after upgrade to zig 0.13.0
|
||||||
zig-cache
|
zig-cache
|
||||||
|
|
||||||
zig-out
|
zig-out
|
||||||
.zig-cache
|
.zig-cache
|
||||||
.direnv
|
.direnv
|
||||||
|
|
|
@ -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
|
// workaround for github.com/ziglang/zig/issues/9711
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
let _ = fs::remove_dir_all("./zig-cache");
|
let _ = fs::remove_dir_all("./.zig-cache");
|
||||||
|
|
||||||
let mut zig_cmd = zig();
|
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 entry = entry?;
|
||||||
let path_buf = entry.path();
|
let path_buf = entry.path();
|
||||||
if path_buf.is_dir() {
|
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();
|
get_zig_files(&path_buf, cb).unwrap();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -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<()> {
|
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.
|
// 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| {
|
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
|
err
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
} else if src_path.is_dir() && src_filename != "zig-cache" {
|
} else if src_path.is_dir() && src_filename != ".zig-cache" {
|
||||||
// Recursively copy all directories except zig-cache
|
// Recursively copy all directories except .zig-cache
|
||||||
cp_unless_zig_cache(&src_path, &target_dir.join(src_filename))?;
|
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 entry = entry?;
|
||||||
let path_buf = entry.path();
|
let path_buf = entry.path();
|
||||||
if path_buf.is_dir() {
|
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();
|
get_zig_files(&path_buf, cb).unwrap();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -10,7 +10,7 @@ fn main() {
|
||||||
|
|
||||||
// out_dir == "<project_root>/target/[<platform>/]<profile>/build/wasi_libc_sys_<hex>/"
|
// out_dir == "<project_root>/target/[<platform>/]<profile>/build/wasi_libc_sys_<hex>/"
|
||||||
let out_dir = env::var("OUT_DIR").unwrap();
|
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"
|
// out_file == "<project_root>/target/[<platform>/]<profile>/lib/wasi-libc.a"
|
||||||
let mut out_file = PathBuf::from(&out_dir);
|
let mut out_file = PathBuf::from(&out_dir);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue