Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 277849 - sci-libs/{blas-reference, cblas, lapack} ebuild scripts corrected to allow for proper eselect behavior
Summary: sci-libs/{blas-reference, cblas, lapack} ebuild scripts corrected to allow fo...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
: 277447 284392 (view as bug list)
Depends on: 289095 293317
Blocks:
  Show dependency tree
 
Reported: 2009-07-14 18:31 UTC by Michael Yang
Modified: 2010-12-11 10:51 UTC (History)
2 users (show)

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


Attachments
sci-libs/lapack-reference ebuild patch (lapack-reference-3.2.1.ebuild.patch,1.23 KB, patch)
2009-07-14 18:41 UTC, Michael Yang
Details | Diff
sci-libs/blas-reference ebuild patch (blas-reference-20070226.ebuild.patch,1.14 KB, patch)
2009-07-14 18:41 UTC, Michael Yang
Details | Diff
sci-libs/cblas-reference ebuild patch (cblas-reference-20030223-r4.ebuild.patch,1.21 KB, patch)
2009-07-14 18:41 UTC, Michael Yang
Details | Diff
eselect lapack reference file patch (put in files) (eselect.lapack.reference.patch,729 bytes, patch)
2009-07-14 18:42 UTC, Michael Yang
Details | Diff
eselect blas reference file patch (put in files) (eselect.blas.reference.patch,677 bytes, patch)
2009-07-14 18:42 UTC, Michael Yang
Details | Diff
eselect cblas reference file patch (put in files) (eselect.cblas.reference.patch,791 bytes, patch)
2009-07-14 18:42 UTC, Michael Yang
Details | Diff
Tiny patch to fix 'eselect cblas add'. (eselect-libs_skel-add.patch,398 bytes, patch)
2009-10-16 16:42 UTC, Heiko
Details | Diff
Fix eselect's libs/multilib.bash to return proper lib dirs. (eselect-multilib-prefix.patch,786 bytes, patch)
2009-10-16 16:44 UTC, Heiko
Details | Diff
eselect-1.2.7 ebuild patch (eselect-1.2.7.ebuild.patch,842 bytes, patch)
2009-11-15 21:26 UTC, Michael Yang
Details | Diff
eselect-1.2.7 files patch (eselect-libs_skel-add.patch,463 bytes, patch)
2009-11-15 21:27 UTC, Michael Yang
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Yang 2009-07-14 18:31:50 UTC
After emerging sci-libs/blas-reference, sci-libs/cblas-reference, or sci-libs/lapack-reference, eselect {package} set reference will produce an error:

rm: cannot remove `/usr/lib/libblas.so': Permission denied
rm: cannot remove `/usr/lib/libblas.a': Permission denied
ln: cannot remove `/usr/lib/libblas.so': Permission denied
ln: creating symbolic link `/usr/lib/libblas.so.0': Permission denied
ln: cannot remove `/usr/lib/libblas.a': Permission denied
ln: creating symbolic link `/usr/lib/pkgconfig/blas.pc': Permission denied

but the ebuild will report success.  This is bad for further dependencies (virtual/cblas, virtual/blas, etc.) since they depend on the ${EPREFIX}/usr/lib libraries being in the right place.





Reproducible: Always

Steps to Reproduce:
1. emerge sci-libs/blas-reference
2. eselect blas set reference

Actual Results:  
rm: cannot remove `/usr/lib/libblas.so': Permission denied
rm: cannot remove `/usr/lib/libblas.a': Permission denied
ln: cannot remove `/usr/lib/libblas.so': Permission denied
ln: creating symbolic link `/usr/lib/libblas.so.0': Permission denied
ln: cannot remove `/usr/lib/libblas.a': Permission denied
ln: creating symbolic link `/usr/lib/pkgconfig/blas.pc': Permission denied

Expected Results:  
successful ebuild/eselect

