Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 1638
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Matthew Kennedy (RETIRED) <mkennedy@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Sandy McArthur <Sandy@McArthur.org>
Add CC:
CC:
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 1638 depends on: Show dependency tree
Bug 1638 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2002-04-10 00:34 0000
Some will disagree that this is a problem so hear me out to the end.

Run `ldd /bin/grep` and you'll get:
        libpcre.so.0 => /usr/lib/libpcre.so.0 (0x4002d000)
        libc.so.6 => /lib/libc.so.6 (0x40037000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

Everything looks ok? Well, IMO since grep is in /bin is should not depend on
anything in /usr . I keep /usr as a different mount point than my root
filesystem and if my machine were to have problems where I couldn't mount /usr
but could mount the root I would not be able to use the grep command during
recovery.

How would I solve this? 

I think anything in /bin should be statically compiled to improve the
probability of recovery when all goes to hell but that is a policy issue for
people more involved with Gentoo.

You could have two grep packages, grep and sgrep, kinda like there are two
python packages. sgrep would be staticly compiled and merge into /bin and grep
would be normally compiled and merge into /usr/bin . If you did this you would
probably want to make it so /usr/bin was before /bin in the user's $PATH .

Maybe just staticly compile the grep package but then you lose the advantage of
libs.

Or move /usr/lib/libpcre.so.0 to /lib/libpcre.so.0 but I don't like this idea.

------- Comment #1 From Matthew Kennedy (RETIRED) 2002-04-11 12:36:57 0000 -------
I can confirm this. When I shutdown my machine, the last thing before system
halt is a message about /usr/lib/libpcre.so.X missing. My /usr and / are on
different volumes. A quick ldd /bin/* shows that only grep is the looking for
something in /usr/lib.

There are a couple of solutions:

   1.  move libpcre into /lib
   2.  build /bin/grep without libprce
   3.  link libprce statically.

Some research shows that other distros (eg. redhat and debian) are not doing 1
or 3. option 2 is the best because we get a vanilla /bin/grep with no libpcre
but if the user wants a libpcre-grep, then dev-libs/libprce provides just that:
/usr/bin/pcregrep.

------- Comment #2 From Seemant Kulleen (RETIRED) 2002-04-11 21:27:03 0000 -------
OK, I think your solution #2 is best.  Here's what I would recommend, but it
needs testing (especially in a bootstrap environment).  

in the DEPEND section: perl?( libpcre )

and then in src_compile():

   use perl || myconf="${myconf} --disable-perl-regexp"

That should compile without libpcre if you build it with -perl in USE :)


------- Comment #3 From Sandy McArthur 2002-04-12 11:34:28 0000 -------
I did a few test compiles and it seems there is no way to force a static
compile
of grep. The perl regexp feature was just added in the last release so not much
out there is going to need it. I think changing the start of src_compile to:

src_compile() {
    local myconf
    myconf="--disable-perl-regexp"
    [ -z "`use nls`" ] && myconf="--disable-nls"
...etc...

would be the best solution.

------- Comment #4 From Matthew Kennedy (RETIRED) 2002-04-12 19:15:00 0000 -------
Fixed in CVS but masked (sys-apps/grep-2.5-r1) until more people test it.

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug