Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 673322 - db.eclass: please review prefix changes
Summary: db.eclass: please review prefix changes
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Other
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2018-12-17 09:37 UTC by Fabian Groffen
Modified: 2021-01-19 18:27 UTC (History)
2 users (show)

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


Attachments
db.eclass prefix patch (db.eclass.patch,2.44 KB, patch)
2018-12-17 09:37 UTC, Fabian Groffen
Details | Diff
db.eclass prefix-2 patch (db.eclass-prefix2.patch,2.52 KB, patch)
2021-01-17 12:53 UTC, Fabian Groffen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fabian Groffen gentoo-dev 2018-12-17 09:37:52 UTC
Created attachment 557970 [details, diff]
db.eclass prefix patch

The patch in the attachment contain changes necessary to deal with different extensions for shared libraries on various Prefix platforms.  Please review.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-11-28 02:34:01 UTC
@base-system, how does this look?
Comment 2 Mike Gilbert gentoo-dev 2020-11-28 17:23:31 UTC
This part appears to be incorrect:

> -		if [ -f $i-3.2.so ]; then
> -			ln -sf $i-3.2.so $i-3.so
> -			ln -sf $i-3.2.so $i.so.3
> +		if [ -f $i-3$(get_libname 2) ]; then
> +			ln -sf $i-3$(get_libname 2) $i-3$(get_libname)
> +			ln -sf $i-3$(get_libname 2) $i$(get_libname 3)


On Linux, the old code looks for "libdb-3.2.so".
The new code looks for "libdb-3.so.2".
Comment 3 Fabian Groffen gentoo-dev 2021-01-11 19:45:04 UTC
(In reply to Mike Gilbert from comment #2)
> This part appears to be incorrect:
> 
> > -		if [ -f $i-3.2.so ]; then
> > -			ln -sf $i-3.2.so $i-3.so
> > -			ln -sf $i-3.2.so $i.so.3
> > +		if [ -f $i-3$(get_libname 2) ]; then
> > +			ln -sf $i-3$(get_libname 2) $i-3$(get_libname)
> > +			ln -sf $i-3$(get_libname 2) $i$(get_libname 3)
> 
> 
> On Linux, the old code looks for "libdb-3.2.so".
> The new code looks for "libdb-3.so.2".

you're right, took me a while to see this one.
Comment 4 Fabian Groffen gentoo-dev 2021-01-11 19:55:40 UTC
how about this instead:

        local i
        for i in libdb libdb_{cxx,tcl,java,sql,stl}; do
-               if [[ -f ${i}-3.2.so ]]; then
-                       ln -sf ${i}-3.2.so ${i}-3.so
-                       ln -sf ${i}-3.2.so ${i}.so.3
+               if [[ -f $i-3.2$(get_libname) ]]; then
+                       ln -sf $i-3.2$(get_libname) $i-3$(get_libname)
+                       ln -sf $i-3.2$(get_libname) $i$(get_libname 3)
                fi
        done
Comment 5 Mike Gilbert gentoo-dev 2021-01-11 20:05:54 UTC
That looks reasonable.
Comment 6 Fabian Groffen gentoo-dev 2021-01-11 20:09:49 UTC
What about the full patch?  Can I take it up for review on -dev?
Comment 7 Mike Gilbert gentoo-dev 2021-01-11 20:33:42 UTC
I didn't spot any other problems. gentoo-dev seems like a good next step.
Comment 8 Larry the Git Cow gentoo-dev 2021-01-14 12:29:22 UTC
The bug has been closed via the following commit(s):

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

commit b158fba5eee07da21f8b80fd737b9bdd3865256b
Author:     Fabian Groffen <grobian@gentoo.org>
AuthorDate: 2021-01-14 12:27:45 +0000
Commit:     Fabian Groffen <grobian@gentoo.org>
CommitDate: 2021-01-14 12:28:34 +0000

    eclass/db.eclass: use get_libname for Darwin support
    
    Closes: https://bugs.gentoo.org/673322
    Signed-off-by: Fabian Groffen <grobian@gentoo.org>

 eclass/db.eclass | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)
Comment 9 Larry the Git Cow gentoo-dev 2021-01-16 16:11:44 UTC
The bug has been referenced in the following commit(s):

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

commit e154526e7b59f94428b302b6360e54b5f689b9a5
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2021-01-16 16:08:10 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2021-01-16 16:08:10 +0000

    Revert "eclass/db.eclass: use get_libname for Darwin support"
    
    This change somehow causes libdb.so to be installed.
    
    Bug: https://bugs.gentoo.org/673322
    Closes: https://bugs.gentoo.org/765625
    Reverts: b158fba5eee07da21f8b80fd737b9bdd3865256b
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 eclass/db.eclass | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)
Comment 10 Fabian Groffen gentoo-dev 2021-01-17 08:27:48 UTC
I think this is the problem:

