Using hosted AROS for Continuous Integration?

leeg · 3901

leeg

  • Newbie
  • *
    • Posts: 21
    • Karma: +0/-0
on: May 21, 2020, 12:49:28 PM
Hi, I want to use AROS as an environment to build and test my Amiga software in continuous integration, probably using Github actions. Has anybody done this and have experience they can share, please?

The rough outline of my plan:
  • make a Docker image with AROS and the source tree
  • add my source in-tree
  • configure; make local-testrunner
  • add :local/myproject/testrunner to S:User-Startup
  • run AROSBootstrap
  • ??
  • profit!

Is there a way to find out in the host OS whether S:User-Startup failed? I guess at worst I could write a file containing the test results and watch for it appearing in the host, anyone tried that?



deadwood

  • AROS Developer
  • Legendary Member
  • *****
    • Posts: 1524
    • Karma: +118/-0
Reply #1 on: May 21, 2020, 02:03:13 PM
You should check AROS/scripts/nightly. AROS is having some internal tests that are being run at each build and probably you can use the same mechanism.



leeg

  • Newbie
  • *
    • Posts: 21
    • Karma: +0/-0
Reply #2 on: May 21, 2020, 02:05:15 PM
Amazing, thanks! If I get it working I’ll write it up as a HOWTO :)



deadwood

  • AROS Developer
  • Legendary Member
  • *****
    • Posts: 1524
    • Karma: +118/-0
Reply #3 on: May 21, 2020, 02:28:50 PM
Other way is trying this:

https://ae.amigalife.org/index.php?topic=561.0

It will build a linux binary out of your application which might be easier to integrated with existing testing pipelines.



leeg

  • Newbie
  • *
    • Posts: 21
    • Karma: +0/-0
Reply #4 on: May 21, 2020, 03:52:36 PM
Oh yeah, that'll definitely be easier for running in CI, thanks.



leeg

  • Newbie
  • *
    • Posts: 21
    • Karma: +0/-0
Reply #5 on: May 22, 2020, 11:48:06 AM
I tried AxRuntime first, unfortunately it's not going to work for me. It was really easy to get installed and set up, but then I hit problems. A small problem is that I was building with the flags "-std=c89 -pedantic -Werror -Wall" with gcc (my project builds with Hisoft C on real Amigas, and I need to remember not to do anything modern/undefined on Linux). I removed those flags and my test program builds. But on running, it runs to completion then traps on exit:

Thread 14 "New Process" received signal SIGTRAP, Trace/breakpoint trap.
[Switching to Thread 0x7fffce7fc700 (LWP 23058)]
RunProgram (sysbase=0x7ffff00017c0, _m=0x7fffffffcac0) at /ssd/deadwood/repo-github-dd-alt-runtimelinux/AROS/arch/all-runtime/axrt/startup/startup_lib.c:222
222     /ssd/deadwood/repo-github-dd-alt-runtimelinux/AROS/arch/all-runtime/axrt/startup/startup_lib.c: No such file or directory.
(gdb) bt
#0  RunProgram (sysbase=0x7ffff00017c0, _m=0x7fffffffcac0) at /ssd/deadwood/repo-github-dd-alt-runtimelinux/AROS/arch/all-runtime/axrt/startup/startup_lib.c:222
#1  0x00007fffef79d4d9 in __program_trampoline () at /ssd/deadwood/repo-github-dd-alt-runtimelinux/AROS/arch/all-runtimelinux/dos/boot.c:83
#2  0x00007fffef79dd0a in CallEntry (argptr=0x0, argsize=0, entry=0x7fffef79d3d4 <__program_trampoline>, me=0x7fffc80167a0)
    at /ssd/deadwood/repo-github-dd-alt-runtimelinux/AROS/arch/all-runtimelinux/dos/exit.c:136
#3  0x00007fffef7a50fa in DosEntry () at /ssd/deadwood/repo-github-dd-alt-runtimelinux/AROS/rom/dos/./createnewproc.c:741
#4  0x00007ffff5d7cf50 in __pthread_trampoline (ptr=0x7fffc8021380) at /ssd/deadwood/repo-github-dd-alt-runtimelinux/AROS/arch/all-runtimelinux/exec/newaddtask.c:287
#5  0x00007ffff75996db in start_thread (arg=0x7fffce7fc700) at pthread_create.c:463
#6  0x00007ffff78d288f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

If you want to look further, check out the libaxrt branch in https://github.com/iamleeg/Amiga-Smalltalk



deadwood

  • AROS Developer
  • Legendary Member
  • *****
    • Posts: 1524
    • Karma: +118/-0
Reply #6 on: May 23, 2020, 12:42:36 AM
So for me to understand: the problem that is blocking you is that the program SIGTRAPs at end instead of gracufully exiting with return code, correct?



leeg

  • Newbie
  • *
    • Posts: 21
    • Karma: +0/-0
Reply #7 on: May 26, 2020, 07:44:02 AM
Yeah, that's right. I'd rather rely on the return code to know whether my tests passed than parse the standard output and ignore any crashing. I know it's possible that I've used something incorrectly and I'm triggering the crash, but that isn't obviously the case based on the backtrace.



deadwood

  • AROS Developer
  • Legendary Member
  • *****
    • Posts: 1524
    • Karma: +118/-0
