[pacman-dev] [PATCH] makepkg: add rust support for *FLAGS and debug-prefix-map
The rust language supports $RUSTFLAGS to be used automatically in all
rustc invocations. Allow setting this in makepkg.conf (e.g. for
optimization or debuginfo support), and teach debug+strip to pass the
rustc command line argument necessary to rewrite source file paths in
the debugging symbols.
Signed-off-by: Eli Schwartz
On 4/7/19 7:40 am, Eli Schwartz wrote:
The rust language supports $RUSTFLAGS to be used automatically in all rustc invocations. Allow setting this in makepkg.conf (e.g. for optimization or debuginfo support), and teach debug+strip to pass the rustc command line argument necessary to rewrite source file paths in the debugging symbols.
I'm happy to include this. But it brings me back to the concern of an ever expanding makepkg.conf (no longer just compression variables!). What about adding a system like: /etc/makepkg.conf /etc/makepkg.conf.d/rust Still need to plug the logic to use them in, but should be possible with libmakepkg...
diff --git a/scripts/libmakepkg/buildenv/buildflags.sh.in b/scripts/libmakepkg/buildenv/buildflags.sh.in index daccc9cc..871d0d69 100644 --- a/scripts/libmakepkg/buildenv/buildflags.sh.in +++ b/scripts/libmakepkg/buildenv/buildflags.sh.in @@ -30,6 +30,6 @@ buildenv_functions+=('buildenv_buildflags')
buildenv_buildflags() { if check_option "buildflags" "n"; then - unset CPPFLAGS CFLAGS DEBUG_CFLAGS CXXFLAGS DEBUG_CXXFLAGS LDFLAGS + unset CPPFLAGS CFLAGS DEBUG_CFLAGS CXXFLAGS DEBUG_CXXFLAGS LDFLAGS RUSTFLAGS
DEBUG_RUSTFLAGS
fi }
The rust language supports $RUSTFLAGS to be used automatically in all
rustc invocations. Allow setting this in makepkg.conf (e.g. for
optimization or debuginfo support), and teach debug+strip to pass the
rustc command line argument necessary to rewrite source file paths in
the debugging symbols.
Signed-off-by: Eli Schwartz
On Mon, Aug 12, 2019 at 12:07:59AM -0400, Eli Schwartz wrote:
index ce9c1556..19c96700 100644 --- a/scripts/libmakepkg/buildenv/debugflags.sh.in +++ b/scripts/libmakepkg/buildenv/debugflags.sh.in @@ -32,7 +32,9 @@ buildenv_debugflags() { if check_option "debug" "y"; then DEBUG_CFLAGS+=" -fdebug-prefix-map=$srcdir=${DBGSRCDIR:-/usr/src/debug}" DEBUG_CXXFLAGS+=" -fdebug-prefix-map=$srcdir=${DBGSRCDIR:-/usr/src/debug}" + DEBUG_RUSTFLAGS+=" --remap-path-prefix=$srdir=${DBGSRCDIR:-/usr/src/debug}"
$srdir should be $srcdir -- Morten Linderud PGP: 9C02FF419FECBE16
The rust language supports $RUSTFLAGS to be used automatically in all
rustc invocations. Allow setting this in makepkg.conf (e.g. for
optimization or debuginfo support), and teach debug+strip to pass the
rustc command line argument necessary to rewrite source file paths in
the debugging symbols.
Signed-off-by: Eli Schwartz
On 7/10/19 11:33 am, Eli Schwartz wrote:
The rust language supports $RUSTFLAGS to be used automatically in all rustc invocations. Allow setting this in makepkg.conf (e.g. for optimization or debuginfo support), and teach debug+strip to pass the rustc command line argument necessary to rewrite source file paths in the debugging symbols.
Signed-off-by: Eli Schwartz
--- v3: fix typo, srdir -> srcdir
Ack - with my comment remaining that makepkg.conf is getting to long and we should investigate something like including /etc/makepkg.conf.d/rustflags in the future. This serves as notice that future additions may be delayed until this is implemented... Allan
participants (3)
-
Allan McRae
-
Eli Schwartz
-
Morten Linderud