eselect-{blas,cblas,lapack} scripts inherit skel.bash (see gentoo bug #189942) through `inherit skel`.  (just for reference, the skel.bash file is in ${EPREFIX}/usr/share/eselect/libs/) and the relevant code is:
...
    # Set up new symlinks
    while read line; do
        # Skip comments
        [[ "${line}" = *#* ]] && continue

        line=${line//@LIBDIR@/${libdir}}

        set ${line}
        src=$1
        dest=$2
        ln -sf ${src} ${ROOT}${dest}
    done < ${implem_file}
...
$ eselect blas set reference
does the following:
 * eselect-blas script runs `inherit skel`
 * inerhit skel reads in ${EPREFIX}/etc/env.d/blas/lib/reference (for example, if the package is 'blas') line-by-line and creates symlinks
Comment 1 Michael Yang 2009-07-14 18:41:05 UTC
Created attachment 197952 [details, diff]
sci-libs/lapack-reference ebuild patch
Comment 2 Michael Yang 2009-07-14 18:41:26 UTC
Created attachment 197954 [details, diff]
sci-libs/blas-reference ebuild patch
Comment 3 Michael Yang 2009-07-14 18:41:46 UTC
Created attachment 197956 [details, diff]
sci-libs/cblas-reference ebuild patch
Comment 4 Michael Yang 2009-07-14 18:42:19 UTC
Created attachment 197957 [details, diff]
eselect lapack reference file patch (put in files)
Comment 5 Michael Yang 2009-07-14 18:42:34 UTC
Created attachment 197958 [details, diff]
eselect blas reference file patch (put in files)
Comment 6 Michael Yang 2009-07-14 18:42:46 UTC
Created attachment 197959 [details, diff]
eselect cblas reference file patch (put in files)
Comment 7 Michael Yang 2009-07-14 18:43:36 UTC
Comment on attachment 197952 [details, diff]
sci-libs/lapack-reference ebuild patch

The attached files insert a missing ${EPREFIX} in front of --libdir and also fix the eselect scripts
Comment 8 Fabian Groffen gentoo-dev 2009-09-14 06:58:14 UTC
*** Bug 284392 has been marked as a duplicate of this bug. ***
Comment 9 Heiko 2009-10-16 16:42:02 UTC
Found another problem with the whole sci-*-eselect stuff. sci-libs/gsl won't merge, because eselect cblas add installs into /etc instead of $EPREFIX/etc due to a bug in eselect's libs/skel.bash. The attached patch fixes the problem for me.

Additionally you'll need the second patch to fix get_libdirs() and thus the show/list/set helpers of eselect *.
Comment 10 Heiko 2009-10-16 16:42:49 UTC
Created attachment 207322 [details, diff]
Tiny patch to fix 'eselect cblas add'.
Comment 11 Heiko 2009-10-16 16:44:25 UTC
Created attachment 207324 [details, diff]
Fix eselect's libs/multilib.bash to return proper lib dirs.
Comment 12 Fabian Groffen gentoo-dev 2009-11-11 16:15:30 UTC
(In reply to comment #10)
> Created an attachment (id=207322) [details]
> Tiny patch to fix 'eselect cblas add'.

I don't understand how this can fix things?
Comment 13 Heiko 2009-11-11 16:26:00 UTC
(In reply to comment #12)
> (In reply to comment #10)
> > Created an attachment (id=207322) [details] [details]
> > Tiny patch to fix 'eselect cblas add'.
> 
> I don't understand how this can fix things?
> 

Well $D is missing $EPREFIX whereas $ED is not. Thus the former will fail and the latter work. Anyway i second the non-existing readability of the eselect source ;)
Comment 14 Fabian Groffen gentoo-dev 2009-11-15 18:15:57 UTC
*** Bug 277447 has been marked as a duplicate of this bug. ***
Comment 15 Fabian Groffen gentoo-dev 2009-11-15 18:17:34 UTC
(In reply to comment #11)
> Created an attachment (id=207324) [details]
> Fix eselect's libs/multilib.bash to return proper lib dirs.
> 

this is fix0rzed in eselect-1.2.7
Comment 16 Michael Yang 2009-11-15 21:26:35 UTC
Created attachment 210350 [details, diff]
eselect-1.2.7 ebuild patch

incorporates patch by Heiko Przybyl into eselect-1.2.7 (can we incorporate this into the main trunk?)
Comment 17 Michael Yang 2009-11-15 21:27:39 UTC
Created attachment 210352 [details, diff]
eselect-1.2.7 files patch

see: Heiko Przybyl patch.  This one works with eselect-1.2.7, patching libs/skel.bash.in prior to compilation (can we incorporate into main trunk?)
Comment 18 Fabian Groffen gentoo-dev 2009-11-15 21:28:35 UTC
no, since it's wrong, I filed bug #293317 for this issue
Comment 19 Fabian Groffen gentoo-dev 2009-11-15 21:29:29 UTC
blas-reference ebuild fixed
Comment 20 Michael Yang 2009-11-15 21:43:44 UTC
Comment on attachment 210350 [details, diff]
eselect-1.2.7 ebuild patch

ok, thx fabian
Comment 21 Michael Yang 2009-11-15 21:44:02 UTC
Comment on attachment 210352 [details, diff]
eselect-1.2.7 files patch

ok, thx fabian
Comment 22 Michael Yang 2009-11-15 21:57:55 UTC
can we do the following:
 * apply the same patch to sci-libs/cblas-reference
 * ecopy virtual/cblas-1.0 ebuild (works fine)

so that dev-python/numpy-1.3.0-r1 (lapack) and sci-libs/scipy-0.7.1 work?
Comment 23 Fabian Groffen gentoo-dev 2009-11-16 07:44:45 UTC
lapack-reference ebuild fixed too
Comment 24 Fabian Groffen gentoo-dev 2009-11-16 16:09:20 UTC
cblas-reference imported
Comment 25 Fabian Groffen gentoo-dev 2009-11-16 16:26:46 UTC
Comment on attachment 207322 [details, diff]
Tiny patch to fix 'eselect cblas add'.

invalid patch
Comment 26 Fabian Groffen gentoo-dev 2009-11-16 16:27:15 UTC
ok, looks like we dealt with everything on this bug now, didn't we?
Comment 27 Fabian Groffen gentoo-dev 2010-12-11 10:51:57 UTC
I think we did fix this eventually