[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DG8VP6BH1MPV.13AHBBEMZHOF4@garyguo.net>
Date: Sat, 07 Feb 2026 16:43:11 +0000
From: "Gary Guo" <gary@...yguo.net>
To: "Miguel Ojeda" <miguel.ojeda.sandonis@...il.com>, "Gary Guo"
<gary@...yguo.net>, "Nathan Chancellor" <nathan@...nel.org>, "Nicolas
Schier" <nsc@...nel.org>
Cc: "Miguel Ojeda" <ojeda@...nel.org>, "Boqun Feng" <boqun@...nel.org>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>, "Benno Lossin"
<lossin@...nel.org>, "Andreas Hindborg" <a.hindborg@...nel.org>, "Alice
Ryhl" <aliceryhl@...gle.com>, "Trevor Gross" <tmgross@...ch.edu>, "Danilo
Krummrich" <dakr@...nel.org>, "Janne Grunau" <j@...nau.net>, "Asahi Lina"
<lina+kernel@...hilina.net>, <rust-for-linux@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <linux-kbuild@...r.kernel.org>
Subject: Re: [PATCH] rust: build: remap path to avoid absolute path
On Sat Feb 7, 2026 at 3:22 PM GMT, Miguel Ojeda wrote:
> On Sat, Feb 7, 2026 at 3:44 PM Gary Guo <gary@...nel.org> wrote:
>>
>> So, fix this by remap all absolute paths to srctree to relative path
>> instead.
>
> In case it matters to Kbuild, we had a relatively recent revert
> related to this flag:
>
> dbdffaf50ff9 ("kbuild, rust: use -fremap-path-prefix to make paths relative")
> 8cf5b3f83614 ("Revert "kbuild, rust: use -fremap-path-prefix to make
> paths relative"")
>
> https://lore.kernel.org/rust-for-linux/20250511-kbuild-revert-file-prefix-map-v1-0-9ba640c8411e@weissschuh.net/
Ah, that explains why I recall we had this flag in Kbuild but can only find the
filter-out directives now. I missed the revert email.
I am not convinced that the ability to launch debugger outside source
directory overweights the benefit of not leaking absolute paths and making
builds reproducible.
The reverting cover letter says "As there is no simple or uniform way to
specify the source directory explicitly" which is clearly not the case as you
can just invoke the debugger in a different working directory... GDB also
provides a way to provide source directory search path:
https://sourceware.org/gdb/current/onlinedocs/gdb.html/Source-Path.html.
Similarly, LLDB provides `settings set target.source-map`:
https://lldb.llvm.org/use/map.html#remap-source-file-pathnames-for-the-debug-session
I think we should revert the revert, then.
Best,
Gary
>
> From what I see in the thread (but I didn't get a confirmation back
> then), the issue was some developers relying on invoking the debugger
> in a different working directory than the `srctree`.
>
> Thanks Gary!
>
> Cheers,
> Miguel
Powered by blists - more mailing lists