Skip to content

Commit

Permalink
ci: Use llvm-12 formula instead of llvm-hs one
Browse files Browse the repository at this point in the history
  • Loading branch information
aboeglin committed Jun 18, 2023
1 parent 053db3b commit 717fffc
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 11 deletions.
98 changes: 98 additions & 0 deletions .github/workflows/_release-x86_64-apple-darwin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: 'Build osx target for release'

on:
workflow_dispatch:
inputs:
version:
description: 'Version to release ( ex: v0.0.1 )'
required: true

env:
node-version: 14.x

jobs:
release:
runs-on: macos-11
steps:
- uses: actions/checkout@v2

- uses: haskell/actions/setup@v2
with:
ghc-version: "8.10.7"
cabal-version: "3.4.0.0"
stack-version: "2.7.3"
enable-stack: true

- name: Configure stack
run: stack config set system-ghc --global true

- name: Use Node.js ${{ env.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ env.node-version }}

- name: Install rollup
run: npm i -g rollup @rollup/plugin-node-resolve

- name: Brew update
run: brew update

- name: Install LLVM 12
run: brew install llvm-hs/llvm/llvm-12
# run: HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=TRUE brew install llvm-hs/llvm/llvm-12

- name: Fix libffi
run: ln -s /usr/local/opt/libffi/lib/libffi.dylib /usr/local/opt/libffi/lib/libffi.7.dylib

# - name: Fix llvm install
# run: cd /usr/local/Cellar/llvm-9/9.0.1/bin/ && ln -s llvm-config-9 llvm-config || cd /usr/local/Cellar/llvm-9/9.0.1.reinstall/bin/ && ln -s llvm-config-9 llvm-config

- name: Install alex and happy
run: stack install alex happy

- name: Build madlib executable
run: stack build

# - name: Build madlib executable
# run: |
# export PATH="$PATH:/usr/local/Cellar/llvm-9/9.0.1/bin:/usr/local/Cellar/llvm-9/9.0.1.reinstall/bin"
# stack build

- name: Add rpath
run: install_name_tool -change /usr/local/opt/llvm-12/lib/llvm-12/lib/libc++.1.0.dylib /usr/lib/libc++.1.dylib "$(stack path --dist-dir)/build/madlib/madlib"

- name: Install automake
run: brew install autoconf automake nasm libtool perl

- name: Build runtime
run: |
TARGET="MACOS_X64" ./scripts/build-runtime-libs
TARGET="MACOS_X64" AR="llvm-ar-12" ./scripts/build-runtime
- name: Build tools
run: ./scripts/build

- name: Bundle archive
run: |
mkdir madlib-x86_64-apple-darwin
cp "$(stack path --dist-dir)/build/madlib/madlib" ./madlib-x86_64-apple-darwin/madlib
cp -R runtime ./madlib-x86_64-apple-darwin/
cp -R prelude ./madlib-x86_64-apple-darwin/
cp ./tools/package-installer/dist/package-installer.js ./madlib-x86_64-apple-darwin/
tar -czvf madlib-x86_64-apple-darwin.tar.gz madlib-x86_64-apple-darwin
- uses: pdamianik/release-tag-to-upload-url-action@v1.0.1
id: release_upload_url
with:
tag: ${{ github.event.inputs.version }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Upload build
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release_upload_url.outputs.uploadUrl }}
asset_path: ./madlib-x86_64-apple-darwin.tar.gz
asset_name: madlib-x86_64-apple-darwin.tar.gz
asset_content_type: application/tar+gzip
14 changes: 3 additions & 11 deletions .github/workflows/release-x86_64-apple-darwin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,36 +38,28 @@ jobs:
run: brew update

- name: Install LLVM 12
run: brew install llvm-hs/llvm/llvm-12
run: brew install llvm-12
# run: HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=TRUE brew install llvm-hs/llvm/llvm-12

- name: Fix libffi
run: ln -s /usr/local/opt/libffi/lib/libffi.dylib /usr/local/opt/libffi/lib/libffi.7.dylib

# - name: Fix llvm install
# run: cd /usr/local/Cellar/llvm-9/9.0.1/bin/ && ln -s llvm-config-9 llvm-config || cd /usr/local/Cellar/llvm-9/9.0.1.reinstall/bin/ && ln -s llvm-config-9 llvm-config

- name: Install alex and happy
run: stack install alex happy

- name: Build madlib executable
run: stack build

# - name: Build madlib executable
# run: |
# export PATH="$PATH:/usr/local/Cellar/llvm-9/9.0.1/bin:/usr/local/Cellar/llvm-9/9.0.1.reinstall/bin"
# stack build

- name: Add rpath
run: install_name_tool -change /usr/local/opt/llvm-12/lib/llvm-12/lib/libc++.1.0.dylib /usr/lib/libc++.1.dylib "$(stack path --dist-dir)/build/madlib/madlib"
run: install_name_tool -change /usr/local/opt/llvm/lib/llvm/lib/libc++.1.0.dylib /usr/lib/libc++.1.dylib "$(stack path --dist-dir)/build/madlib/madlib"

- name: Install automake
run: brew install autoconf automake nasm libtool perl

- name: Build runtime
run: |
TARGET="MACOS_X64" ./scripts/build-runtime-libs
TARGET="MACOS_X64" AR="llvm-ar-12" ./scripts/build-runtime
TARGET="MACOS_X64" AR="llvm-ar" ./scripts/build-runtime
- name: Build tools
run: ./scripts/build
Expand Down

0 comments on commit 717fffc

Please sign in to comment.