Skip to content

Commit d2ab686

Browse files
committed
fix not passing tests
1 parent 116c053 commit d2ab686

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

src/cargo/core/compiler/build_context/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ impl<'a, 'cfg> BuildContext<'a, 'cfg> {
6969
}
7070
})?;
7171
rustc.push_wrapper(RustcWrapper::new(tool));
72-
} else if build_config.cargo_as_rustc_wrapper {
73-
let mut wrapper = RustcWrapper::new(env::current_exe()?);
74-
let prog = rustc.path.as_os_str().to_owned();
75-
wrapper.env("RUSTC", prog);
76-
rustc.push_wrapper(wrapper);
72+
// } else if build_config.cargo_as_rustc_wrapper {
73+
// let mut wrapper = RustcWrapper::new(env::current_exe()?);
74+
// let prog = dbg!(rustc.path.as_os_str().to_owned());
75+
// wrapper.env("RUSTC", prog);
76+
// rustc.push_wrapper(wrapper);
7777
}
7878

7979
let host_config = TargetConfig::new(config, &rustc.host)?;

src/cargo/core/compiler/compilation.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,20 @@ pub struct Compilation<'cfg> {
7575

7676
impl<'cfg> Compilation<'cfg> {
7777
pub fn new<'a>(bcx: &BuildContext<'a, 'cfg>) -> CargoResult<Compilation<'cfg>> {
78-
let mut rustc = bcx.rustc.process();
78+
// If we're using cargo as a rustc wrapper then we're in a situation
79+
// like `cargo fix`. For now just disregard the `RUSTC_WRAPPER` env var
80+
// (which is typically set to `sccache` for now). Eventually we'll
81+
// probably want to implement `RUSTC_WRAPPER` for `cargo fix`, but we'll
82+
// leave that open as a bug for now.
83+
let mut rustc = if bcx.build_config.cargo_as_rustc_wrapper {
84+
let mut rustc = bcx.rustc.process_no_wrapper();
85+
let prog = rustc.get_program().to_owned();
86+
rustc.env("RUSTC", prog);
87+
rustc.program(env::current_exe()?);
88+
rustc
89+
} else {
90+
bcx.rustc.process()
91+
};
7992

8093
if bcx.config.extra_verbose() {
8194
rustc.display_env_vars();

src/cargo/util/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ impl Config {
197197
.join(".rustc_info.json")
198198
.into_path_unlocked()
199199
});
200-
let wrapper = self.maybe_get_tool("rustc-wrapper")?;
200+
let wrapper = self.maybe_get_tool("rustc_wrapper")?;
201201
Rustc::new(
202202
self.get_tool("rustc")?,
203203
wrapper,

0 commit comments

Comments
 (0)