Skip to content

Commit 12828f7

Browse files
committed
Create tracing directory symlink even during dry run
1 parent f9a4588 commit 12828f7

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/bootstrap/src/bin/main.rs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77
88
use std::fs::{self, OpenOptions};
99
use std::io::{self, BufRead, BufReader, IsTerminal, Write};
10+
use std::path::Path;
1011
use std::str::FromStr;
1112
use std::time::Instant;
1213
use std::{env, process};
1314

1415
use bootstrap::{
1516
Build, CONFIG_CHANGE_HISTORY, ChangeId, Config, Flags, Subcommand, debug,
16-
find_recent_config_change_ids, human_readable_changes, symlink_dir, t,
17+
find_recent_config_change_ids, human_readable_changes, t,
1718
};
1819

1920
fn is_tracing_enabled() -> bool {
@@ -114,7 +115,18 @@ fn main() {
114115
#[cfg(not(windows))]
115116
let _ = std::fs::remove_file(&latest_trace_dir);
116117

117-
t!(symlink_dir(&config, &tracing_dir, &latest_trace_dir));
118+
#[cfg(not(windows))]
119+
fn symlink_dir_inner(original: &Path, link: &Path) -> io::Result<()> {
120+
use std::os::unix::fs;
121+
fs::symlink(original, link)
122+
}
123+
124+
#[cfg(windows)]
125+
fn symlink_dir_inner(target: &Path, junction: &Path) -> io::Result<()> {
126+
junction::create(target, junction)
127+
}
128+
129+
t!(symlink_dir_inner(&tracing_dir, &latest_trace_dir));
118130
}
119131

120132
debug!("creating new build based on config");

0 commit comments

Comments
 (0)