Skip to content

Add VM-based CI that builds and tests on DragonFly BSD - #2027

Open
neilpang wants to merge 2 commits into
MoarVM:mainfrom
neilpang:add-vm-based-ci
Open

Add VM-based CI that builds and tests on DragonFly BSD#2027
neilpang wants to merge 2 commits into
MoarVM:mainfrom
neilpang:add-vm-based-ci

Conversation

@neilpang

Copy link
Copy Markdown

Closes #1418

#1418 asked for a drop-in test build on FreeBSD and other operating systems using
the vmactions VMs. This adds that workflow as a separate file, so it neither
interferes with nor delays the Azure Pipelines matrix.

What the job does

It runs the guest OS in a VM on an ubuntu-latest runner, builds MoarVM, then
builds NQP against it and runs the NQP test suite -- MoarVM has no test suite of its
own (make test just prints build/test.txt).

Verification run on the exact head of this branch:
https://github.com/neilpang/MoarVM/actions/runs/30349845037 -- 371 compiles,
This is MoarVM version 2026.07-7-ge82d6372a built with JIT support,
Files=145, Tests=13476 ... Result: PASS. The job takes about 5 minutes end to end.

Two things in the job need explaining:

  • --toolchain=gnu. build/setup.pm maps the BSDs to the bsd toolchain, but
    the Makefile that generates cannot be built by BSD make: the object rules use
    $*.c, and BSD make expands $* to the file name without its directory, so
    every compile fails with clang: error: no such file or directory: 'args.c'
    (run). If you would
    rather have the native make path work, the fix is in the $*.c occurrences in
    build/Makefile.in; happy to send that separately.
  • no -j on the MoarVM build. The vendored dyncall build shells out to the base
    system make, which rejects the bare -j that GNU make puts into MAKEFLAGS for
    its job server: make[1]: illegal argument to -j -- must be positive integer!

Why only DragonFly BSD

I tried FreeBSD, OpenBSD, NetBSD and Solaris as well. Each is blocked by a real
portability break rather than by CI configuration, so I left those jobs out instead
of landing a red workflow.

FreeBSD -- 3rdparty/libuv (pinned at MoarVM/libuv@dcd3a3f, the head of
1-50-0-with-pty) has:

#if defined(__DragonFly__) || defined(__FreeBSD__) || \
    defined(__NetBSD__) || defined(__OpenBSD__)
#include <util.h>
#endif

FreeBSD has no <util.h> -- openpty(3) is declared in <libutil.h> and lives in
-lutil. Confirmed absent on 13.5, 14.3 and 15.1, with libutil.h present on each:
run.

Two changes make FreeBSD work, both verified:

  1. MoarVM/libuv: use <libutil.h> on FreeBSD -- PR: unix: include <libutil.h> for openpty() on FreeBSD libuv#1. With it,
    MoarVM builds and the NQP suite passes on 13.5, 14.3 and 15.1:
    run.
  2. build/setup.pm: add util to the FreeBSD syslibs. Without it
    libmoar.so carries an unresolved openpty; the build and the NQP suite still
    pass because nothing in them spawns a pty, but a pty spawn would fail at runtime
    (run). Adding
    util links libutil.so.9 on 13.5 and libutil.so.10 on 15.1
    (run).

I can send the setup.pm change and the FreeBSD job as a follow-up once the libuv
side is settled.

NetBSD and OpenBSD -- 3rdparty/zmij does not compile:

3rdparty/zmij/zmij.c:2076:45: error: 'DBL_DECIMAL_DIG' undeclared
3rdparty/zmij/zmij.c:2076:63: error: 'FLT_DECIMAL_DIG' undeclared

and on NetBSD additionally
zmij.c:151:24: error: expected declaration specifiers or '...' before '__builtin_constant_p'
-- NetBSD's <sys/bswap.h> defines bswap64 as a macro, colliding with zmij's
static inline of the same name. Runs:
OpenBSD,
NetBSD. This arrived
with the Ryu -> Zmij switch (#1986).

Solaris 11.4 -- src/core/args.c:75:33: error: implicit declaration of function 'alloca';
Solaris declares alloca in <alloca.h>.
Run.

Also in this PR

  • README gains a badge for the new workflow, next to the Azure one.
  • actions/checkout@v7, the current major.
  • Both checkouts use fetch-depth: 0 + fetch-tags: true: Configure.pl takes the
    version from git describe --tags, and NQP refuses a MoarVM older than its pinned
    MOAR_REVISION.
  • The run script sets safe.directory, because the tree is synced into the VM and
    ends up owned by a different uid than the build runs as.

neilpang added 2 commits July 28, 2026 18:12
GitHub offers no hosted runner for any of the BSDs, so the job runs the OS
in a VM on top of an ubuntu-latest runner via the vmactions actions. MoarVM
has no test suite of its own, so the job builds NQP against the MoarVM it
just built and runs the NQP test suite.

The workflow is a separate file, so it neither interferes with nor delays
the existing Azure Pipelines matrix.

Closes MoarVM#1418

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new GitHub Actions workflow that runs MoarVM + NQP build/test inside a DragonFly BSD VM (via vmactions) on ubuntu-latest, providing CI coverage for a non-hosted platform without impacting the existing Azure Pipelines matrix.

Changes:

  • Introduces .github/workflows/test_other_platforms.yml to build MoarVM and run the NQP test suite on DragonFly BSD within a VM.
  • Updates README.md to include a GitHub Actions badge for the new workflow.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
README.md Adds a status badge pointing to the new “Test on other platforms” workflow.
.github/workflows/test_other_platforms.yml New VM-based CI job that builds MoarVM and runs NQP tests on DragonFly BSD.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

# is owned by a different uid than the one running the build.
# Without this, `git describe` and the submodule sync that
# Configure.pl runs both fail with "detected dubious ownership".
git config --global --add safe.directory '*'
Comment on lines +12 to +17
pull_request:
branches:
- main
workflow_dispatch:

jobs:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide a test-build for FreeBSD and other operating systems

2 participants