google / brunsli

Practical JPEG Repacker
MIT License
730 stars 51 forks source link

[openSUSE] W: shared-lib-calls-exit from RPMLINT #107

Closed kevinsmia1939 closed 4 years ago

kevinsmia1939 commented 4 years ago

Hello,

I am trying to package brunsli into openSUSE Tumbleweed Linux. While building the package, RPMLINT warning show up as shown below.

libbrunsli0.1.x86_64: W: shared-lib-calls-exit /usr/lib64/libbrunslienc-c.so exit@GLIBC_2.2.5
[   37s] This library package calls exit() or _exit(), probably in a non-fork()
[   37s] context. Doing so from a library is strongly discouraged - when a library
[   37s] function calls exit(), it prevents the calling program from handling the
[   37s] error, reporting it to the user, closing files properly, and cleaning up any
[   37s] state that the program has. It is preferred for the library to return an
[   37s] actual error code and let the calling program decide how to handle the
[   37s] situation.

I personally don't know what this meant, is it something to worry? Also, is it intended to not have share lib version? Full log here: https://build.opensuse.org/package/live_build_log/home:andythe_great/brunsli/openSUSE_Tumbleweed/x86_64

Thanks

eustas commented 4 years ago

Let me check. exit is, of course, should not be used in library...

eustas commented 4 years ago

Can't find exit in brunsli. However, it might be used by brotli memory manager. Try compiling with -DBROTLI_ENCODER_CLEANUP_ON_OOM flag.

kevinsmia1939 commented 4 years ago

Can't find exit in brunsli. However, it might be used by brotli memory manager. Try compiling with -DBROTLI_ENCODER_CLEANUP_ON_OOM flag.

Did you mean to use -DBROTLI_ENCODER_CLEANUP_ON_OOM flag on Brunsli? Because that flag is not found. If you mean adding flag to brotli, it is not install to compile brunsli.

eustas commented 4 years ago

Exactly. If you use CMake to build Brunsli, then it builds brotli as well... and flag will propagate there. Brotli is checked out to third_party/brotli directory

kevinsmia1939 commented 4 years ago

Exactly. If you use CMake to build Brunsli, then it builds brotli as well... and flag will propagate there. Brotli is checked out to third_party/brotli directory

I add the flag but it is not found.


CMake Error: Parse error in command line argument: -DBROTLI_ENCODER_CLEANUP_ON_OOM
Should be: VAR:type=value

 CMake Error: Problem processing arguments. Aborting.

I tried using cmake-gui to help list the flags, but did not found something similar to -DBROTLI at all. I also tried navigating into third_party/brotli directory and run cmake-gui from there and does not found relevant flag.

eustas commented 4 years ago

Oh, it is a C compiler, not Cmake flag. For CMake is will look like: -DCMAKE_C_FLAGS="-DBROTLI_ENCODER_CLEANUP_ON_OOM"

kevinsmia1939 commented 4 years ago

Oh, it is a C compiler, not Cmake flag. For CMake is will look like: -DCMAKE_C_FLAGS="-DBROTLI_ENCODER_CLEANUP_ON_OOM"

Thanks, that fix the issue.