[Toybox] FreeBSD issues

Rob Landley rob at landley.net
Wed Jan 16 22:25:32 PST 2019


On 1/16/19 3:48 PM, Ed Maste wrote:
> On Wed, 16 Jan 2019 at 13:35, Rob Landley <rob at landley.net> wrote:
>>
>> On 1/16/19 11:53 AM, Ed Maste wrote:
>>> Indeed, mine has 'FORCED_FLAG' instead of '1':
>>> #define FLAG_x (FORCED_FLAG<<0)
>>
>> That says it's disabled in the config. At the top of flags.h:
> 
> Ah, it seems I had run scripts/test.sh chmod afterwards and flags.h
> was regenerated. Building grep again results in a FOR_grep section
> identical to yours.

Testing individual commands runs "scripts/single.sh command" to build a single
command version of toybox for that command. (The .singleconfig that creates
doesn't have CFG_TOYBOX set, which makes the multiplexer infrastructure in
main.c drop out. It's not busybox levels of crazy optimization so false is 6k
instead of 10k like in toybox, but I put "compact" behind "simple" on my todo
list. Not necessarily far _enough_ behind for some people, of course. :)

> It also seems I must have had some strange breakage in my tree - after
> rebuilding it seems OK:
> % echo 'abcdef' | ./toybox grep -q abc; echo $?
> 0

Do a "make clean" after doing single builds, including "make test" of individual
commands.

(I've tried to make the build plumbing work out when it needs to rebuild stuff,
but when you change the .config it's fiddly. And unfortunately if I make it
depend _on_ the .config it pretty much rebuilds everything all the time...)

> except that the exit code for grepping stdin is still 2 if not found:
> % echo 'abcdef' | ./toybox grep -q xyz; echo $?
> 2

Hmmm, it's doing that for me too. That's a bug.

> because of the TT.tried == toys.optc clause; in my failing case
> TT.tried is 1, toys.optc is 0.

I don't have a tests/grep.test for the exit code with no file arguments. :P

Hmmm, grep -r will also make the count wrong. It's number of command line
arguments processed, not number of files searched...

Rob



More information about the Toybox mailing list