From 288024031d8f1c8906c7b586692c858faac5cc83 Mon Sep 17 00:00:00 2001 From: joshua-maros <60271685+joshua-maros@users.noreply.github.com> Date: Sun, 31 Jan 2021 17:03:27 -0800 Subject: [PATCH] Turns out we might not need LLVM. --- .github/workflows/build.yml | 68 +++++++++++-------------------------- build.py | 42 ++--------------------- 2 files changed, 22 insertions(+), 88 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fe49dcd2..10f2147c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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: @@ -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: @@ -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: diff --git a/build.py b/build.py index fcb6f4fc..4635d5f4 100755 --- a/build.py +++ b/build.py @@ -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: @@ -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 @@ -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' @@ -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),