From 9dd1da7475146cdc8937038b9341e8e19bcf5278 Mon Sep 17 00:00:00 2001 From: K900 Date: Mon, 18 Nov 2024 11:29:08 +0300 Subject: [PATCH] linuxManualConfig: don't leak rust-lib-src paths into the final binary --- pkgs/os-specific/linux/kernel/manual-config.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix index f69de86fd1a6..522eb4608764 100644 --- a/pkgs/os-specific/linux/kernel/manual-config.nix +++ b/pkgs/os-specific/linux/kernel/manual-config.nix @@ -164,6 +164,10 @@ let RUST_LIB_SRC = lib.optionalString withRust rustPlatform.rustLibSrc; + # avoid leaking Rust source file names into the final binary, which adds + # a false dependency on rust-lib-src on targets with uncompressed kernels + KRUSTFLAGS = lib.optionalString withRust "--remap-path-prefix ${rustPlatform.rustLibSrc}=/"; + patches = map (p: p.patch) kernelPatches # Required for deterministic builds along with some postPatch magic.