aantron / bisect_ppx

Code coverage for OCaml and ReScript
http://aantron.github.io/bisect_ppx/demo/
MIT License
302 stars 60 forks source link

static library name scheme issue #439

Closed yuzibo closed 6 months ago

yuzibo commented 6 months ago

When I was trying to package on Debian, I got one warning like:

I: libbisect-ppx-ocaml-dev: unstripped-static-library (bisect__Runtime.o) [usr/lib/ocaml/bisect_ppx/runtime/bisect.a]
I: libbisect-ppx-ocaml-dev: unstripped-static-library (bisect_common.o) [usr/lib/ocaml/bisect_ppx/common/bisect_common.a]
I: libbisect-ppx-ocaml-dev: unstripped-static-library (bisect_ppx__Exclude.o bisect_ppx__Exclude_lexer.o bisect_ppx__Exclude_parser.o bisect_ppx
__Exclusions.o bisect_ppx__Instrument.o bisect_ppx__Register.o) [usr/lib/ocaml/bisect_ppx/bisect_ppx.a]

Background:

N:
I: unstripped-static-library
N:
N:   The package installs an unstripped static library.
N:
N:   Please note, that static libraries have to be stripped with the --strip-debug option. You will probably also want to use
N:   --remove-section=.comment --remove-section=.note to avoid the static-library-has-unneeded-section tag.
N:
N:   dh_strip (after debhelper/9.20150811) will do this automatically for you.
N:
N:   Visibility: info
N:   Show-Always: no
N:   Check: libraries/static

In Debian, there is one helper scripts called dh_strip to strip some unnecessary options in the library(static and dynamic), but there is some gap for use in practice, there is the code:

if ($fn =~ m/\/lib[^\/]*\.a$/ && $fn !~ m/.*_g\.a$/) {
        # Is it a binary file, or something else (maybe a linker
        # script on Hurd, for example? I don't use file, because
        # file returns a variety of things on static libraries.
        if (-B $fn) {
            push @static_libs, $fn;
            return;
        }
    }

So we can see, why the warning info was generated. The tool will look for a static library with lib- prefix, like libstatic-library.a and so I'm in the middle of a dilemma.

My sponsor suggests me to fix the issue(include another one) and so I open the issue.

glondu commented 6 months ago

I don't think this is the right place to report this issue, as explained in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1068651#29

yuzibo commented 6 months ago

yeah, thanks, I will close the issue.