Skip to content

Commit

Permalink
Turns out we might not need LLVM.
Browse files Browse the repository at this point in the history
  • Loading branch information
someguynamedjosh committed Feb 1, 2021
1 parent e991d6b commit 2880240
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 88 deletions.
68 changes: 19 additions & 49 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,66 +21,36 @@ jobs:
- name: Check version numbers
run: ./build.py check_version

build-windows:
runs-on: windows-latest
build:
strategy:
matrix:
os: ['ubuntu-latest', 'windows-latest', 'macOS-latest']
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
with:
lfs: 'true'
- name: Install Dependencies
run: |
echo "Prebuilt LLVM development libraries for Windows because no one else has them apparently."
git clone "https://gitlab.com/Code_Cube/llvm-win.git" "C:\LLVM"
- name: Build
run: python build.py juce_frontend --release --github-runner
env:
LLVM_SYS_70_PREFIX: C:\LLVM\
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: artifacts-bin-windows
path: artifacts/bin/

build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
lfs: 'true'
- name: Install Dependencies
run: |
brew install llvm@7
- name: Build
python-version: '3.7'
- name: MacOS-specific setup
if: ${{ matrix.os == 'macOS-latest' }}
run: |
export OPENSSL_ROOT_DIR=$(brew --prefix openssl)
export OPENSSL_LIB_DIR=$(brew --prefix openssl)"/lib"
export OPENSSL_INCLUDE_DIR=$(brew --prefix openssl)"/include"
./build.py juce_frontend --release --github-runner
env:
LLVM_SYS_70_PREFIX: /usr/local/Cellar/llvm@7/7.1.0_2
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: artifacts-bin-macos
path: artifacts/bin/

build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
lfs: 'true'
- name: Install Dependencies
- name: Linux-specific setup
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
sudo apt update
sudo apt -y install llvm-7 libxrandr-dev libxinerama-dev libxcursor-dev libasound-dev extra-cmake-modules libxcb-shape0-dev libxcb-xfixes0-dev
export LLVM_SYS_70_PREFIX=/usr/bin/llvm-7/
sudo apt -y install libxrandr-dev libxinerama-dev libxcursor-dev libasound-dev extra-cmake-modules libxcb-shape0-dev libxcb-xfixes0-dev
- name: Build
run: ./build.py juce_frontend --release --github-runner
run: python build.py juce_frontend --release --github-runner
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: artifacts-bin-linux
name: artifacts-bin-${{ matrix.os }}
path: artifacts/bin/

build-book:
Expand All @@ -102,7 +72,7 @@ jobs:
path: docs/book/book/

deploy-site:
needs: [build-windows, build-macos, build-linux, build-book]
needs: [build, build-book]
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
Expand All @@ -118,15 +88,15 @@ jobs:
cp -r docs/website/src/* website/
- uses: actions/download-artifact@v2
with:
name: artifacts-bin-windows
name: artifacts-bin-windows-latest
path: website/bin/
- uses: actions/download-artifact@v2
with:
name: artifacts-bin-macos
name: artifacts-bin-macOS-latest
path: website/bin/
- uses: actions/download-artifact@v2
with:
name: artifacts-bin-linux
name: artifacts-bin-ubuntu-latest
path: website/bin/
- uses: actions/download-artifact@v2
with:
Expand Down
42 changes: 3 additions & 39 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ def command(args, working_dir=None):
# Tooling on windows expects forward slashes.
set_env('PROJECT_ROOT', str(PROJECT_ROOT).replace('\\', '/'))
set_env('RUST_OUTPUT_DIR', str(RUST_OUTPUT_DIR).replace('\\', '/'))
set_env('LLVM_CONFIG_PATH', str(PROJECT_ROOT.joinpath(
'dependencies', 'llvm', 'bin', 'llvm-config')).replace('\\', '/'))
set_env('JULIA_DIR', str(PROJECT_ROOT.joinpath(
'dependencies', 'julia')).replace('\\', '/'))
if not ON_WINDOWS:
Expand Down Expand Up @@ -336,40 +334,6 @@ def get_julia_packages():
mark_dep_complete('julia_packages', 1)


def get_llvm():
if should_skip_dep('llvm', 2):
return
print('Setting up LLVM 11...')
checkout_path = Path('dependencies', 'llvm_src')
mkdir(checkout_path)
args = ['git', 'clone', '--depth', '1',
'https://github.com/llvm/llvm-project', '-b', 'release/11.x']
if ON_WINDOWS:
args += ['--config', 'core.autocrlf=false']
command(args, checkout_path)

print('Running cmake to configure build...')
source_path = checkout_path.joinpath('llvm-project')
cmake_path = source_path.joinpath('build')
mkdir(cmake_path)
cmake_command = ['cmake']
if ON_WINDOWS:
cmake_command += ['-GVisual Studio 16 2019']
cmake_command += ['../llvm']
command(cmake_command, cmake_path)

print('Building LLVM...')
command(['cmake', '--build', '.'], cmake_path)

print('Installing built files...')
mkdir(Path('dependencies', 'llvm'))
prefix = Path('dependencies', 'llvm').absolute()
command(['cmake', '-DCMAKE_INSTALL_PREFIX=' + str(prefix),
'-P', 'cmake_install.cmake'], cmake_path)
rmdir(checkout_path)
mark_dep_complete('llvm', 2)


def get_julia():
if should_skip_dep('julia', 1):
return
Expand Down Expand Up @@ -397,7 +361,8 @@ def get_julia():
print('Extracting...')
command(['hdiutil', 'attach', target])
rmdir('dependencies/julia')
command(['cp', '-r', '/Volumes/Julia-1.5.3/Julia-1.5.app/Contents/Resources/julia/', 'dependencies/julia'])
command(
['cp', '-r', '/Volumes/Julia-1.5.3/Julia-1.5.app/Contents/Resources/julia/', 'dependencies/julia'])
rmdir(target)
if ON_LINUX:
url = 'https://julialang-s3.julialang.org/bin/linux/x64/1.5/julia-1.5.3-linux-x86_64.tar.gz'
Expand Down Expand Up @@ -447,9 +412,8 @@ def __init__(self, description, dependencies, executor):
'clean': Job('Delete all artifacts and intermediate files', [], clean),
'dep_julia': Job('Build the "julia" dependency', [], get_julia),
'dep_julia_packages': Job('Build the "julia_packages" dependency', [], get_julia_packages),
'dep_llvm': Job('Build the "llvm" dependency', [], get_llvm),
'dep_juce': Job('Build the "juce" dependency', [], get_juce),
'deps': Job('Download or build necessary dependencies', ['dep_julia', 'dep_julia_packages', 'dep_llvm', 'dep_juce'], get_dependencies),
'deps': Job('Download or build necessary dependencies', ['dep_julia', 'dep_julia_packages', 'dep_juce'], get_dependencies),
'env': Job('Run a terminal after setting variables and installing deps', ['deps'], open_terminal),
'remove_juce_splash': Job('Remove JUCE splash screen (Audiobench is GPLv3)', [], remove_juce_splash),
'clib': Job('Build Audiobench as a static library', ['deps'], build_clib),
Expand Down

0 comments on commit 2880240

Please sign in to comment.