Skip to content

Commit 6ca27ff

Browse files
committed
Make host_root return host.root(), not host.dest()
Also create host_dest function to let other callsites retain their old functionality
1 parent 358ee54 commit 6ca27ff

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

src/cargo/core/compiler/context/compilation_files.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,16 @@ impl<'a, 'cfg: 'a> CompilationFiles<'a, 'cfg> {
207207
}
208208
}
209209

210-
/// Returns the root of the build output tree for the host
211-
pub fn host_root(&self) -> &Path {
210+
/// Returns the final artifact path for the host (`/…/target/debug`)
211+
pub fn host_dest(&self) -> &Path {
212212
self.host.dest()
213213
}
214214

215+
/// Returns the root of the build output tree for the host (`/…/target`)
216+
pub fn host_root(&self) -> &Path {
217+
self.host.root()
218+
}
219+
215220
/// Returns the host `deps` directory path.
216221
pub fn host_deps(&self) -> &Path {
217222
self.host.deps()

src/cargo/core/compiler/custom_build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ fn build_work(cx: &mut Context<'_, '_>, unit: &Unit) -> CargoResult<Job> {
272272
let output_file = script_run_dir.join("output");
273273
let err_file = script_run_dir.join("stderr");
274274
let root_output_file = script_run_dir.join("root-output");
275-
let host_target_root = cx.files().host_root().to_path_buf();
275+
let host_target_root = cx.files().host_dest().to_path_buf();
276276
let all = (
277277
id,
278278
pkg_name.clone(),

src/cargo/core/compiler/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ fn rustc(cx: &mut Context<'_, '_>, unit: &Unit, exec: &Arc<dyn Executor>) -> Car
217217
exec.init(cx, unit);
218218
let exec = exec.clone();
219219

220-
let root_output = cx.files().host_root().to_path_buf();
220+
let root_output = cx.files().host_dest().to_path_buf();
221221
let target_dir = cx.bcx.ws.target_dir().into_path_unlocked();
222222
let pkg_root = unit.pkg.root().to_path_buf();
223223
let cwd = rustc

0 commit comments

Comments
 (0)