chore: upgrade corrade to cci.20260327 to fix macOS build #498
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | ||
| name: Cross Compilation | ||
| on: | ||
| workflow_dispatch: | ||
| pull_request: | ||
| branches: | ||
| - develop | ||
| push: | ||
| branches: | ||
| - develop | ||
| jobs: | ||
| pkvisor: | ||
| name: pktvisor | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - arch: x86_64 | ||
| conan_arch: x86_64 | ||
| toolchain: https://github.com/netboxlabs/pktvisor/releases/download/toolchains/x86_64-linux-musl-cross.tgz | ||
| cc: x86_64-linux-musl-gcc | ||
| cxx: x86_64-linux-musl-g++ | ||
| ldflags: "-static" | ||
| # - arch: armv7lh # ARMv7 little-endian hard-float | ||
| # conan_arch: armv7hf | ||
| # toolchain: https://github.com/netboxlabs/pktvisor/releases/download/toolchains/armv7l-linux-musleabihf-cross.tgz | ||
| # cc: armv7l-linux-musleabihf-gcc | ||
| # cxx: armv7l-linux-musleabihf-g++ | ||
| - arch: aarch64 | ||
| conan_arch: armv8 | ||
| toolchain: https://github.com/netboxlabs/pktvisor/releases/download/toolchains/aarch64-linux-musl-cross.tgz | ||
| cc: aarch64-linux-musl-gcc | ||
| cxx: aarch64-linux-musl-g++ | ||
| ldflags: "-static" | ||
| env: | ||
| CC: gcc | ||
| CXX: g++ | ||
| steps: | ||
| - name: Install sccache from cache | ||
| id: cache-sccache | ||
| uses: actions/cache@v5 | ||
| with: | ||
| path: bin/sccache | ||
| key: sccache-v0.2.15 | ||
| - name: Install sccache | ||
| if: steps.cache-sccache.outputs.cache-hit != 'true' | ||
| run: | | ||
| mkdir -p bin | ||
| curl -L https://github.com/mozilla/sccache/releases/download/v0.2.15/sccache-v0.2.15-x86_64-unknown-linux-musl.tar.gz | \ | ||
| tar -C bin -xz --strip-components=1 sccache-v0.2.15-x86_64-unknown-linux-musl/sccache | ||
| chmod +x bin/sccache | ||
| - name: Install compiler toolchain from cache | ||
| id: cache-toolchain | ||
| uses: actions/cache@v5 | ||
| with: | ||
| path: toolchain | ||
| key: toolchain-test-${{matrix.toolchain}} | ||
| - name: Install compiler toolchain | ||
| if: steps.cache-toolchain.outputs.cache-hit != 'true' | ||
| run: | | ||
| mkdir -p toolchain | ||
| curl -L "${{matrix.toolchain}}" | tar -C toolchain -xz --strip-components=1 | ||
| - name: Install Conan | ||
| run: pip install --no-cache-dir conan --force-reinstall | ||
| - name: Restore sccache | ||
| uses: actions/cache@v5 | ||
| with: | ||
| path: ~/.cache/sccache | ||
| key: sccache-${{matrix.arch}}-${{github.head_ref||github.event.ref}}-${{github.run_id}} | ||
| restore-keys: | | ||
| sccache-${{matrix.arch}}-${{github.head_ref||github.event.ref}}- | ||
| sccache-${{matrix.arch}}-${{github.base_ref||github.event.repository.default_branch}}- | ||
| - name: Checkout sources | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| path: src | ||
| - name: Create Conan configuration | ||
| working-directory: ${{github.workspace}}/src | ||
| run: | | ||
| mkdir build/ | ||
| conan config list | ||
| python3 -c 'import yaml; p = "build/settings.yml"; d = yaml.safe_load(open(p)); d["compiler"]["gcc"]["libc"] = ["glibc", "musl"]; yaml.safe_dump(d, open(p, "w"))' | ||
| conan profile detect | ||
| echo "compiler.libc=glibc" >> $(conan profile path default) | ||
| - name: Create Conan host profile | ||
| working-directory: ${{github.workspace}}/src | ||
| run: | | ||
| cat > "$(conan config home)/profiles/host" << "EOF" | ||
| [settings] | ||
| os=Linux | ||
| arch=${{matrix.conan_arch}} | ||
| compiler=gcc | ||
| compiler.version=11 | ||
| compiler.cppstd=17 | ||
| compiler.libcxx=libstdc++11 | ||
| compiler.libc=musl | ||
| build_type=Release | ||
| [buildenv] | ||
| CC=${{github.workspace}}/toolchain/bin/${{matrix.cc}} | ||
| CXX=${{github.workspace}}/toolchain/bin/${{matrix.cxx}} | ||
| LDFLAGS=${{matrix.ldflags}} | ||
| EOF | ||
| - name: Setup Conan Cache | ||
| uses: actions/cache@v5 | ||
| with: | ||
| path: ${{github.workspace}}/src/build/p/ | ||
| key: conan-${{ runner.os }}-${{matrix.arch}}-${{ hashFiles('**/conanfile.py', 'src/conan/corrade/**') }} | ||
| restore-keys: conan-${{ runner.os }}-${{matrix.arch}}- | ||
| - name: Export local Corrade recipe | ||
| run: conan export ${{github.workspace}}/src/conan/corrade/ --name=corrade --version=cci.20260327 | ||
| - name: Install dependencies | ||
| working-directory: ${{github.workspace}}/src | ||
| run: | | ||
| conan install . -pr:b=default -pr:h="host" --build=missing | ||
| - name: Configure | ||
| working-directory: ${{github.workspace}}/src/build | ||
| run: | | ||
| export CC CXX | ||
| export LDFLAGS=-static | ||
| source Release/generators/conanbuild.sh | ||
| cmake .. \ | ||
| -DCMAKE_BUILD_TYPE=Release \ | ||
| -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=./cmake/conan_provider.cmake \ | ||
| -DCONAN_HOST_PROFILE="host" \ | ||
| -DCONAN_INSTALL_ARGS=--build=never \ | ||
| -DCRASHPAD_NOT_SUPPORTED=true \ | ||
| -DCMAKE_C_COMPILER_LAUNCHER="${{github.workspace}}/bin/sccache" -DCMAKE_CXX_COMPILER_LAUNCHER="${{github.workspace}}/bin/sccache" \ | ||
| -DCORRADE_RC_PROGRAM=$(command -v corrade-rc) \ | ||
| -DCMAKE_CXX_STANDARD_LIBRARIES=-latomic | ||
| - name: Build | ||
| working-directory: ${{github.workspace}}/src/build | ||
| run: make -j4 VERBOSE=1 | ||
| - name: Print sccache stats | ||
| run: | | ||
| "${{github.workspace}}/bin/sccache" -s | ||
| - name: Upload pktvisord | ||
| uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: pktvisord-linux-${{matrix.arch}}-static | ||
| path: ${{github.workspace}}/src/build/bin/pktvisord | ||
| retention-days: 7 | ||
| - name: Upload pktvisor-reader | ||
| uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: pktvisor-reader-linux-${{matrix.arch}}-static | ||
| path: ${{github.workspace}}/src/build/bin/pktvisor-reader | ||
| retention-days: 7 | ||
| pkvisor-cli: | ||
| name: pktvisor-cli | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| os: [ linux, macos ] | ||
| arch: [ x86_64, armv7lh, aarch64 ] | ||
| exclude: | ||
| - os: macos | ||
| arch: armv7lh | ||
| steps: | ||
| - name: Checkout sources | ||
| uses: actions/checkout@v6 | ||
| - name: Install Conan | ||
| run: pip install --no-cache-dir conan --force-reinstall | ||
| - name: Export local Corrade recipe | ||
| run: conan export ${{github.workspace}}/conan/corrade/ --name=corrade --version=cci.20260327 | ||
| - name: Configure CMake to generate VERSION | ||
| shell: bash | ||
| run: VERSION_ONLY=1 cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=./cmake/conan_provider.cmake | ||
| - name: Rename folder and copy version | ||
| shell: bash | ||
| run: | | ||
| mv src pktvisor-src | ||
| cp -rpf golang/pkg/client/version.go . | ||
| - name: Build pktvisor-cli macos | ||
| if: ${{matrix.os}} == macos | ||
|
Check warning on line 202 in .github/workflows/build_cross.yml
|
||
| uses: ./.github/actions/build-go | ||
| with: | ||
| context: "." | ||
| file: "./Dockerfile" | ||
| goos: "darwin" | ||
| - name: Build pktvisor-cli linux armv7lh | ||
| if: ${{matrix.arch}} == armv7lh | ||
|
Check warning on line 210 in .github/workflows/build_cross.yml
|
||
| uses: ./.github/actions/build-go | ||
| with: | ||
| context: "." | ||
| file: "./Dockerfile" | ||
| goos: "linux" | ||
| goarch: "arm" | ||
| - name: Build pktvisor-cli linux aarch64 | ||
| if: ${{matrix.arch}} == aarch64 | ||
|
Check warning on line 219 in .github/workflows/build_cross.yml
|
||
| uses: ./.github/actions/build-go | ||
| with: | ||
| context: "." | ||
| file: "./Dockerfile" | ||
| goos: "linux" | ||
| goarch: "arm64" | ||
| - name: Upload pktvisor-cli | ||
| uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: pktvisor-cli-${{matrix.os}}-${{matrix.arch}} | ||
| path: pktvisor-cli | ||
| retention-days: 7 | ||