-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Update action to use native bmake if possible #1452
base: main
Are you sure you want to change the base?
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 |
---|---|---|
|
@@ -2,9 +2,13 @@ name: Cross-build Kernel | |
|
||
on: | ||
push: | ||
branches: [ main, 'stable/14', 'stable/13' ] | ||
branches: | ||
- main | ||
- 'stable/14' | ||
- 'stable/13' | ||
pull_request: | ||
branches: [ main ] | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
permissions: | ||
|
@@ -17,22 +21,27 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
matrix: | ||
target_arch: [ amd64, aarch64 ] | ||
os: [ ubuntu-22.04, ubuntu-24.04, macos-latest ] | ||
target_arch: | ||
- amd64 | ||
- aarch64 | ||
os: | ||
- ubuntu-24.04 | ||
- macos-latest | ||
include: | ||
# TODO: both Ubuntu and macOS have bmake packages, we should try them instead of bootstrapping our own copy. | ||
- os: ubuntu-22.04 | ||
compiler: clang-14 | ||
cross-bindir: /usr/lib/llvm-14/bin | ||
pkgs: bmake libarchive-dev clang-14 lld-14 | ||
- os: ubuntu-24.04 | ||
compiler: clang-18 | ||
cross-bindir: /usr/lib/llvm-18/bin | ||
pkgs: bmake libarchive-dev clang-18 lld-18 | ||
pkgs: libarchive-dev clang-18 lld-18 | ||
llvm-bindir: /usr/lib/llvm-18/bin | ||
llvm-ld: /usr/lib/llvm-18/bin/ld.lld | ||
# the Ubuntu packaged bmake causes build errors | ||
bmake: ./tools/build/make.py | ||
- os: macos-latest | ||
compiler: clang-18 | ||
cross-bindir: /opt/homebrew/opt/llvm@18/bin | ||
pkgs: bmake libarchive llvm@18 | ||
# llvm@19 causes build error | ||
pkgs: bmake libarchive llvm@18 lld | ||
llvm-bindir: /opt/homebrew/opt/llvm@18/bin | ||
llvm-ld: /opt/homebrew/opt/lld/bin/ld.lld | ||
bmake: bmake | ||
- target_arch: amd64 | ||
target: amd64 | ||
- target_arch: aarch64 | ||
|
@@ -51,17 +60,35 @@ jobs: | |
brew install ${{ matrix.pkgs }} || true | ||
- name: create environment | ||
run: | | ||
echo "GITHUB_WORKSPACE = $GITHUB_WORKSPACE" | ||
if [ -n "${{ matrix.cross-bindir }}" ]; then | ||
echo "EXTRA_BUILD_ARGS=--cross-bindir=${{ matrix.cross-bindir }}" >> $GITHUB_ENV | ||
fi | ||
echo "CC=${{ matrix.llvm-bindir }}/clang" >> $GITHUB_ENV | ||
echo "CXX=${{ matrix.llvm-bindir }}/clang++" >> $GITHUB_ENV | ||
echo "CPP=${{ matrix.llvm-bindir }}/clang-cpp" >> $GITHUB_ENV | ||
|
||
echo "XCC=${{ matrix.llvm-bindir }}/clang" >> $GITHUB_ENV | ||
echo "XCXX=${{ matrix.llvm-bindir }}/clang++" >> $GITHUB_ENV | ||
echo "XCPP=${{ matrix.llvm-bindir }}/clang-cpp" >> $GITHUB_ENV | ||
echo "XLD=${{ matrix.llvm-ld }}" >> $GITHUB_ENV | ||
|
||
mkdir -p ../build | ||
echo "MAKEOBJDIRPREFIX=${PWD%/*}/build" >> $GITHUB_ENV | ||
# heh, works on Linux/BSD/macOS ... | ||
echo "NPROC=`getconf _NPROCESSORS_ONLN 2>/dev/null || getconf NPROCESSORS_ONLN 2>/dev/null || echo 1`" >> $GITHUB_ENV | ||
- name: bootstrap bmake | ||
run: ./tools/build/make.py --debug $EXTRA_BUILD_ARGS TARGET=${{ matrix.target }} TARGET_ARCH=${{ matrix.target_arch }} -n | ||
|
||
- name: show environment | ||
run: | | ||
echo Running on $(uname -a) | ||
echo "CWD = $PWD" | ||
echo "GITHUB_WORKSPACE = $GITHUB_WORKSPACE" | ||
echo "Using bmake as ${{ matrix.bmake }}" | ||
echo Using CC=${CC} | ||
echo Using LD=${LD} | ||
echo Using XCC=${XCC} | ||
echo Using XLD=${XLD} | ||
echo Using MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX} | ||
echo Using NPROC=${NPROC} | ||
echo Using EXTRA_MAKE_ARGS=${EXTRA_MAKE_ARGS} | ||
|
||
- name: make kernel-toolchain | ||
run: ./tools/build/make.py --debug $EXTRA_BUILD_ARGS TARGET=${{ matrix.target }} TARGET_ARCH=${{ matrix.target_arch }} kernel-toolchain -s -j$NPROC -DWITH_DISK_IMAGE_TOOLS_BOOTSTRAP | ||
run: ${{ matrix.bmake }} TARGET=${{ matrix.target }} TARGET_ARCH=${{ matrix.target_arch }} -s -j$NPROC kernel-toolchain -DWITH_DISK_IMAGE_TOOLS_BOOTSTRAP | ||
|
||
- name: make buildkernel | ||
run: ./tools/build/make.py --debug $EXTRA_BUILD_ARGS TARGET=${{ matrix.target }} TARGET_ARCH=${{ matrix.target_arch }} KERNCONF=GENERIC NO_MODULES=yes buildkernel -s -j$NPROC $EXTRA_MAKE_ARGS | ||
run: ${{ matrix.bmake }} TARGET=${{ matrix.target }} TARGET_ARCH=${{ matrix.target_arch }} -s -j$NPROC buildkernel KERNCONF=GENERIC NO_MODULES=yes | ||
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. Why eliminate EXTRA_MAKE_ARGS here? 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.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also seems to eliminate ubuntu-22 from the matrix. Is that intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. ubuntu-20 will be kicked out in 4 months (actions/runner-images#11101), ubuntu-latest has started to default to ubuntu-24 (actions/runner-images#10636).
ubuntu-22 is still good for another 2 years, there is no obstacle to put it back, I have honestly not seen any added value to having it around.
Happy to change this.
If you want maximum coverage, we could also add macos-13 (Darwin/amd64).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll have to ask @jrtc27 to see which ones we can drop, since she added this originally.
I think that ubuntu-20 is safe to drop, but I think she (or some other CheriBSD person) had said that they still needed to support ubuntu-22.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We (the CheriBSD project) depend on being able to build on ubuntu-22. We see build regressions specific to older Ubuntu versions with some regularity so it's useful to keep them around so we catch issues before they hit CheriBSD some time later (typically weeks to months).