Browse Source

Fix build system errors (#879)

* Attempt cross compiling for apple silicon

* Try the apple expected compiler

* Make config.log viewable to figure out the compiler error

* Attempt to install the missing architecture

* Leave this branch in a working and documented what is missing state

* Try cross-compiling on macos with a specific SDK version

* Every now and again the runner pacakge db gets out of sync with reality - avoid this ever stopping a build, at the expense of making the builds take longer to run

* Add needed macos cross compile linker flag

* Fix package db sync for binaries build as well

* Add a fat binary build

* Add missing dep on the new binaries_macos_universal build

* Copy the macos cross compile artifacts into the right shared binaries bucket

* Use the correct arch-based subdir name for macos binaries
pull/881/head
Hamish Coleman 3 years ago
committed by GitHub
parent
commit
d2683f2c23
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 61
      .github/workflows/tests.yml

61
.github/workflows/tests.yml

@ -253,6 +253,7 @@ jobs:
- name: Install packages needed for build
run: |
sudo apt-get update
sudo apt-get install debhelper build-essential \
crossbuild-essential-${{ matrix.arch }}
@ -345,10 +346,16 @@ jobs:
path: binaries
binaries_macos:
name: Binaries for MacOS (x86_64-apple-darwin)
name: Binaries for MacOS
needs:
- test_macos
runs-on: macos-latest
strategy:
fail-fast: true
matrix:
arch:
- x86_64-apple-macos
- arm64-apple-macos
steps:
- uses: actions/checkout@v2
@ -360,14 +367,62 @@ jobs:
- name: Configure and Build
shell: bash
run: |
# this is a hack! it assumes the default SDK is the 'right' one
export SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
./autogen.sh
export CC=clang
export CFLAGS="-target ${{ matrix.arch }}"
export LDFLAGS="-target ${{ matrix.arch }}"
./configure --host=${{ matrix.arch }}
make
- if: ${{ failure() }}
name: Upload config.log output
uses: actions/upload-artifact@v2
with:
name: config-log-${{ matrix.arch }}
path: config.log
- name: Create binary dir
shell: bash
run: |
make install DESTDIR=binaries/${{ matrix.arch }}
- name: Upload binary artifacts
uses: actions/upload-artifact@v2
with:
name: binaries
path: binaries
binaries_macos_universal:
name: Binaries for MacOS (universal arch)
needs:
- test_macos
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Install packages needed for build
run: |
brew install automake
- name: Configure and Build
shell: bash
run: |
# this is a hack! it assumes the default SDK is the 'right' one
export SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
./autogen.sh
export CC=clang
export CFLAGS="-arch x86_64 -arch arm64"
export LDFLAGS="-arch x86_64 -arch arm64"
./configure
make
- name: Create binary dir
shell: bash
run: |
make install DESTDIR=binaries/x86_64-apple-darwin
make install DESTDIR=binaries/universal-apple-darwin
- name: Upload binary artifacts
uses: actions/upload-artifact@v2
@ -399,6 +454,7 @@ jobs:
- name: Install cross compiler
run: |
sudo apt-get update
sudo apt-get install \
binutils-${{ matrix.arch }} \
gcc-${{ matrix.arch }}
@ -431,6 +487,7 @@ jobs:
- package_rpm
- binaries_windows
- binaries_macos
- binaries_macos_universal
- binaries_linux_crosscompile
runs-on: ubuntu-latest

Loading…
Cancel
Save