void-packages/srcpkgs/rust/patches/0006-fix-rustdoc-when-cross...

46 lines
1.5 KiB
Diff

From 50075907c3dd2f06d471b3375d7c0ee850263eb2 Mon Sep 17 00:00:00 2001
From: Daniel Kolesa <daniel@octaforge.org>
Date: Mon, 20 Dec 2021 01:48:14 +0100
Subject: [PATCH 06/15] fix rustdoc when cross-compiling
diff --git a/src/bootstrap/src/bin/rustdoc.rs b/src/bootstrap/src/bin/rustdoc.rs
index dbbce6fe2..86365e330 100644
--- a/src/bootstrap/src/bin/rustdoc.rs
+++ b/src/bootstrap/src/bin/rustdoc.rs
@@ -7,6 +7,7 @@ use std::ffi::OsString;
use std::path::PathBuf;
use std::process::Command;
+#[allow(unused)]
use dylib_util::{dylib_path, dylib_path_var};
#[path = "../utils/bin_helpers.rs"]
@@ -29,9 +30,6 @@ fn main() {
// is passed (a bit janky...)
let target = args.windows(2).find(|w| &*w[0] == "--target").and_then(|w| w[1].to_str());
- let mut dylib_path = dylib_path();
- dylib_path.insert(0, PathBuf::from(libdir.clone()));
-
let mut cmd = Command::new(rustdoc);
if target.is_some() {
@@ -44,7 +42,7 @@ fn main() {
}
cmd.args(&args);
- cmd.env(dylib_path_var(), env::join_paths(&dylib_path).unwrap());
+ cmd.env(dylib_path_var(), PathBuf::from(libdir.clone()));
// Force all crates compiled by this compiler to (a) be unstable and (b)
// allow the `rustc_private` feature to link to other unstable crates
@@ -78,7 +76,7 @@ fn main() {
eprintln!(
"rustdoc command: {:?}={:?} {:?}",
dylib_path_var(),
- env::join_paths(&dylib_path).unwrap(),
+ PathBuf::from(libdir.clone()),
cmd,
);
eprintln!("sysroot: {sysroot:?}");