Page MenuHomeFreeBSD

sysutils/debootstrap: add dependency on gnugrep
ClosedPublic

Authored by trasz on Apr 28 2021, 10:25 AM.

Details

Summary

Debootstrap triggers some weird corner case in our base grep(1),
where it's two orders of magnitude slower than it should be.
Fix it by providing it with GNU grep. This reduces the time
to complete 'debootstrap bionic' from ~4m30s to ~1m30s.

Note that the debootstrap(8) itself is unchanged; it somehow picks
up the ports grep automatically, I got no clue how.

Sponsored By: EPSRC

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

emaste added a subscriber: kevans.
emaste added a subscriber: emaste.

Fine with me (although I'm not a ports committer). It might be worth adding a comment in the Makefile explaining why we use gnugrep.

This revision is now accepted and ready to land.Apr 28 2021, 12:26 PM

Odd, looks like it just uses grep from PATH and I'm not seeing anywhere that it might use anything but that from your profile/login(1).

Odd, looks like it just uses grep from PATH and I'm not seeing anywhere that it might use anything but that from your profile/login(1).

I have the same problem - I have no idea how it picks up /usr/local/bin/grep. It kind of looks as if bash was evaluating the $PATH backwards - the one set by my login scripts is /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:

18271 bash     CALL  fstatat(AT_FDCWD,0x800ce0f20,0x7fffffffcf88,0)
18271 bash     NAMI  "/usr/local/sbin/grep"
18271 bash     RET   fstatat -1 errno 2 No such file or directory
18271 bash     CALL  fstatat(AT_FDCWD,0x800ce0f20,0x7fffffffcf88,0)
18271 bash     NAMI  "/usr/local/bin/grep"
18271 bash     RET   fstatat -1 errno 2 No such file or directory
18271 bash     CALL  fstatat(AT_FDCWD,0x800c38ca0,0x7fffffffcf88,0)
18271 bash     NAMI  "/usr/sbin/grep"
18271 bash     RET   fstatat -1 errno 2 No such file or directory
18271 bash     CALL  fstatat(AT_FDCWD,0x800c38ca0,0x7fffffffcf88,0)
18271 bash     NAMI  "/usr/bin/grep"
18271 bash     STRU  struct stat {dev=105, ino=6101192, mode=0100555, nlink=4, uid=0, gid=0, rdev=12194976, atime=1619384117.484561000, mtime=1619384117.486223000, ctime=1619384117.652517000, birthtime=1619384117.484559000, size=31960, blksize=32768, blocks=64, flags=0x0 }

Hm.

trasz@tank:/usr/local/bin % echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
trasz@tank:/usr/local/bin % doas sh
%n@%m:%~ %# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
%n@%m:%~ %# ^D
trasz@tank:/usr/local/bin % strings /usr/local/bin/doas | grep local/sbin
/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
This revision now requires review to proceed.May 1 2021, 9:55 AM
This revision was not accepted when it landed; it landed in state Needs Review.May 4 2021, 12:48 PM
This revision was automatically updated to reflect the committed changes.