[pacman-dev] [PATCH 1/2] libmakepkg: always remap debug prefix

Morgan Adamiec morganamilo at archlinux.org
Thu Apr 22 21:32:56 UTC 2021



On 22/04/2021 22:18, Eli Schwartz wrote:
> On 4/22/21 4:57 PM, Morgan Adamiec wrote:
>> Rust emits some debugging info even in release mode. This info includes
>> the paths where the files were built. So you end up with
>> "WARNING: Package contains reference to $srcdir`".
> 
> The references are only included if you don't strip the package, I
> guess... I'm not even sure what the utility of options=(!debug !strip)
> is, because what people actually want, I think, is a tristate:
> 
> - no-debug-strip-it-if-its-there
> - debug
> - debug but strip it into detached symbols
> 
> This patch only affects:
> 
> - no-debug-but-keep-it-if-its-there
> 
> The general srcdir warning is really only there to suggest that the
> software might be buggy and trying to do something at runtime with a
> path that won't exist on other people's machines.
> 
> It's a false positive here (only with !strip though), but so is
> package.json in nodejs land.
> 
> Not sure what the solution is, maybe we could remap it to the empty
> string? Or just strip the package. :p

Even when stripped the binary still contains the filepaths. If you're
prefer to predix it with "" that works.

> 
>> Plus if you're not
>> building in a chroot then the package will contain your homedir and
>> hence username which can be a privacy issue.
> 
> 
> This is an invalid argument; the $srcdir is also stored in the
> .BUILDINFO file, by design, and therefore also contains the same string
> you're trying to redact here.
> 

Fair enough, I didn't think of that.


More information about the pacman-dev mailing list