[Toybox] GitHub Action Example
enh
enh at google.com
Fri Jun 26 12:04:25 PDT 2020
On Sun, Jun 21, 2020 at 7:55 PM Rob Landley <rob at landley.net> wrote:
>
> On 6/20/20 9:56 AM, Eric Molitor wrote:
> > I disabled builds on pull requests in the example which should discourage use.
> > By default only project members are notified but you can add non-project members
> > to the notifications. Currently the MacOS and GCC Ubuntu builds and tests are
> > completing fine but there are issues with the ASAN Clang Ubuntu and Alpine
> > builds. The latter is due to running in an unprivileged container.
> >
> > * ASAN Clang Ubuntu builds have two failures
>
> Unfortunately the ASAN ndk build breaks for me because when I set up the
> toolchain ala (3) in https://landley.net/toybox/faq.html#cross and do:
>
> ASAN=1
> CROSS_COMPILE=/home/landley/android/android-ndk-r21b/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android-
> LDFLAGS=--static make distclean defconfig toybox
>
> The static build breaks with:
>
> /home/landley/android/android-ndk-r21b/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/gcc/x86_64-linux-android/4.9.x/../../../../x86_64-linux-android/bin/ld:
> error: cannot mix -static with dynamic object
> /home/landley/android/android-ndk-r21b/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/9.0.8/lib/linux/libclang_rt.asan-x86_64-android.so
> toys/lsb/md5sum.c:416: error: undefined reference to 'sin'
>
> > 2020-06-20T14:46:07.3520007Z PASS: grep -l trumps -C
> > 2020-06-20T14:46:07.3822941Z scripts/runtest.sh: line 130: warning: command
> > substitution: ignored null byte in input
> > 2020-06-20T14:46:07.3823566Z FAIL: grep match after NUL byte
>
> This one works for me with the android NDK-21b clang?
yeah, this test passes for me with asan on Android and macOS.
seems like there might be a problem with the clang version 9.0.1-10 on
debian. the clang-10 package on Ubuntu 18.04 seems to have the same
failure. i don't have a debian or ubuntu machine running a new enough
OS to offer me clang-11 yet. (and sadly, although you can target the
host with the NDK, we don't ship the asan bits for the host.)
oh well. try again next year...
> It fails with the musl build though, because the first fixup in lib/portability.h:
>
> // For musl
> #define _ALL_SOURCE
> #ifndef REG_STARTEND
> #define REG_STARTEND 0
> #endif
>
> never got fixed in musl:
>
> https://www.openwall.com/lists/musl/2013/01/15/26
> https://www.gitmemory.com/issue/nicm/fdm/77/578155457
> https://github.com/yrutschle/sslh/issues/40
> https://savannah.gnu.org/bugs/?50447
> https://github.com/tmux/tmux/issues/1994
>
> But that's a known bug in musl.
>
> Ahem, "design choice Rich made that regularly breaks people's code and has to be
> worked around". He dislikes such things being called bugs because bug implies
> mistake when he did it intentionally and has defended its preservation for
> years, at length, over multiple objections:
>
> https://marc.info/?l=git&m=147560139529266&w=2
>
> > 2020-06-20T14:46:07.4062489Z PASS: grep implicit BRE |
> > ...
> > 2020-06-20T14:46:18.8829033Z PASS: sed \n too high
> > 2020-06-20T14:46:23.9744710Z FAIL: sed megabyte s/x/y/g (5 sec timeout)
> > 2020-06-20T14:46:23.9993359Z PASS: sed s i and I
>
> Hmmm...
>
> $ bash -c 'X=x; Y=20; while [ $Y -gt 0 ]; do X=$X$X; Y=$(($Y-1)); done; echo $X
> | toybox time toybox sed s/x/y/g | sha1sum'
> real 0.513341
> user 0.376000
> sys 0.004000
> 138c1fa7c3f64186203b0192fb4abdb33cb4e98a -
>
> That's the musl binary...
>
> $ bash -c 'X=x; Y=20; while [ $Y -gt 0 ]; do X=$X$X; Y=$(($Y-1)); done; echo $X
> | ./toybox time ./toybox sed s/x/y/g | sha1sum'
> real 0.313839
> user 0.184000
> sys 0.000000
> 138c1fa7c3f64186203b0192fb4abdb33cb4e98a -
>
> glibc binary...
>
> $ bash -c 'X=x; Y=20; while [ $Y -gt 0 ]; do X=$X$X; Y=$(($Y-1)); done; echo $X
> | ./toybox time ./toybox sed s/x/y/g | sha1sum'
> real 0.555019
> user 0.424000
> sys 0.000000
> 138c1fa7c3f64186203b0192fb4abdb33cb4e98a -
>
> bionic/clang binary.
>
> Even with AOSP building in the background, it took half a second on my laptop
> and the timeout is 10x that.
yeah, but that wasn't timing the *asan* version --- for me that takes
0m12.543s vs 0m0.130s on the same decent-ish desktop machine.
> > * Quite a few of the Alpine tests are failing as some of the tests depend upon
> > privileges that are not available when running in a container.
>
> In which case what I need to do is set up this environment locally and reproduce
> the issues so I can debug and fix them. If container privileges are breaking the
> tests... I'd like to know more about that but am not 100% sure that isn't pilot
> error? But I definitely want to reproduce it to understand the issue.
>
> I should set up a "run test suite with the 3 toolchains I usually test with"
> wrapper script...
>
> And I agree that "macos regression test build" is not an environment I otherwise
> have access to, and if github's going to offer that when nothing else does, I
> need to figure out how to take advantage of that to at least make Elliott's life
> easier. Not happy about it, trying to figure out least ugly way of doing it, but
> you're right it needs to be done.
>
> Rob
More information about the Toybox
mailing list