0
0
Fork 0
mirror of https://github.com/denoland/rusty_v8.git synced 2024-11-21 15:04:33 -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]] [[package]]
name = "v8" name = "v8"
version = "0.98.0" version = "0.98.1"
dependencies = [ dependencies = [
"align-data", "align-data",
"bindgen", "bindgen",

View file

@ -1,6 +1,6 @@
[package] [package]
name = "v8" name = "v8"
version = "0.98.0" version = "0.98.1"
description = "Rust bindings to V8" description = "Rust bindings to V8"
readme = "README.md" readme = "README.md"
authors = ["the Deno authors"] 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 // symlink called 'gn_root' in the out directory, next to 'gn_out', so it
// appears as if they're both on the same drive. // appears as if they're both on the same drive.
use std::fs::remove_dir_all; use std::fs::remove_dir_all;
use std::fs::remove_file;
use std::os::windows::fs::symlink_dir; use std::os::windows::fs::symlink_dir;
let get_prefix = |p: &Path| { 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"), Ok(_) => remove_dir_all(symlink).expect("remove_dir_all failed"),
Err(err) => { Err(err) => {
println!("symlink.canonicalize failed: {:?}", 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) { match symlink_dir(target, symlink) {
Ok(_) => break, Ok(_) => break,
Err(err) => { Err(err) => {
println!("symlink_dir failed: {:?}", err); println!("symlink_dir failed: {:?}", err);
retries += 1; retries += 1;
std::thread::sleep(std::time::Duration::from_millis(100)); std::thread::sleep(std::time::Duration::from_millis(
50 * retries,
));
if retries > 4 { if retries > 4 {
panic!("Failed to create symlink"); panic!("Failed to create symlink");
} }