Fix Android backend failing to build on Windows with n2

This commit is contained in:
Damien Elmes 2023-11-08 13:31:35 +10:00
parent 2241d2fd9d
commit f9d5f422e4
4 changed files with 7 additions and 1 deletions

1
Cargo.lock generated
View file

@ -2599,6 +2599,7 @@ dependencies = [
"anki_io",
"anyhow",
"camino",
"dunce",
"globset",
"itertools 0.11.0",
"lazy_static",

View file

@ -143,6 +143,7 @@ zip = { version = "0.6.6", default-features = false, features = ["deflate", "tim
zstd = { version = "0.13.0", features = ["zstdmt"] }
envy = "0.4.2"
dirs = "5.0.1"
dunce = "1.0.4"
# Apply mild optimizations to our dependencies in dev mode, which among other things
# improves sha2 performance by about 21x. Opt 1 chosen due to

View file

@ -11,6 +11,7 @@ rust-version.workspace = true
anki_io.workspace = true
anyhow.workspace = true
camino.workspace = true
dunce.workspace = true
globset.workspace = true
itertools.workspace = true
lazy_static.workspace = true

View file

@ -46,7 +46,10 @@ fn locate_git_head() -> Option<BuildInput> {
return Some(inputs![standard_path.to_string()]);
}
let mut folder = Utf8Path::new(".").canonicalize_utf8().unwrap();
let mut folder = Utf8PathBuf::from_path_buf(
dunce::canonicalize(Utf8Path::new(".").canonicalize().unwrap()).unwrap(),
)
.unwrap();
loop {
let path = folder.join(".git").join("modules");
if path.exists() {