-
Notifications
You must be signed in to change notification settings - Fork 37
ci: Add NetBSD job #196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: Add NetBSD job #196
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,66 @@ on: | |
| pull_request: | ||
|
|
||
| jobs: | ||
| build-netbsd: | ||
| runs-on: ubuntu-latest | ||
| name: build • netbsd ${{ matrix.release }} | ||
| defaults: | ||
| run: | ||
| shell: netbsd {0} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| # Test all supported releases. | ||
| # See https://www.netbsd.org/releases/. | ||
| include: | ||
| - release: 9.4 | ||
| capnproto-cppflags: 'CPPFLAGS="-DKJ_NO_EXCEPTIONS=0 -DKJ_USE_KQUEUE=0"' | ||
| - release: 10.1 | ||
| capnproto-cppflags: 'CPPFLAGS="-DKJ_NO_EXCEPTIONS=0"' | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - name: Start NetBSD VM | ||
| uses: vmactions/netbsd-vm@v1 | ||
| with: | ||
| release: ${{ matrix.release }} | ||
| # The installed compiler version must match the CXX variable | ||
| # defined in `ci/configs/netbsd.bash`. | ||
| prepare: | | ||
| pkg_add cmake ninja-build gcc14 | ||
| # capnproto prerequisites. | ||
| # See the following "Install capnproto" step. | ||
| run: | | ||
| set -e | ||
| pkg_add digest libtool-base mktools pkgconf cwrappers | ||
| pkg_admin -K /usr/pkg/pkgdb fetch-pkg-vulnerabilities | ||
| cd /usr | ||
| cvs [email protected]:/cvsroot checkout -P \ | ||
| pkgsrc/devel/capnproto \ | ||
| pkgsrc/devel/libtool-base \ | ||
| pkgsrc/devel/pkgconf \ | ||
| pkgsrc/devel/zlib \ | ||
| `# gcc15 is referenced here because the pkgsrc framework requires lang/gcc15/version.mk to exist` \ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In commit "ci: Add NetBSD job" (861da39) Interesting, have not seen |
||
| `# during the "make install" step below, even though we compile our project with gcc14.` \ | ||
| pkgsrc/lang/gcc15 \ | ||
| pkgsrc/mk \ | ||
| pkgsrc/pkgtools \ | ||
| pkgsrc/security/openssl \ | ||
| pkgsrc/sysutils/install-sh/files | ||
| sync: 'rsync' | ||
| copyback: false | ||
|
|
||
| - name: Install capnproto | ||
| run: | | ||
| cd /usr/pkgsrc/devel/capnproto/ | ||
| unset PKG_PATH | ||
| make ${{ matrix.capnproto-cppflags }} install | ||
|
|
||
| - name: Run CI script | ||
| run: | | ||
| cd ${{ github.workspace }} | ||
hebasto marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| CI_CONFIG="ci/configs/netbsd.bash" bash ci/scripts/ci.sh | ||
|
|
||
| build-openbsd: | ||
| runs-on: ubuntu-latest | ||
| name: build • openbsd | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| CI_DESC="CI config for NetBSD" | ||
| CI_DIR=build-netbsd | ||
| export CXXFLAGS="-Werror -Wall -Wextra -Wpedantic -Wno-unused-parameter" | ||
| # Hardcode GCC 14, since default GCC versions installed by NetBSD are older | ||
| # and may not be compatible with libmultiprocess. GCC 14 was chosen because | ||
| # it's the latest compiler available on all versions of NetBSD that we test. | ||
| # Note that the GCC version specified here must match the version specified | ||
| # in pkg_add in ci.yml. | ||
| export CXX="/usr/pkg/gcc14/bin/g++" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In commit "ci: Add NetBSD job" (d6f80ca) Is it necessary to hardcode gcc 14 here? If the gcc version in this file needs to be kept in sync with the gcc version
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
On NetBSD 9.4, the default compiler is GCC 7.5.0, and the build fails at the configuration stage. On NetBSD 10.1, the default compiler is GCC 10.5.0, and the build fails as well:
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Thanks! Updated.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. re: #196 (comment) Thanks for providing the errors. It appears the reason for hardcoding gcc14 is that if you don't hardcode it, netbsd uses much older versions of gcc that don't recognize c++20 or fail with I guess my next question would be why use gcc14 instead of another version of GCC? Was the choice based on trial and error, or any particular reasoning? I think my suggestion would be to add a comment to |
||
| CMAKE_ARGS=(-G Ninja) | ||
| BUILD_ARGS=(-k 0) | ||
Uh oh!
There was an error while loading. Please reload this page.