0
0
Fork 0
mirror of https://github.com/denoland/rusty_v8.git synced 2024-12-23 15:50:11 -05:00

chore(build): try remove_file on windows (#1529)

This commit is contained in:
David Sherret 2024-07-15 13:30:58 -04:00 committed by GitHub
parent 7107d4869e
commit b590c12fe9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 14 additions and 4 deletions

2
Cargo.lock generated
View file

@ -1452,7 +1452,7 @@ checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85"
[[package]]
name = "v8"
version = "0.98.0"
version = "0.98.1"
dependencies = [
"align-data",
"bindgen",

View file

@ -1,6 +1,6 @@
[package]
name = "v8"
version = "0.98.0"
version = "0.98.1"
description = "Rust bindings to V8"
readme = "README.md"
authors = ["the Deno authors"]

View file

@ -825,6 +825,7 @@ fn maybe_symlink_root_dir(dirs: &mut Dirs) {
// symlink called 'gn_root' in the out directory, next to 'gn_out', so it
// appears as if they're both on the same drive.
use std::fs::remove_dir_all;
use std::fs::remove_file;
use std::os::windows::fs::symlink_dir;
let get_prefix = |p: &Path| {
@ -850,13 +851,22 @@ fn maybe_symlink_root_dir(dirs: &mut Dirs) {
Ok(_) => remove_dir_all(symlink).expect("remove_dir_all failed"),
Err(err) => {
println!("symlink.canonicalize failed: {:?}", err);
let _ = remove_dir_all(symlink);
// we're having very strange issues on GHA when the cache
// is restored, so trying this out temporarily
if let Err(err) = remove_dir_all(symlink) {
eprintln!("remove_dir_all failed: {:?}", err);
if let Err(err) = remove_file(symlink) {
eprintln!("remove_file failed: {:?}", err);
}
}
match symlink_dir(target, symlink) {
Ok(_) => break,
Err(err) => {
println!("symlink_dir failed: {:?}", err);
retries += 1;
std::thread::sleep(std::time::Duration::from_millis(100));
std::thread::sleep(std::time::Duration::from_millis(
50 * retries,
));
if retries > 4 {
panic!("Failed to create symlink");
}