]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - .github/workflows/cross-bootstrap-tools.yml
Move SYSCTL_ADD_PROC() to unlocked context in if_ure to avoid lock order reversal.
[FreeBSD/FreeBSD.git] / .github / workflows / cross-bootstrap-tools.yml
1 name: Cross-build Kernel
2
3 on:
4   push:
5     branches: [ master ]
6   pull_request:
7     branches: [ master ]
8
9 jobs:
10   build:
11     name: ${{ matrix.os }} (${{ matrix.compiler }})
12     runs-on: ${{ matrix.os }}
13     strategy:
14       fail-fast: false
15       matrix:
16         include:
17           # TODO: both Ubuntu and macOS have bmake packages, we should try them instead of bootstrapping our own copy.
18           - os: ubuntu-20.04
19             compiler: clang-9
20             cross-bindir: /usr/lib/llvm-9/bin
21             pkgs: bmake libarchive-dev
22           - os: ubuntu-20.04
23             compiler: clang-10
24             cross-bindir: /usr/lib/llvm-10/bin
25             pkgs: bmake libarchive-dev
26           - os: macOS-latest
27             compiler: clang-11
28             #cross-bindir: /usr/local/Cellar/llvm/11.0.0/bin  # script figures this out automatically
29             pkgs: bmake libarchive llvm@11
30
31     steps:
32       - uses: actions/checkout@v2
33       - name: install packages (Ubuntu)
34         if: runner.os == 'Linux'
35         run: |
36           sudo apt-get update --quiet || true
37           sudo apt-get -yq --no-install-suggests --no-install-recommends install ${{ matrix.pkgs }}
38       - name: install packages (macOS)
39         if: runner.os == 'macOS'
40         run: |
41           brew update --quiet || true
42           brew install ${{ matrix.pkgs }}
43       - name: create environment
44         run: |
45           echo "GITHUB_WORKSPACE = $GITHUB_WORKSPACE"
46           if [ -n "${{ matrix.cross-bindir }}" ]; then
47             echo "EXTRA_BUILD_ARGS=--cross-bindir=${{ matrix.cross-bindir }}" >> $GITHUB_ENV
48           fi
49           mkdir -p ../build
50           echo "MAKEOBJDIRPREFIX=${PWD%/*}/build" >> $GITHUB_ENV
51           # heh, works on Linux/BSD/macOS ...
52           echo "NPROC=`getconf _NPROCESSORS_ONLN 2>/dev/null || getconf NPROCESSORS_ONLN 2>/dev/null || echo 1`" >> $GITHUB_ENV
53       - name: bootstrap bmake
54         run: ./tools/build/make.py --debug $EXTRA_BUILD_ARGS TARGET=amd64 TARGET_ARCH=amd64 -n
55       - name: make kernel-toolchain
56         run: ./tools/build/make.py --debug $EXTRA_BUILD_ARGS TARGET=amd64 TARGET_ARCH=amd64 kernel-toolchain -s -j$NPROC
57       - name: make buildkernel
58         run: ./tools/build/make.py --debug $EXTRA_BUILD_ARGS TARGET=amd64 TARGET_ARCH=amd64 KERNCONF=GENERIC NO_MODULES=yes buildkernel -s -j$NPROC $EXTRA_MAKE_ARGS