From: "Gary Guo" <gary@garyguo.net>
To: "Miguel Ojeda" <miguel.ojeda.sandonis@gmail.com>,
"Gary Guo" <gary@garyguo.net>,
"Nathan Chancellor" <nathan@kernel.org>,
"Nicolas Schier" <nsc@kernel.org>
Cc: "Miguel Ojeda" <ojeda@kernel.org>,
"Boqun Feng" <boqun@kernel.org>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <lossin@kernel.org>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Alice Ryhl" <aliceryhl@google.com>,
"Trevor Gross" <tmgross@umich.edu>,
"Danilo Krummrich" <dakr@kernel.org>,
"Janne Grunau" <j@jannau.net>,
"Asahi Lina" <lina+kernel@asahilina.net>,
rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-kbuild@vger.kernel.org
Subject: Re: [PATCH] rust: build: remap path to avoid absolute path
Date: Sat, 07 Feb 2026 16:43:11 +0000 [thread overview]
Message-ID: <DG8VP6BH1MPV.13AHBBEMZHOF4@garyguo.net> (raw)
In-Reply-To: <CANiq72mhhSKV=CecnZnqhKrt9tpGdMu1hePJtGDgRiD4JG902A@mail.gmail.com>
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@kernel.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
next prev parent reply other threads:[~2026-02-07 16:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-07 14:43 [PATCH] rust: build: remap path to avoid absolute path Gary Guo
2026-02-07 15:22 ` Miguel Ojeda
2026-02-07 16:43 ` Gary Guo [this message]
2026-02-07 22:05 ` Nathan Chancellor
2026-02-07 22:59 ` Gary Guo
2026-02-08 11:03 ` Miguel Ojeda
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DG8VP6BH1MPV.13AHBBEMZHOF4@garyguo.net \
--to=gary@garyguo.net \
--cc=a.hindborg@kernel.org \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@kernel.org \
--cc=dakr@kernel.org \
--cc=j@jannau.net \
--cc=lina+kernel@asahilina.net \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=miguel.ojeda.sandonis@gmail.com \
--cc=nathan@kernel.org \
--cc=nsc@kernel.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=tmgross@umich.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox