[Toybox] GitHub Action Example

Rob Landley rob at landley.net
Mon Jun 15 11:12:26 PDT 2020


On 6/15/20 11:07 AM, enh via Toybox wrote:
> On Sat, Jun 13, 2020 at 12:30 AM Eric Molitor <emolitor at molitor.org> wrote:
>>
>> Would aarch64 builds on Ubuntu and Alpine be useful? That will be slightly more complex to setup but is possible.
> 
> i don't actually remember us ever having an aarch64-specific issue.
> (funnily enough, a 32-bit x86 build would probably find more bugs,
> since i don't think anyone regularly tests any 32-bit arch locally. i
> certainly only find 32-bit issues when i try to run on an Android
> emulator!)

I test it before releases, and I test the j-core stuff which is still only 32
bit. But it's not tested nearly as regularly as the 64 bit stuff is.

I'm trying to get the mkroot plumbing to run the test suite under qemu. I'm
about 3/4 of the way there. That should get more variants tested in a more
easily automatable fashion, but it's all musl (and glibc) unless bionic stops
segfaulting "hello world" when run in a chroot that doesn't have /dev/null in it
yet.

But right now the test suite hasn't got nearly as much coverage as I'd like, and
until I fix that running it regularly doesn't really _prove_ anything. (And
finishing the shell is eating my cycles...)

And 32 bit argument processing has a known structural limitation (the "truncate
-s 8G" thing) which I've mentioned here before. I know how to fix it, but the
fix is intrusive enough I'm not sure it's worth doing?

>>> it seems like your setup is running on a cron-like timer? is there a way to say "on every push" instead?
>>>
>> There are three build triggers in the configuration, cron, push on master and pull request on master. As I forked the repo you only see changes to my repo (emolitor/toybox) trigger builds and not landley/toybox.
> 
> ah, i see. hopefully rob will look at
> https://github.com/emolitor/toybox/runs/767753680?check_suite_focus=true
> and turn this on for the main repo then :-)

I'm uncomfortable putting Microsoft Github dependencies directly into toybox,
especially now Microsoft seems to be back on its "embrace and extend" kick:

  https://www.youtube.com/watch?v=pRMb51rx2Gg#t=38s

>>  I just added a parallel ASAN build on Ubuntu using clang to test.
> 
> awesome, thanks!
> 
> and rob just needs to add this file to the repository to get this?
> there's no extra setup in the github ui?

I've been using github as a mirror. It's a distribution server I never pull from
or use the web infrastructure for anything (except as a mutant proprietary
bugzilla because people keep filing stuff there, but back in the busybox days
distros would often have their own bugzillas with busybox bugs and patches in
them, nothing new there).

Adding a .github subdirectory to the source would be a policy change. I'm happy
with a fork doing it, but am uncomfortable putting it in the main repo. (Not
fatally uncomfortable, but... ergh?)

>> [https://github.com/emolitor/toybox/actions/runs/134098865]
>> --- a/.github/workflows/toybox.yml
>> +++ b/.github/workflows/toybox.yml
>> @@ -37,6 +37,20 @@ jobs:
>>      - name: Test
>>        run: make tests
>>
>> +  Ubuntu-20_04-Clang-ASAN:
>> +    runs-on: ubuntu-20.04
>> +
>> +    steps:
>> +    - uses: actions/checkout at v2
>> +    - name: Setup
>> +      run: sudo apt-get install build-essential clang
>> +    - name: Configure
>> +      run: make defconfig
>> +    - name: Build
>> +      run: CC=clang ASAN=1 make
>> +    - name: Test
>> +      run: make tests
>> +

Given that you aren't setting VERBOSE=fail I assume you want me to add a patch like:

diff --git a/scripts/test.sh b/scripts/test.sh
index 20f76d09..cdfe3bdb 100755
--- a/scripts/test.sh
+++ b/scripts/test.sh
@@ -60,3 +60,5 @@ else
     do_test "$i"
   done
 fi
+
+[ $FAILCOUNT -eq 0 ]

So make can _tell_ it failed?

Also, you can "CC=clang ASAN=1 make defconfig toybox tests" all on one line. And
you probably want defconfig to have CC=clang anyway because some of the config
probes run there (creating generated/*).

Rob


More information about the Toybox mailing list