From: Nathan Chancellor <nathan@kernel.org>
To: Gary Guo <gary@garyguo.net>
Cc: "Miguel Ojeda" <miguel.ojeda.sandonis@gmail.com>,
"Nicolas Schier" <nsc@kernel.org>,
"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, 7 Feb 2026 16:05:43 -0600 [thread overview]
Message-ID: <20260207220543.GA1670883@ax162> (raw)
In-Reply-To: <DG8VP6BH1MPV.13AHBBEMZHOF4@garyguo.net>
On Sat, Feb 07, 2026 at 04:43:11PM +0000, Gary Guo wrote:
> 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.
For what it's worth, the C side revert also mentions that it broke
'objdump -S' [1] and working with GCOV data [2], so it seems like it is
not just debuggers that have a hard time with that loss of information.
Maybe those do not matter for Rust code or developers though.
[1] https://lore.kernel.org/aBEttQH4kimHFScx@intel.com/
[2] https://lore.kernel.org/edc50aa7-0740-4942-8c15-96f12f2acc7e@kernel.org/
Cheers,
Nathan
next prev parent reply other threads:[~2026-02-07 22:05 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
2026-02-07 22:05 ` Nathan Chancellor [this message]
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=20260207220543.GA1670883@ax162 \
--to=nathan@kernel.org \
--cc=a.hindborg@kernel.org \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@kernel.org \
--cc=dakr@kernel.org \
--cc=gary@garyguo.net \
--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=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