Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix not passing tests
  • Loading branch information
yaahc committed Mar 30, 2019
commit d2ab686f3d161d8545f7d7b53144d9cdc3f27eb3
10 changes: 5 additions & 5 deletions src/cargo/core/compiler/build_context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ impl<'a, 'cfg> BuildContext<'a, 'cfg> {
}
})?;
rustc.push_wrapper(RustcWrapper::new(tool));
} else if build_config.cargo_as_rustc_wrapper {
let mut wrapper = RustcWrapper::new(env::current_exe()?);
let prog = rustc.path.as_os_str().to_owned();
wrapper.env("RUSTC", prog);
rustc.push_wrapper(wrapper);
// } else if build_config.cargo_as_rustc_wrapper {
// let mut wrapper = RustcWrapper::new(env::current_exe()?);
// let prog = dbg!(rustc.path.as_os_str().to_owned());
// wrapper.env("RUSTC", prog);
// rustc.push_wrapper(wrapper);
}

let host_config = TargetConfig::new(config, &rustc.host)?;
Expand Down
15 changes: 14 additions & 1 deletion src/cargo/core/compiler/compilation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,20 @@ pub struct Compilation<'cfg> {

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

if bcx.config.extra_verbose() {
rustc.display_env_vars();
Expand Down
2 changes: 1 addition & 1 deletion src/cargo/util/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ impl Config {
.join(".rustc_info.json")
.into_path_unlocked()
});
let wrapper = self.maybe_get_tool("rustc-wrapper")?;
let wrapper = self.maybe_get_tool("rustc_wrapper")?;
Rustc::new(
self.get_tool("rustc")?,
wrapper,
Expand Down