Reply #8 on: May 26, 2020, 09:01:06 AM
Ok, I got it. The problem is on AxRuntime side, there is some missing functionality. Let me take a stab at implementig it. I should have a patch for you in coming days.



deadwood

  • AROS Developer
  • Legendary Member
  • *****
    • Posts: 1524
    • Karma: +118/-0
Reply #9 on: May 26, 2020, 12:40:10 PM
Try this version:

https://www.axrt.org/development/libaxrt.so.40.1.20200526

Remove the postfix and place libaxrt.so in the same directory as your executable. Alternativelly copy it to /usr/lib/x86_64-linux/gnu/ for system-wide installation.



leeg

  • Newbie
  • *
    • Posts: 21
    • Karma: +0/-0
Reply #10 on: May 29, 2020, 09:40:50 AM
Great! That version works well, and the process exits cleanly. Thank you!



deadwood

  • AROS Developer
  • Legendary Member
  • *****
    • Posts: 1524
    • Karma: +118/-0
Reply #11 on: May 29, 2020, 11:31:13 AM
Great. It will be included in next release. If you run into more problems, let me know.



leeg

  • Newbie
  • *
    • Posts: 21
    • Karma: +0/-0
Reply #12 on: May 29, 2020, 11:55:48 AM
Well, this was quick :). It worked locally, but doesn't work in a github action (which AFAICT is run in an Azure VM, on ubuntu 18.04.4 which is the same host OS I'm using). The problems I encountered:

1. after installing the pkgs, the runner user couldn't read /usr/lib/x86_64-linux-gnu/axrt/2.0//UserSYS/Prefs/Env-Archive/SYS/ahi.prefs, so I had to manually chmod (see https://github.com/iamleeg/Amiga-Smalltalk/runs/721012858?check_suite_focus=true)
2. having changed that, the process crashes on launch. Backtrace:

#0  Exec_69_CloseLibrary (library=0x7ffff0025ee0, SysBase=0x7ffff00017c0)
    at /ssd/deadwood/repo-github-dd-alt-runtimelinux/AROS/arch/all-runtimelinux/exec/closelibrary.c:68
#1  0x00007fffeef71080 in __inline_Exec_CloseLibrary (__arg1=0x7ffff0025ee0,
    __SysBase=0x7ffff00017c0)
    at /ssd/deadwood/repo-github-dd-alt-runtimelinux/alt-runtimelinux-x86_64-d/bin/runtimelinux-x86_64/AROS/Developer/include/inline/exec.h:836
#2  0x00007fffeef7125f in _set_close_libraries_list (
    list=0x7fffef1786d0 <__LIBS_LIST__>, SysBase=0x7ffff00017c0)
    at /ssd/deadwood/repo-github-dd-alt-runtimelinux/AROS/compiler/autoinit/./libraries.c:72
#3  0x00007fffeef5d560 in X11Cl_InitLib (X11ClBase=0x7ffff005ead0,
    segList=0x0, sysBase=0x7ffff00017c0)
    at /ssd/deadwood/repo-github-dd-alt-runtimelinux/alt-runtimelinux-x86_64-d/bin/runtimelinux-x86_64/gen/arch/all-hosted/hidd/x11/x11gfx/x11gfx_start.c:207
#4  0x00007ffff5d8b030 in Exec_17_InitResident (
    resident=0x7fffeef5eb60 <X11Cl_ROMTag>, segList=0x0,
    SysBase=0x7ffff00017c0)
    at /ssd/deadwood/repo-github-dd-alt-runtimelinux/AROS/rom/exec/./initresident.c:129
#5  0x00007ffff5d8ab5c in __inline_Exec_InitResident (
    __arg1=0x7fffeef5eb60 <X11Cl_ROMTag>, __arg2=0x0, __SysBase=0x7ffff00017c0)
    at /ssd/deadwood/repo-github-dd-alt-runtimelinux/alt-runtimelinux-x86_64-d/bin/runtimelinux-x86_64/AROS/Developer/include/inline/exec.h:126
#6  0x00007ffff5d8acd6 in Exec_12_InitCode (startClass=1, version=0,
    SysBase=0x7ffff00017c0)
    at /ssd/deadwood/repo-github-dd-alt-runtimelinux/AROS/rom/exec/./initcode.c:97
#7  0x00007ffff7bc3aed in ?? () from /usr/lib/x86_64-linux-gnu/libaxrt.so
#8  0x00007ffff7bc44ff in ?? () from /usr/lib/x86_64-linux-gnu/libaxrt.so
#9  0x00007ffff7bc45bf in ?? () from /usr/lib/x86_64-linux-gnu/libaxrt.so
#10 0x00007ffff75986db in start_thread (arg=0x7ffff67ac700)
    at pthread_create.c:463
#11 0x00007ffff78d188f in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95



deadwood

  • AROS Developer
  • Legendary Member
  • *****
    • Posts: 1524
    • Karma: +118/-0
Reply #13 on: May 29, 2020, 12:38:42 PM
I tries to connect to X server which you probably don't have installed on your VM? This one will be a bit tougher to resolve, but I remember we had some "fake" X server installed on build AROS machines that was good enough to execute AROS "headless".

Here is what I found in dev ml meails:

"We currently use Xvfb (a null X server) for this purpose."




leeg

  • Newbie
  • *
    • Posts: 21
    • Karma: +0/-0
Reply #14 on: May 29, 2020, 12:52:57 PM
Ah yes, that makes sense, thanks. I’ll try it out.