Short update, On 06/10/2022 13:42, Jelle van der Waa wrote:
On 05/10/2022 16:28, Morten Linderud wrote:
Yo!
With the release of pacman 6.0.2 we have now support for debug packages through `debugedit` as opposed to the awk hack used previously.
https://gitlab.archlinux.org/pacman/pacman/-/commit/ae2f506ddfd1
<SNIP>
I removed my testing chroot in /var/lib/archbuild and rebuild arch-rebuild-order. TL;DR it does not seem to work for me.
Checking arch-rebuild-order-debug-0.3.1-1-x86_64.pkg.tar.zst arch-rebuild-order-debug W: ELF file ('usr/lib/debug/usr/bin/arch-rebuild-order.debug') is unstripped. arch-rebuild-order-debug W: Directory (usr/src/debug) is empty arch-rebuild-order-debug E: Missing custom license directory (usr/share/licenses/arch-rebuild-order-debug) arch-rebuild-order-debug E: Symlink (usr/lib/debug/.build-id/0c/043fb6cf6cc61237c605819d0075e240415306) points to non-existing ../../../../bin/arch-rebuild-order
Turns out that one can check this easier in gdb: Reading symbols from arch-rebuild-order... Reading symbols from /usr/lib/debug/usr/bin/arch-rebuild-order.debug... (gdb) list Dwarf Error: Cannot find DIE at 0x1dd49 referenced from DIE at 0x61e94 [in module /usr/lib/debug/usr/bin/arch-rebuild-order.debug] (gdb) info functions Dwarf Error: Cannot find DIE at 0x1dd49 referenced from DIE at 0x61e94 [in module /usr/lib/debug/usr/bin/arch-rebuild-order.debug] So woops! Something is borked... removing --release is not the solution :-) Note that debug symbols seem to work for rg in Fedora, and this is how they build with cargo: [jelle@toolbox][~]%rpm --eval "%cargo_build" /usr/bin/env CARGO_HOME=.cargo RUSTC_BOOTSTRAP=1 RUSTFLAGS='-Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Clink-arg=-Wl,-z,relro -Clink-arg=-Wl,-z,now -Clink-arg=-Wl,-dT,/home/jelle/rpmbuild/BUILD/.package_note-%{name}-%{version}-%{release}.x86_64.ld --cap-lints=warn' /usr/bin/cargo build -j8 -Z avoid-dev-deps --release Our RUSTFLAGS should be fine in this regard. Running makepkg, going into src/arch-rebuild-order [jelle@t14s][/tmp/arch-rebuild-order/trunk/src/arch-rebuild-order]%debugedit --list-file /dev/stdout target/debug/arch-rebuild-order | tr '\0' '\n' | less /rustc/1.64.0/library/alloc/src/raw_vec.rs /rustc/1.64.0/library/alloc/src/vec/mod.rs /usr/src/debug/arch-rebuild-order/arch-rebuild-order/src/main.rs /home/jelle/.cargo/registry/src/github.com-1ecc6299db9ec823/structopt-0.3.26/src/lib.rs So this seems good, except the cargo dependencies. Fedora might specify CARGO_HOME for that reason? Ok success, after these changes! The LTO issue seems to be known [1] Index: PKGBUILD =================================================================== --- PKGBUILD (revision 457306) +++ PKGBUILD (working copy) @@ -10,24 +10,26 @@ depends=('glibc' 'libalpm.so') makedepends=('cargo' 'mandown' 'git') groups=('archlinux-tools') -options=('debug') -source=(git+https://gitlab.archlinux.org/archlinux/arch-rebuild-order.git#tag=v$pkgver?s...) -sha512sums=('SKIP') +options=('debug' 'strip' '!lto') +source=(git+https://gitlab.archlinux.org/archlinux/arch-rebuild-order.git#tag=v$pkgver?s... cargo.patch) +sha512sums=('SKIP' + '63b6a57699b4f0db4e8e5a763b5e9baac949567d1fde04914591249d9cd5faf764e9be470fd2b0b8b9aadebc5464b4d7e59bae1e6a46bf7cad9b552a9a96c829') validpgpkeys=("E499C79F53C96A54E572FEE1C06086337C50773E") prepare() { cd ${pkgname} + patch -Np1 -i ${srcdir}/cargo.patch cargo fetch --locked --target "$CARCH-unknown-linux-gnu" } build() { cd ${pkgname} - cargo build --frozen --release --all-features + cargo build --frozen --all-features } check() { cd ${pkgname} - cargo test --frozen --all-features + # cargo test --frozen --all-features } package() { For debugging use: rust-gdb --args arch-rebuild-order opencolorio (gdb) b arch_rebuild_order::find_package_anywhere Breakpoint 2 at 0x14e31: file src/lib.rs, line 19. Breakpoint 1, arch_rebuild_order::main () at src/main.rs:6 6 src/main.rs: No such file or directory. (gdb) So, the source code cannot be found while it is available: tar tvf arch-rebuild-order-debug-0.3.1-1-x86_64.pkg.tar.zst drwxr-xr-x root/root 0 2022-10-07 13:24 usr/src/ drwxr-xr-x root/root 0 2022-10-07 13:24 usr/src/debug/ drwxr-xr-x root/root 0 2022-10-07 13:24 usr/src/debug/arch-rebuild-order/ drwxr-xr-x root/root 0 2022-10-07 13:24 usr/src/debug/arch-rebuild-order/src/ -rw-r--r-- root/root 757 2022-10-07 13:24 usr/src/debug/arch-rebuild-order/src/args.rs -rw-r--r-- root/root 516 2022-10-07 13:24 usr/src/debug/arch-rebuild-order/src/error.rs -rw-r--r-- root/root 6017 2022-10-07 13:24 usr/src/debug/arch-rebuild-order/src/lib.rs -rw-r--r-- root/root 572 2022-10-07 13:24 usr/src/debug/arch-rebuild-order/src/main.rs This all needs some further debugging :) [1] https://github.com/rust-lang/rust/issues/41775