Skip to content

Commit f9d7e4c

Browse files
committed
Remove cygpath from run-make-support
1 parent 1f47624 commit f9d7e4c

File tree

4 files changed

+5
-47
lines changed

4 files changed

+5
-47
lines changed

src/tools/run-make-support/src/external_deps/c_build.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use std::path::PathBuf;
22

3-
use super::cygpath::get_windows_path;
43
use crate::artifact_names::{dynamic_lib_name, static_lib_name};
54
use crate::external_deps::cc::{cc, cxx};
65
use crate::external_deps::llvm::llvm_ar;
@@ -44,8 +43,7 @@ pub fn build_native_dynamic_lib(lib_name: &str) -> PathBuf {
4443
};
4544
let obj_file = if is_msvc() { format!("{lib_name}.obj") } else { format!("{lib_name}.o") };
4645
if is_msvc() {
47-
let mut out_arg = "-out:".to_owned();
48-
out_arg.push_str(&get_windows_path(&lib_path));
46+
let out_arg = format!("-out:{lib_path}");
4947
cc().input(&obj_file).args(&["-link", "-dll", &out_arg]).run();
5048
} else if is_darwin() {
5149
cc().out_exe(&lib_path).input(&obj_file).args(&["-dynamiclib", "-Wl,-dylib"]).run();

src/tools/run-make-support/src/external_deps/cc.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
use std::path::Path;
22

3-
// FIXME(jieyouxu): can we get rid of the `cygpath` external dependency?
4-
use super::cygpath::get_windows_path;
53
use crate::command::Command;
64
use crate::{env_var, is_msvc, is_windows, uname};
75

@@ -97,12 +95,12 @@ impl Cc {
9795

9896
if is_msvc() {
9997
path.set_extension("exe");
100-
let fe_path = get_windows_path(&path);
98+
let fe_path = path.clone();
10199
path.set_extension("");
102100
path.set_extension("obj");
103-
let fo_path = get_windows_path(path);
104-
self.cmd.arg(format!("-Fe:{fe_path}"));
105-
self.cmd.arg(format!("-Fo:{fo_path}"));
101+
let fo_path = path;
102+
self.cmd.arg(format!("-Fe:{}", fe_path.to_str().unwrap()));
103+
self.cmd.arg(format!("-Fo:{}", fo_path.to_str().unwrap()));
106104
} else {
107105
self.cmd.arg("-o");
108106
self.cmd.arg(name);

src/tools/run-make-support/src/external_deps/cygpath.rs

-35
This file was deleted.

src/tools/run-make-support/src/external_deps/mod.rs

-3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,3 @@ pub mod llvm;
99
pub mod python;
1010
pub mod rustc;
1111
pub mod rustdoc;
12-
13-
// Library-internal external dependency.
14-
mod cygpath;

0 commit comments

Comments
 (0)