Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 638284 - dev-java/snappy-1.1.0.1 fails to emerge: hard-coded ".so" extension and "invalid install_name found" error
Summary: dev-java/snappy-1.1.0.1 fails to emerge: hard-coded ".so" extension and "inva...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All OS X
: Normal normal (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-20 22:53 UTC by Anton
Modified: 2021-03-13 12:21 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,7.06 KB, application/octet-stream)
2017-11-20 22:54 UTC, Anton
Details
emerge --info '=dev-java/snappy-1.1.0.1::localrepo' (emerge-info.log,4.58 KB, text/plain)
2017-11-20 22:54 UTC, Anton
Details
emerge -pqv '=dev-java/snappy-1.1.0.1::localrepo' (emerge-pqv.log,69 bytes, text/plain)
2017-11-20 22:55 UTC, Anton
Details
snappy-1.1.0.1.ebuild with the .so extension changed to .jnilib (snappy-1.1.0.1.ebuild,1.44 KB, text/plain)
2017-11-20 22:56 UTC, Anton
Details
workaround snappy-1.1.0.1.ebuild (snappy-1.1.0.1.ebuild,1.64 KB, text/plain)
2017-11-20 23:52 UTC, Anton
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anton 2017-11-20 22:53:21 UTC
One of the files installed by dev-java/snappy is libsnappyjava dynamic library to be used through Java JNI. On a Linux it is "libsnappyjava.so", while on Mac it is "libsnappyjava.jnilib"

Line 56 of snappy-1.1.0.1.ebuild reads:
    java-pkg_doso "${S}"/target/libsnappyjava.so
This should be made system-specific to work on Mac (unfortunately using ${libname} would not work because the usual extension for dynamic libraries on a Mac is .dylib while this file, for some reason, is using extension.jnilib)

If that line is changed, however, I am still getting "invalid install_name" error related to the same library file.

Reproducible: Always

Steps to Reproduce:
1. emerge -1 =dev-java/snappy-1.1.0.1



Note: my version of Java is the one which came with the Mac, not installed through Gentoo repositories.
Comment 1 Anton 2017-11-20 22:54:02 UTC
Created attachment 505242 [details]
build.log
Comment 2 Anton 2017-11-20 22:54:33 UTC
Created attachment 505244 [details]
emerge --info '=dev-java/snappy-1.1.0.1::localrepo'
Comment 3 Anton 2017-11-20 22:55:18 UTC
Created attachment 505246 [details]
emerge -pqv '=dev-java/snappy-1.1.0.1::localrepo'
Comment 4 Anton 2017-11-20 22:56:44 UTC
Created attachment 505248 [details]
snappy-1.1.0.1.ebuild with the .so extension changed to .jnilib
Comment 5 Anton 2017-11-20 23:52:19 UTC
Created attachment 505250 [details]
workaround snappy-1.1.0.1.ebuild

Here is a work-around: it checks for $CNAME to be *-darwin* and if so, runs install_name_tool and java-pkg_doso for libsnappyjava.jnilib; otherwise the old code is run.

Based on/inspired by the patch #474902 for bug #620328 by Shunsuke Shimizu <grafi@grafi.jp>
Comment 6 Fabian Groffen gentoo-dev 2021-01-07 19:49:44 UTC
@java: to handle these kinds of things, this would require some function like get_libname (get_javalibname ?) that would encode the logic as laid out in the initial bit of this bug, in short, .jnilib on *-darwin* hosts, .dll on windows hosts, and .so on the rest.   Would you accept a patch on the sort of this?
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-03-09 17:38:33 UTC
(In reply to Fabian Groffen from comment #6)
> @java: to handle these kinds of things, this would require some function
> like get_libname (get_javalibname ?) that would encode the logic as laid out
> in the initial bit of this bug, in short, .jnilib on *-darwin* hosts, .dll
> on windows hosts, and .so on the rest.   Would you accept a patch on the
> sort of this?

Java is quite a "quiet" project. I'd go ahead.
Comment 8 Larry the Git Cow gentoo-dev 2021-03-13 12:21:47 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d02c4bd0c03b2824f55cfff124de93ebccde8c2e

commit d02c4bd0c03b2824f55cfff124de93ebccde8c2e
Author:     Fabian Groffen <grobian@gentoo.org>
AuthorDate: 2021-03-13 12:21:40 +0000
Commit:     Fabian Groffen <grobian@gentoo.org>
CommitDate: 2021-03-13 12:21:44 +0000

    dev-java/snappy-1.1.0.1: fix for and marked ~x64-macos
    
    Closes: https://bugs.gentoo.org/638284
    Package-Manager: Portage-3.0.13, Repoman-3.0.2
    Signed-off-by: Fabian Groffen <grobian@gentoo.org>

 dev-java/snappy/snappy-1.1.0.1.ebuild | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)