Re: [Toybox] [PATCH 1/2] macOS: use getconf rather than nproc for portability.

2018-11-28 Thread David Seikel
On Wed, 28 Nov 2018 17:11:03 -0800 enh via Toybox wrote: > yeah, bitrot is my big fear too. i really don't want to have to > actually get a mac. (even if i'm not paying for it, this current > macbook pro genuinely is the most awful laptop i've ever used.) > > but i suspect i could always just up

Re: [Toybox] [PATCH] mktemp: add -t and fix behavior.

2018-11-28 Thread enh via Toybox
On Wed, Nov 28, 2018 at 5:19 PM Rob Landley wrote: > > On 11/28/18 6:15 PM, enh via Toybox wrote: > > The new tests pass on the host (coreutils 8.28) and with toybox after > > this patch is applied. > ... > > - if (!template) template = "tmp.XX"; > > + if (!template) { > > +toys.optflags

Re: [Toybox] [PATCH 1/2] macOS: use getconf rather than nproc for portability.

2018-11-28 Thread Rob Landley
On 11/28/18 7:11 PM, enh wrote: > yeah, bitrot is my big fear too. i really don't want to have to > actually get a mac. (even if i'm not paying for it, this current > macbook pro genuinely is the most awful laptop i've ever used.) > > but i suspect i could always just update the mac toybox prebuil

Re: [Toybox] [PATCH] mktemp: add -t and fix behavior.

2018-11-28 Thread Rob Landley
On 11/28/18 6:15 PM, enh via Toybox wrote: > The new tests pass on the host (coreutils 8.28) and with toybox after > this patch is applied. ... > - if (!template) template = "tmp.XX"; > + if (!template) { > +toys.optflags |= FLAG_t; > +template = "tmp.XX"; > + } > > - if (!

Re: [Toybox] [PATCH] macOS: replace local strnstr with strcasestr.

2018-11-28 Thread enh via Toybox
On Wed, Nov 28, 2018 at 5:11 PM Rob Landley wrote: > > On 11/28/18 2:30 PM, enh via Toybox wrote: > > bionic, glibc, macOS, and musl all have strcasestr > > (see http://man7.org/linux/man-pages/man3/strstr.3.html). > > Dear posix: catch up to reality. I'm sure there's a nice farm somewhere > will

Re: [Toybox] [PATCH 1/2] macOS: use getconf rather than nproc for portability.

2018-11-28 Thread enh via Toybox
yeah, bitrot is my big fear too. i really don't want to have to actually get a mac. (even if i'm not paying for it, this current macbook pro genuinely is the most awful laptop i've ever used.) but i suspect i could always just update the mac toybox prebuilt "on demand", which i assume would work o

Re: [Toybox] [PATCH] macOS: replace local strnstr with strcasestr.

2018-11-28 Thread Rob Landley
On 11/28/18 2:30 PM, enh via Toybox wrote: > bionic, glibc, macOS, and musl all have strcasestr > (see http://man7.org/linux/man-pages/man3/strstr.3.html). Dear posix: catch up to reality. I'm sure there's a nice farm somewhere willing to take Jorg Schilling where he can tell everyone how much bet

Re: [Toybox] [PATCH] macOS: noreturn.

2018-11-28 Thread Rob Landley
On 11/28/18 5:41 PM, enh via Toybox wrote: > The macOS libc headers use `__attribute__((noreturn))` rather than > `__attribute__((__noreturn__))`, so toybox's `noreturn` macro trips them > up. Since we already have a variety of uses of `__attribute__` that > aren't guarded in this way, let's do the

Re: [Toybox] [PATCH 1/2] macOS: use getconf rather than nproc for portability.

2018-11-28 Thread Rob Landley
On 11/28/18 5:18 PM, enh wrote: > yeah, sed seems to work okay. right now (with a bunch of source hacks > that i'll try to clean up and send to you) i have the following subset > of the AOSP build tools building: > > basename cat chmod cmp comm cut dirname dos2unix du echo egrep false > fgrep file

Re: [Toybox] [PATCH 2/2] macOS: use -E rather than -r for sed extended regular expressions.

2018-11-28 Thread Rob Landley
On 11/28/18 5:08 PM, enh wrote: >> Applied, but this raises the question of whether $SED in make.sh is still >> needed? (I applied a patch from a macos dev who said it worked, I had a mac >> but > > (i don't --- i'm just borrowing one to see how realistic getting a mac > toybox binary is. the ans

[Toybox] [PATCH] macOS: there's no on the Mac.

2018-11-28 Thread enh via Toybox
--- lib/portability.h | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/portability.h b/lib/portability.h index c2b29b6..427b851 100644 --- a/lib/portability.h +++ b/lib/portability.h @@ -22,9 +22,10 @@ // This isn't in the spec, but it's how we determine what libc w

[Toybox] [PATCH] mktemp: add -t and fix behavior.

2018-11-28 Thread enh via Toybox
The new tests pass on the host (coreutils 8.28) and with toybox after this patch is applied. --- tests/mktemp.test | 21 + toys/lsb/mktemp.c | 29 - 2 files changed, 37 insertions(+), 13 deletions(-) create mode 100755 tests/mktemp.test diff --git

[Toybox] [PATCH] macOS: noreturn.

2018-11-28 Thread enh via Toybox
The macOS libc headers use `__attribute__((noreturn))` rather than `__attribute__((__noreturn__))`, so toybox's `noreturn` macro trips them up. Since we already have a variety of uses of `__attribute__` that aren't guarded in this way, let's do the same here. --- lib/lib.h | 10 +-

Re: [Toybox] [PATCH] basename: -s SUFFIX.

2018-11-28 Thread Rob Landley
On 11/28/18 2:21 PM, enh wrote: > On Mon, Nov 19, 2018 at 10:45 AM Rob Landley wrote: >> Except... the directory is x86-only? You currently only support building on >> an >> x86 host, not on arm? > > correct. i'll worry about supporting arm hosts when i have one that's > competitive with my 2x I

Re: [Toybox] [PATCH 1/2] macOS: use getconf rather than nproc for portability.

2018-11-28 Thread enh via Toybox
On Wed, Nov 28, 2018 at 2:42 PM Rob Landley wrote: > > On 11/28/18 2:16 PM, enh via Toybox wrote: > > Needed to build for macOS. > > --- > > scripts/make.sh | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/scripts/make.sh b/scripts/make.sh > > index 306a7cd..59b1fd2

Re: [Toybox] [PATCH 2/2] macOS: use -E rather than -r for sed extended regular expressions.

2018-11-28 Thread enh via Toybox
On Wed, Nov 28, 2018 at 2:45 PM Rob Landley wrote: > > On 11/28/18 2:16 PM, enh via Toybox wrote: > > GNU sed supports -E, -r, and --regexp-extended. BSD sed only supports > > -r. > > --- > > scripts/genconfig.sh | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/scrip

Re: [Toybox] macOS sed

2018-11-28 Thread Rob Landley
On 11/28/18 3:42 PM, enh via Toybox wrote: > according to > https://stackoverflow.com/questions/12272065/sed-undefined-label-on-macos > macOS' sed only lets you branch backwards. this breaks mkflagsh and > getglobals in scripts/make.sh. > > i'm assuming the answer is "you'll need `brew install gn

Re: [Toybox] [PATCH 2/2] macOS: use -E rather than -r for sed extended regular expressions.

2018-11-28 Thread Rob Landley
On 11/28/18 2:16 PM, enh via Toybox wrote: > GNU sed supports -E, -r, and --regexp-extended. BSD sed only supports > -r. > --- > scripts/genconfig.sh | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/scripts/genconfig.sh b/scripts/genconfig.sh > index 533df60..3887b07 10075

Re: [Toybox] [PATCH 1/2] macOS: use getconf rather than nproc for portability.

2018-11-28 Thread Rob Landley
On 11/28/18 2:16 PM, enh via Toybox wrote: > Needed to build for macOS. > --- > scripts/make.sh | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/scripts/make.sh b/scripts/make.sh > index 306a7cd..59b1fd2 100755 > --- a/scripts/make.sh > +++ b/scripts/make.sh > @@ -15,7 +15

[Toybox] macOS sed

2018-11-28 Thread enh via Toybox
according to https://stackoverflow.com/questions/12272065/sed-undefined-label-on-macos macOS' sed only lets you branch backwards. this breaks mkflagsh and getglobals in scripts/make.sh. i'm assuming the answer is "you'll need `brew install gnu-sed` to bootstrap, and can use a toybox sed from then

[Toybox] [PATCH] macOS: replace local strnstr with strcasestr.

2018-11-28 Thread enh via Toybox
bionic, glibc, macOS, and musl all have strcasestr (see http://man7.org/linux/man-pages/man3/strstr.3.html). macOS (via BSD) has a strnstr that does what strnstr sounds like it should do by analogy with strnlen and strncpy. So we at least need to rename strnstr, but it probably makes more sense j

Re: [Toybox] [PATCH] basename: -s SUFFIX.

2018-11-28 Thread enh via Toybox
On Mon, Nov 19, 2018 at 10:45 AM Rob Landley wrote: > > On 11/13/18 5:16 PM, enh wrote: > > On Tue, Nov 13, 2018 at 2:58 PM Rob Landley wrote: > >> On 11/12/18 10:57 PM, enh wrote: > >>> AOSP doesn't need -a specifically, but since it's needed for -s we may > >>> as well accept it too. > >> > >>

[Toybox] [PATCH 2/2] macOS: use -E rather than -r for sed extended regular expressions.

2018-11-28 Thread enh via Toybox
GNU sed supports -E, -r, and --regexp-extended. BSD sed only supports -r. --- scripts/genconfig.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/genconfig.sh b/scripts/genconfig.sh index 533df60..3887b07 100755 --- a/scripts/genconfig.sh +++ b/scripts/genconfig.sh @@

[Toybox] [PATCH 1/2] macOS: use getconf rather than nproc for portability.

2018-11-28 Thread enh via Toybox
Needed to build for macOS. --- scripts/make.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/make.sh b/scripts/make.sh index 306a7cd..59b1fd2 100755 --- a/scripts/make.sh +++ b/scripts/make.sh @@ -15,7 +15,7 @@ source ./configure UNSTRIPPED="generated/unstripped/$(ba