Skip to content

CI: Add FreeBSD, OpenBSD and NetBSD builds - #571

Open
mobin-2008 wants to merge 1 commit into
davmac314:masterfrom
mobin-2008:dinit_freebsd_cross_ci
Open

CI: Add FreeBSD, OpenBSD and NetBSD builds#571
mobin-2008 wants to merge 1 commit into
davmac314:masterfrom
mobin-2008:dinit_freebsd_cross_ci

Conversation

@mobin-2008

Copy link
Copy Markdown
Collaborator

Introduce CI builds for three BSD operating systems using cross-platform-actions, based on QEMU virtual machines accelerated with KVM for near-native performance.

The FreeBSD build enables additional Clang hardening checks to detect issues such as integer overflow and to improve memory safety.

Changes are self-reviewed and tested in my fork: https://github.com/mobin-2008/dinit/actions/runs/30704553393/job/91381298660

Addresses #558

Introduce CI builds for three BSD operating systems using
cross-platform-actions, based on QEMU virtual machines accelerated with
KVM for near-native performance.

The FreeBSD build enables additional Clang hardening checks to detect
issues such as integer overflow and to improve memory safety.

Addresses davmac314#558
@mobin-2008 mobin-2008 added P-BSD Things related to BSD A-Importance: Normal CI Things about CI/CD labels Aug 1, 2026
runs-on: ubuntu-latest
defaults:
run:
shell: cpa.sh {0} --environment-variables CXX

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I had to look up documentation to find out what "cpa.sh" is and does. It should have comments to explain (at least briefly) what it is and where to find more information.

Is --environment-variables CXX necessary? Wouldn't it be cleaner to specify the environment_variables input to the action?

Comment on lines +154 to +159
# Make "configure" always use clang++. Our NetBSD image has g++ 10 pre-installed, and
# "configure" prefers it over clang++, but g++ 10 is too old to build Dinit.
# Note that it's defined here for all the BSDs because it's cleaner than specifying it only
# for NetBSD. FreeBSD already uses clang++ due to the lack of g++ in its image and OpenBSD
# uses a static mconfig that specifies clang++ as the C++ compiler.
CXX: clang++

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Specifying CXX as clang++ via the build (and/or configure) command line would be simpler than forcing it into the environment, wouldn't it?

In "Note that it's defined here" why is this a "Note" and what is "it"?

# uses a static mconfig that specifies clang++ as the C++ compiler.
CXX: clang++
strategy:
fail-fast: false # Be able to upload src/igr-tests/igr-output/ files in igr-tests step

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I don't think the comment accurately describes what this is needed for.

See documentation here: https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#jobsjob_idstrategyfail-fast

with:
operating_system: ${{ matrix.name }}
version: ${{ matrix.version }}
- name: Getting dependencies (FreeBSD)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Rather than "Getting dependencies" maybe "Installing required packages". It is more descriptive and more accurate. The packages being installed are not dependencies of Dinit.

Comment on lines +211 to +212
- name: Print dinit executable file architecture
run: file ./src/dinit

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Isn't this redundant considering clang++ -dumpmachine/clang++ --version above?

Comment on lines +198 to +199
clang++ -dumpmachine
clang++ --version

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Does clang++ -dumpmachine display anything that clang++ --version doesn't already?

run: gmake check-igr
- name: Upload igr-tests output file(s) on failure
uses: actions/upload-artifact@v6.0.0
if: failure()

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Doesn't this mean igr-tests output is uploaded if any prior step fails even if the integration tests pass?

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

Labels

A-Importance: Normal CI Things about CI/CD P-BSD Things related to BSD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants