Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run-make: Remove cygpath #128611

Merged
merged 1 commit into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/tools/run-make-support/src/external_deps/c_build.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use std::path::PathBuf;

use super::cygpath::get_windows_path;
use crate::artifact_names::{dynamic_lib_name, static_lib_name};
use crate::external_deps::cc::{cc, cxx};
use crate::external_deps::llvm::llvm_ar;
Expand Down Expand Up @@ -44,8 +43,7 @@ pub fn build_native_dynamic_lib(lib_name: &str) -> PathBuf {
};
let obj_file = if is_msvc() { format!("{lib_name}.obj") } else { format!("{lib_name}.o") };
if is_msvc() {
let mut out_arg = "-out:".to_owned();
out_arg.push_str(&get_windows_path(&lib_path));
let out_arg = format!("-out:{lib_path}");
cc().input(&obj_file).args(&["-link", "-dll", &out_arg]).run();
} else if is_darwin() {
cc().out_exe(&lib_path).input(&obj_file).args(&["-dynamiclib", "-Wl,-dylib"]).run();
Expand Down
10 changes: 4 additions & 6 deletions src/tools/run-make-support/src/external_deps/cc.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use std::path::Path;

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

Expand Down Expand Up @@ -97,12 +95,12 @@ impl Cc {

if is_msvc() {
path.set_extension("exe");
let fe_path = get_windows_path(&path);
let fe_path = path.clone();
path.set_extension("");
path.set_extension("obj");
let fo_path = get_windows_path(path);
self.cmd.arg(format!("-Fe:{fe_path}"));
self.cmd.arg(format!("-Fo:{fo_path}"));
let fo_path = path;
self.cmd.arg(format!("-Fe:{}", fe_path.to_str().unwrap()));
self.cmd.arg(format!("-Fo:{}", fo_path.to_str().unwrap()));
} else {
self.cmd.arg("-o");
self.cmd.arg(name);
Expand Down
35 changes: 0 additions & 35 deletions src/tools/run-make-support/src/external_deps/cygpath.rs

This file was deleted.

3 changes: 0 additions & 3 deletions src/tools/run-make-support/src/external_deps/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,3 @@ pub mod llvm;
pub mod python;
pub mod rustc;
pub mod rustdoc;

// Library-internal external dependency.
mod cygpath;
Loading