From 53640e67b7c607976dc21e43f1aa93d57fc8dc68 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Sun, 26 Oct 2025 16:32:42 +0100 Subject: [PATCH] Remove rustc_cfg dependency --- Cargo.lock | 30 ------------------------------ Cargo.toml | 1 - build.rs | 8 +++----- 3 files changed, 3 insertions(+), 36 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1b0aef1d11..12af5176c7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -132,7 +132,6 @@ dependencies = [ "redox-path", "redox_syscall", "rmm", - "rustc-cfg", "rustc-demangle", "sbi-rt", "slab", @@ -226,15 +225,6 @@ dependencies = [ name = "rmm" version = "0.1.0" -[[package]] -name = "rustc-cfg" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ddf7a5e441e8003a5a88aab97f1c6113043ddde252d789ef9dea3871b78633a" -dependencies = [ - "thiserror", -] - [[package]] name = "rustc-demangle" version = "0.1.26" @@ -341,26 +331,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "thiserror" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "toml" version = "0.8.23" diff --git a/Cargo.toml b/Cargo.toml index c71d8bc269..8add859dfb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,6 @@ edition = "2024" [build-dependencies] cc = "1.0" -rustc-cfg = "0.5" toml = "0.8" [dependencies] diff --git a/build.rs b/build.rs index 8b54c80583..f0906d844d 100644 --- a/build.rs +++ b/build.rs @@ -1,4 +1,3 @@ -use rustc_cfg::Cfg; use std::{env, path::Path, process::Command}; use toml::Table; @@ -53,10 +52,9 @@ fn main() { println!("cargo::rustc-check-cfg=cfg(dtb)"); let out_dir = env::var("OUT_DIR").unwrap(); - let cfg = Cfg::of(env::var("TARGET").unwrap().as_str()).unwrap(); - let arch_str = cfg.target_arch.as_str(); + let arch_str = env::var("CARGO_CFG_TARGET_ARCH").unwrap(); - match arch_str { + match &*arch_str { "aarch64" => { println!("cargo::rustc-cfg=dtb"); } @@ -96,5 +94,5 @@ fn main() { _ => (), } - let _ = parse_kconfig(arch_str); + let _ = parse_kconfig(&*arch_str); }