Browse Source

Fix build system errors (#878)

* 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/880/head
Hamish Coleman 3 years ago
committed by GitHub
parent
commit
b9eac35c00
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 - name: Install packages needed for build
run: | run: |
sudo apt-get update
sudo apt-get install debhelper build-essential \ sudo apt-get install debhelper build-essential \
crossbuild-essential-${{ matrix.arch }} crossbuild-essential-${{ matrix.arch }}
@ -345,10 +346,16 @@ jobs:
path: binaries path: binaries
binaries_macos: binaries_macos:
name: Binaries for MacOS (x86_64-apple-darwin) name: Binaries for MacOS
needs: needs:
- test_macos - test_macos
runs-on: macos-latest runs-on: macos-latest
strategy:
fail-fast: true
matrix:
arch:
- x86_64-apple-macos
- arm64-apple-macos
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@ -360,14 +367,62 @@ jobs:
- name: Configure and Build - name: Configure and Build
shell: bash shell: bash
run: | run: |
# this is a hack! it assumes the default SDK is the 'right' one
export SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
./autogen.sh ./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 ./configure
make make
- name: Create binary dir - name: Create binary dir
shell: bash shell: bash
run: | run: |
make install DESTDIR=binaries/x86_64-apple-darwin make install DESTDIR=binaries/universal-apple-darwin
- name: Upload binary artifacts - name: Upload binary artifacts
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
@ -399,6 +454,7 @@ jobs:
- name: Install cross compiler - name: Install cross compiler
run: | run: |
sudo apt-get update
sudo apt-get install \ sudo apt-get install \
binutils-${{ matrix.arch }} \ binutils-${{ matrix.arch }} \
gcc-${{ matrix.arch }} gcc-${{ matrix.arch }}
@ -431,6 +487,7 @@ jobs:
- package_rpm - package_rpm
- binaries_windows - binaries_windows
- binaries_macos - binaries_macos
- binaries_macos_universal
- binaries_linux_crosscompile - binaries_linux_crosscompile
runs-on: ubuntu-latest runs-on: ubuntu-latest

Loading…
Cancel
Save