Bug 219776 - math/R: set SONAME for libR libraries
Summary: math/R: set SONAME for libR libraries
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Joseph Mingrone
URL:
Keywords: needs-qa
Depends on:
Blocks:
 
Reported: 2017-06-04 14:52 UTC by Pawel Pekala
Modified: 2017-07-24 18:35 UTC (History)
4 users (show)

See Also:
bugzilla: maintainer-feedback? (jrm)
koobs: merge-quarterly?


Attachments
SONAME fix (5.19 KB, patch)
2017-06-04 14:52 UTC, Pawel Pekala
no flags Details | Diff
libR SONAME fix v2 (10.64 KB, patch)
2017-07-16 10:18 UTC, Pawel Pekala
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pawel Pekala freebsd_committer freebsd_triage 2017-06-04 14:52:06 UTC
Created attachment 183205 [details]
SONAME fix

- Fix libR libraries by setting their SONAME
- Use USE_LDCONFIG to make them visible to consumers
- Modify consumers to correctly indicate that they link with libR
- Fix math/rkward-kde4 plist issues also
Comment 1 Joseph Mingrone freebsd_committer freebsd_triage 2017-06-04 15:06:41 UTC
The libraries under ${PREFIX}/lib/R/lib are not intended (by upstream) to
be registered with ldconfig, but are opened with dlopen(3).  Yes, this means pkg
will not register shared library dependencies, so we will have to adjust
and bump ports as necessary.  When necessary, unfortunately, is unclear
based on how things work upstream.

I went back and forth on the R developers mailing list about this.

https://stat.ethz.ch/pipermail/r-devel/2016-November/073397.html
Comment 2 Pawel Pekala freebsd_committer freebsd_triage 2017-06-04 16:00:42 UTC
(In reply to Joseph Mingrone from comment #1)
After reading this thread I fail to understand developers position on this issue too. libR is internal, but they provide .pc file for it and then are surprised
some consumer use it as a dynamic library.

Just now I discovered that some R-cran packages link to libR also:

# pkg check -dan
Checking all packages: 100%
R-cran-Rcpp is missing a required shared library: libR.so
R-cran-RcppEigen is missing a required shared library: libRblas.so
R-cran-RcppEigen is missing a required shared library: libRlapack.so
R-cran-RcppEigen is missing a required shared library: libR.so
R-cran-SparseM is missing a required shared library: libR.so
R-cran-XML is missing a required shared library: libR.so
R-cran-gtools is missing a required shared library: libR.so
R-cran-lme4 is missing a required shared library: libR.so
R-cran-minqa is missing a required shared library: libR.so
R-cran-mvtnorm is missing a required shared library: libR.so
R-cran-nloptr is missing a required shared library: libR.so
R-cran-quadprog is missing a required shared library: libRblas.so
R-cran-quadprog is missing a required shared library: libR.so
R-cran-quantreg is missing a required shared library: libRblas.so
R-cran-quantreg is missing a required shared library: libR.so
R-cran-quantreg is missing a required shared library: libRlapack.so
R-cran-tseries is missing a required shared library: libRblas.so
R-cran-tseries is missing a required shared library: libR.so
R-cran-zoo is missing a required shared library: libR.so

It's worse then I thought :/
Comment 3 Joseph Mingrone freebsd_committer freebsd_triage 2017-06-13 13:17:50 UTC
I'm not sure what the best course of action is here.  Since upstream is saying they don't intend for anyone to link against those internal libraries, we would have to deal with determining when there is an incompatible change in the interface and appropriately bumping the version part of the SONAME.

Maybe you could lobby upstream in the referenced thread and offer your patches.
Comment 4 Joseph Mingrone freebsd_committer freebsd_triage 2017-07-01 23:14:23 UTC
I'm not aware of any issues with patching to add SONAMEs to these libraries, but I don't understand the benefit of doing so without a version portion to the SONAME.  Could you update your patch to include a version number?
Comment 5 Pawel Pekala freebsd_committer freebsd_triage 2017-07-16 10:18:18 UTC
Created attachment 184385 [details]
libR SONAME fix v2

Finally found time to work on this.

Patch adds library versioning to libR and family, all centred around
LIBVER variable for easy maintenance.

To be complete solution I believe Mk/Uses/cran.mk must be patched in
similiar way too.
Comment 6 Pawel Pekala freebsd_committer freebsd_triage 2017-07-16 10:20:14 UTC
CC'ing dbn@. Let's what is his take on this matter.
Comment 7 Joseph Mingrone freebsd_committer freebsd_triage 2017-07-17 01:21:47 UTC
Thanks Pawel.  I've suggested some tweaks in https://reviews.freebsd.org/D11615.  I couldn't find an Phabricator account for you to set you as a reviewer.
Comment 8 commit-hook freebsd_committer freebsd_triage 2017-07-19 14:20:14 UTC
A commit references this bug:

Author: jrm
Date: Wed Jul 19 14:19:48 UTC 2017
New revision: 446199
URL: https://svnweb.freebsd.org/changeset/ports/446199

Log:
  math/R: set SONAME for libraries under lib/R/lib

  PR:		219776
  Submitted by:	pawel
  Reviewed by:	pawel, mat
  Differential Revision:	https://reviews.freebsd.org/D11615

Changes:
  head/math/R/Makefile
  head/math/R/files/patch-src_extra_blas_Makefile.in
  head/math/R/files/patch-src_main_Makefile.in
  head/math/R/files/patch-src_modules_lapack_Makefile.in
  head/math/R/pkg-plist
Comment 9 Joseph Mingrone freebsd_committer freebsd_triage 2017-07-19 14:24:48 UTC
Thank you.
Comment 10 commit-hook freebsd_committer freebsd_triage 2017-07-24 18:27:06 UTC
A commit references this bug:

Author: pawel
Date: Mon Jul 24 18:26:40 UTC 2017
New revision: 446540
URL: https://svnweb.freebsd.org/changeset/ports/446540

Log:
  After r446199 libR.so has SONAME and was made visible for
  consumer ports. Register correct dependency by using LIB_DEPENDS
  instead of BUILD|RUN_DEPENDS dance.

  math/rkward-kde4:
  - Add 2 missing files to pkg-plist also

  PR:		219776
  Submitted by:	myself
  Approved by:	maintainers timeouts

Changes:
  head/math/cantor/Makefile
  head/math/rkward-kde4/Makefile
  head/math/rkward-kde4/pkg-plist
  head/math/rpy/Makefile
  head/math/rpy2/Makefile
  head/science/afni/Makefile
Comment 11 Joseph Mingrone freebsd_committer freebsd_triage 2017-07-24 18:35:29 UTC
Thanks again pawel@.  Sorry, I should have closed this bug.  I had forgotten about the changes to the other ports.