haampie / libtree

ldd as a tree
MIT License
2.63k stars 60 forks source link

In tests where libtree is expected to fail the tests fail for real #65

Closed artyom-poptsov closed 2 years ago

artyom-poptsov commented 2 years ago

Hello!

I'm trying to package libtree for GNU Guix and there's a problem with the tests.

In some tests libtree is expected to fail (and that's fine) but the failure brings down the whole build as a non-zero exit status returned to the operating system.

I tried to call libtree on the test auto-generated program called exe after the fail and it failed indeed with the code 28 as you can see:

$ libtree /tmp/guix-build-libtree-3.0.1.drv-0/source/tests/07_origin_is_relative_to_symlink_location_not_realpath/exe 
exe 
└── libg.so [runpath]
    └── libf.so not found
        ┊ Paths considered in this order:
        ┊ 1. rpath is skipped because runpath was set
        ┊ 2. LD_LIBRARY_PATH was not set
        ┊ 3. runpath:
        ┊    /tmp/guix-build-libtree-3.0.1.drv-0/source/tests/07_origin_is_relative_to_symlink_location_not_realpath/b
        ┊ 4. ld config files:
        ┊    /usr/lib/x86_64-linux-gnu/libfakeroot
        ┊    /usr/local/lib
        ┊    /usr/local/lib/x86_64-linux-gnu
        ┊    /lib/x86_64-linux-gnu
        ┊    /usr/lib/x86_64-linux-gnu
        ┊    /lib32
        ┊    /usr/lib32
        ┊ 5. Standard paths:
        ┊    /lib
        ┊    /lib64
        ┊    /usr/lib
        ┊    /usr/lib64
Error [/tmp/guix-build-libtree-3.0.1.drv-0/source/tests/07_origin_is_relative_to_symlink_location_not_realpath/exe]: Not all dependencies were found
$ echo $?
28

Please re-write the tests in such way that tests with expected failures will return zero status to the OS.

Thanks!

haampie commented 2 years ago

You're right, I haven't had time to improve the tests yet.

Also I think in guix you need #61, right? Or does guix only have one system glibc?

haampie commented 2 years ago

Fixed in 3.0.2

artyom-poptsov commented 2 years ago

Hello,

FWIW, my patch that adds libtree to GNU Guix package manager is finaly accepted: https://git.savannah.gnu.org/cgit/guix.git/commit/?id=fcebc4aa12300544a2d62eab5ed06d1cb9eeed43

Also: https://guix.gnu.org/en/packages/libtree-3.0.2/

Happy hacking, avp

haampie commented 2 years ago

Thanks a lot! When I have time I'll try to get #61 fixed so libtree is more usable on guix and nix