mirror of
https://github.com/openbsd/ports.git
synced 2026-06-18 07:24:23 +02:00
b148bebbf0
Unbreaks build after the mdbook update
40 lines
1.7 KiB
Plaintext
40 lines
1.7 KiB
Plaintext
Don't use rustup.
|
|
|
|
Index: xtask/src/codegen.rs
|
|
--- xtask/src/codegen.rs.orig
|
|
+++ xtask/src/codegen.rs
|
|
@@ -130,27 +130,19 @@ impl fmt::Display for Location {
|
|
fn reformat(text: String) -> String {
|
|
let sh = Shell::new().unwrap();
|
|
let rustfmt_toml = project_root().join("rustfmt.toml");
|
|
- let version = cmd!(sh, "rustup run stable rustfmt --version").read().unwrap_or_default();
|
|
+ let version = cmd!(sh, "rustfmt --version").read().unwrap_or_default();
|
|
|
|
// First try explicitly requesting the stable channel via rustup in case nightly is being used by default,
|
|
// then plain rustfmt in case rustup isn't being used to manage the compiler (e.g. when using Nix).
|
|
let mut stdout = if !version.contains("stable") {
|
|
- let version = cmd!(sh, "rustfmt --version").read().unwrap_or_default();
|
|
- if !version.contains("stable") {
|
|
- panic!(
|
|
- "Failed to run rustfmt from toolchain 'stable'. \
|
|
- Please run `rustup component add rustfmt --toolchain stable` to install it.",
|
|
- );
|
|
- } else {
|
|
- cmd!(sh, "rustfmt --config-path {rustfmt_toml} --config fn_single_line=true")
|
|
- .stdin(text)
|
|
- .read()
|
|
- .unwrap()
|
|
- }
|
|
+ cmd!(sh, "rustfmt --config-path {rustfmt_toml} --config fn_single_line=true")
|
|
+ .stdin(text)
|
|
+ .read()
|
|
+ .unwrap()
|
|
} else {
|
|
cmd!(
|
|
sh,
|
|
- "rustup run stable rustfmt --config-path {rustfmt_toml} --config fn_single_line=true"
|
|
+ "rustfmt --config-path {rustfmt_toml} --config fn_single_line=true"
|
|
)
|
|
.stdin(text)
|
|
.read()
|