-       find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*'"$(get_libname)"
-delete || die
-       find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*'"$(get_libname
"[23]")" -delete || die
+       find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*so' -delete || die
+       find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*so.[23]' -delete ||
die

get_libname returns .so here, thus libdb[1._-]*.so which matches the '.' before '.so'.

Given the amount of possibilities here, including things like libdb-1.1.so, easiest to me looks like:

       local soext=$(get_libname)
       soext=${soext#.}
       find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*'"${soext}"
-delete || die
       soext=$(get_libname "[23]")
       soext=${soext#.}
       find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*'"${soext}" -delete || die

perhaps?
Comment 11 Fabian Groffen gentoo-dev 2021-01-17 08:31:40 UTC
can you share which version of db to test this with to see the output is the same?
Comment 12 Fabian Groffen gentoo-dev 2021-01-17 12:52:53 UTC
I'm terribly sorry for the breakage, this never turned out to be a problem on Prefix hosts for some reason, but that's not relevant any more now.

To salvage this situation, I did the following:

mkdir /var/tmp/sys-libs-db; for e in *.ebuild ; do ebuild $e clean install ; find /var/tmp/portage/sys-libs/${e%.ebuild}/image > /var/tmp/sys-libs-db/$e ; done

re-applied my original commit, did the same thing on a different directory, and ran diff -Naur.  As bug 765625 points out, the diff indeed is like:

--- /var/tmp/sys-libs-db/db-6.2.38.ebuild
+++ /var/tmp/sys-libs-db-prefix1/db-6.2.38.ebuild
@@ -26,4 +26,5 @@
 /var/tmp/portage/sys-libs/db-6.2.38/image/usr/include/db6.2/db_185.h
 /var/tmp/portage/sys-libs/db-6.2.38/image/usr/include/db6.2/db.h
 /var/tmp/portage/sys-libs/db-6.2.38/image/usr/lib64
+/var/tmp/portage/sys-libs/db-6.2.38/image/usr/lib64/libdb.so
 /var/tmp/portage/sys-libs/db-6.2.38/image/usr/lib64/libdb-6.2.so

So, I've applied what I think is my fix, and re-run this to ensure no diffs are there.  The fix pertains to this section, like this:

    # first clean up old symlinks
    local soext=$(get_libname)
    find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*'"${soext#.}" -delete  || die
    soext=$(get_libname "[23]")
    find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*'"${soext#.}" -delete  || die
    find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*a' -delete || die

I'll re-attach the new fix, please review it.

I'm asking to be able to re-commit the fixed version (now I've verified for all versions this doesn't change the installed files) as to unbreak the Darwin targets again.
Comment 13 Fabian Groffen gentoo-dev 2021-01-17 12:53:34 UTC
Created attachment 683302 [details, diff]
db.eclass prefix-2 patch
Comment 14 Mike Gilbert gentoo-dev 2021-01-19 16:36:50 UTC
It sounds like you tested this appropriately, so feel free to apply a revised patch.
Comment 15 Larry the Git Cow gentoo-dev 2021-01-19 17:14:52 UTC
The bug has been closed via the following commit(s):

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

commit 4741fcd38d7a99bf5d1c3c31e4ba8300cd4bbb97
Author:     Fabian Groffen <grobian@gentoo.org>
AuthorDate: 2021-01-19 17:13:02 +0000
Commit:     Fabian Groffen <grobian@gentoo.org>
CommitDate: 2021-01-19 17:14:48 +0000

    eclass/db.eclass: use get_libname for Darwin hosts (version 2)
    
    Redo the original attempt of this patch
    (b158fba5eee07da21f8b80fd737b9bdd3865256b) this time ensuring there is
    absoletely no change in installed files.
    
    Closes: https://bugs.gentoo.org/673322
    Signed-off-by: Fabian Groffen <grobian@gentoo.org>

 eclass/db.eclass | 30 +++++++++++++++++-------------
 1 file changed, 17 insertions(+), 13 deletions(-)
Comment 16 Mike Gilbert gentoo-dev 2021-01-19 18:25:44 UTC
GLEP 66 says the summary line for eclass changes should look like this:

db.eclass: use get_libname for Darwin support

It looks like you prefixed it with "eclass/", which is redundant and incorrect according to the GLEP.

Just something to keep in mind for future patches.
Comment 17 Fabian Groffen gentoo-dev 2021-01-19 18:27:34 UTC
Unware of that, thanks for letting me know!