diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 53e3187..11a8436 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,109 +6,67 @@ on: - 'v*' jobs: - build-x64-linux: + build-linux: timeout-minutes: 360 - env: - VCPKG_DEP_LIST: x64-linux - VCPKG_FEATURE_FLAGS: -binarycaching - runs-on: [self-hosted, linux, X64, dep-builder] + container: + image: nebulastream/nes-development-base:latest strategy: fail-fast: false matrix: - osversion: [ubuntu-22.04] + arch: [x64, arm64] stdlib: [libc++, stdlibc++] sanitizer: [null, 'Address', 'Thread', 'Undefined'] + runs-on: [self-hosted, linux, "${{ matrix.arch }}", dep-builder] steps: - uses: AutoModality/action-clean@v1 - uses: actions/checkout@v2 with: submodules: 'recursive' - - name: Set output vars to the actual tag name - id: vars - run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} - - name: Build Docker - id: builddocker - working-directory: ${{ github.workspace }}/docker/ - run: docker build -t nes_clang_build_${{ matrix.osversion }} -f Dockerfile-${{ matrix.osversion }} . - name: Build Clang id: installdeps run: | - echo "${{ matrix.stdlib }}" - docker run -v ${{ github.workspace }}:/build_dir -e ENABLE_SANITIZER=${{ matrix.sanitizer || '' }} -e STDLIB=${{ matrix.stdlib }} --rm nes_clang_build_${{ matrix.osversion }} \ - ./build_dir/build_ubuntu-x64.sh - - name: Compress artifacts - id: compressdeps - run: | - 7z a nes-clang-18-${{ matrix.osversion }}-${{ matrix.stdlib }}-X64-${{ matrix.sanitizer || 'None' }}.7z clang -mx9 -aoa - - name: Release - uses: softprops/action-gh-release@v1 - id: createrelease - with: - files: | - nes-clang-18-${{ matrix.osversion }}-${{ matrix.stdlib }}-X64-${{ matrix.sanitizer || 'None' }}.7z - - name: Clean build artifacts - id: cleanbuildartifacts - if: always() - run: | - rm -rf llvm-project - rm -rf .git - rm -rf clang - - name: Remove docker image - id: removedockerimage - if: always() - run: | - test -n "$(docker image ls -q nes_clang_build_${{ matrix.osversion }})" && \ - docker image rm $(docker image ls -q nes_clang_build_${{ matrix.osversion }}) || \ - true - build-arm-linux: - env: - VCPKG_DEP_LIST: arm64-linux - VCPKG_FEATURE_FLAGS: -binarycaching - runs-on: [self-hosted, linux, ARM64, dep-builder] - strategy: - matrix: - osversion: [ubuntu-22.04] - stdlib: [libc++, stdlibc++] - sanitizer: [null, 'Address', 'Thread', 'Undefined'] - steps: - - uses: AutoModality/action-clean@v1 - - uses: actions/checkout@v2 - with: - submodules: 'recursive' - - name: Set output vars to the actual tag name - id: vars - run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} - - name: Build Docker - id: builddocker - working-directory: ${{ github.workspace }}/docker/ - run: docker build -t nes_clang_build_${{ matrix.osversion }} -f Dockerfile-${{ matrix.osversion }} . - - name: Build Clang - id: installdeps - run: | - docker run -v ${{ github.workspace }}:/build_dir -e ENABLE_SANITIZER=${{ matrix.sanitizer || '' }} -e STDLIB=${{ matrix.stdlib }} --rm nes_clang_build_${{ matrix.osversion }} \ - ./build_dir/build_ubuntu-arm64.sh - - name: Compress artifacts - id: compressdeps - run: | - 7z a nes-clang-18-${{ matrix.osversion }}-${{ matrix.stdlib }}-arm64-${{ matrix.sanitizer || 'None' }}.7z clang -mx9 -aoa + if [ "${{ matrix.stdlib }}" == "libc++" ]; then + CXX_FLAGS="-stdlib=libc++ -std=c++20" + LINKER_FLAGS="-lc++" + elif [ "${{ matrix.stdlib }}" == "stdlibc++" ]; then + CXX_FLAGS="-std=c++20" + LINKER_FLAGS="" + fi + + if [ ! -z "${{ matrix.sanitizer || '' }}" ]; then + ADDITIONAL_FLAGS="${ADDITIONAL_FLAGS} -DLLVM_USE_SANITIZER=${ENABLE_SANITIZER}" + fi + + if [ ! -z "${CXX_FLAGS}" ]; then + ADDITIONAL_FLAGS="${ADDITIONAL_FLAGS} -DCMAKE_CXX_FLAGS=\"${CXX_FLAGS}\"" + fi + + if [ ! -z "${LINKER_FLAGS}" ]; then + ADDITIONAL_FLAGS="${ADDITIONAL_FLAGS} -DCMAKE_EXE_LINKER_FLAGS=\"${LINKER_FLAGS}\"" + fi + + cmake -G Ninja -S llvm -B build -DCMAKE_BUILD_TYPE=Release \ + -DLLVM_ENABLE_PROJECTS="mlir" \ + -DBOOTSTRAP_LLVM_ENABLE_LTO=ON \ + -DLLVM_INCLUDE_EXAMPLES=OFF \ + -DLLVM_INCLUDE_TESTS=OFF \ + -DLLVM_INCLUDE_BENCHMARKS=OFF \ + -DLLVM_BUILD_EXAMPLES=OFF \ + -DLIBCXX_INCLUDE_BENCHMARKS=OFF \ + -DLLVM_OPTIMIZED_TABLEGEN=ON \ + -DCMAKE_INSTALL_PREFIX="/build_dir/clang" \ + -DLLVM_TARGETS_TO_BUILD="X86, AArch64" \ + -DLLVM_BUILD_TOOLS=ON \ + -DLLVM_ENABLE_TERMINFO=OFF \ + -DLLVM_ENABLE_Z3_SOLVER=OFF \ + ${ADDITIONAL_FLAGS} + + cmake --build build --target install -j$(nproc) + 7z a nes-clang-18-${{ matrix.stdlib }}-X64-${{ matrix.sanitizer || 'None' }}.7z /build_dir/clang -mx9 -aoa - name: Release uses: softprops/action-gh-release@v1 id: createrelease with: files: | - nes-clang-18-${{ matrix.osversion }}-${{ matrix.stdlib }}-arm64-${{ matrix.sanitizer || 'None' }}.7z - - name: Clean build artifacts - id: cleanbuildartifacts - if: always() - run: | - rm -rf clang - rm -rf llvm-project - rm -rf .git - - name: Remove docker image - id: removedockerimage - if: always() - run: | - test -n "$(docker image ls -q nes_clang_build_${{ matrix.osversion }})" && \ - docker image rm $(docker image ls -q nes_clang_build_${{ matrix.osversion }}) || \ - true + nes-clang-18-${{ matrix.stdlib }}-X64-${{ matrix.sanitizer || 'None' }}.7z diff --git a/build_ubuntu-arm64.sh b/build_ubuntu-arm64.sh deleted file mode 100755 index a6fee2f..0000000 --- a/build_ubuntu-arm64.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash -# Copyright (C) 2020 by the NebulaStream project (https://nebula.stream) - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# https://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -set -o xtrace -cd /build_dir/llvm-project -rm -rf ./build -mkdir build - -local CXX_FLAGS="" -local LINKER_FLAGS="" -local ADDITIONAL_FLAGS="" -if [ "$STDLIB" == "libc++" ]; then - CXX_FLAGS="-stdlib=libc++ -std=c++20" - LINKER_FLAGS="-lc++" -elif [ "$STDLIB" == "stdlibc++" ]; then - CXX_FLAGS="-std=c++20" - LINKER_FLAGS="" -else - echo "Error: STDLIB env not set to either libc++ or stdlibc++." - exit 1 -fi - -if [ ! -z ${ENABLE_SANITIZER+x} ]; then - ADDITIONAL_FLAGS="${ADDITIONAL_FLAGS} -DLLVM_USE_SANITIZER=${ENABLE_SANITIZER}" -fi - -if [ ! -z "${CXX_FLAGS}" ]; then - ADDITIONAL_FLAGS="${ADDITIONAL_FLAGS} -DCMAKE_CXX_FLAGS=\"${CXX_FLAGS}\"" -fi - -if [ ! -z "${LINKER_FLAGS}" ]; then - ADDITIONAL_FLAGS="${ADDITIONAL_FLAGS} -DCMAKE_EXE_LINKER_FLAGS=\"${LINKER_FLAGS}\"" -fi - -cmake -G Ninja -S llvm -B build -DCMAKE_BUILD_TYPE=Release \ - -DLLVM_ENABLE_PROJECTS="mlir" \ - -DBOOTSTRAP_LLVM_ENABLE_LTO=ON \ - -DLLVM_INCLUDE_EXAMPLES=OFF \ - -DLLVM_INCLUDE_TESTS=OFF \ - -DLLVM_INCLUDE_BENCHMARKS=OFF \ - -DLLVM_BUILD_EXAMPLES=OFF \ - -DLIBCXX_INCLUDE_BENCHMARKS=OFF \ - -DLLVM_OPTIMIZED_TABLEGEN=ON \ - -DCMAKE_INSTALL_PREFIX="/build_dir/clang" \ - -DLLVM_TARGETS_TO_BUILD="AArch64" \ - -DLLVM_BUILD_TOOLS=ON \ - -DLLVM_ENABLE_TERMINFO=OFF \ - -DLLVM_ENABLE_Z3_SOLVER=OFF \ - ${ADDITIONAL_FLAGS} - -cmake --build build --target install -j$(nproc) - diff --git a/build_ubuntu-x64.sh b/build_ubuntu-x64.sh deleted file mode 100755 index ccccf99..0000000 --- a/build_ubuntu-x64.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash -# Copyright (C) 2020 by the NebulaStream project (https://nebula.stream) - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# https://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -o xtrace -cd /build_dir/llvm-project -rm -rf ./build -mkdir build - -local CXX_FLAGS="" -local LINKER_FLAGS="" -local ADDITIONAL_FLAGS="" -if [ "$STDLIB" == "libc++" ]; then - CXX_FLAGS="-stdlib=libc++ -std=c++20" - LINKER_FLAGS="-lc++" -elif [ "$STDLIB" == "stdlibc++" ]; then - CXX_FLAGS="-std=c++20" - LINKER_FLAGS="" -else - echo "Error: STDLIB env not set to either libc++ or stdlibc++." - exit 1 -fi - -if [ ! -z ${ENABLE_SANITIZER+x} ]; then - ADDITIONAL_FLAGS="${ADDITIONAL_FLAGS} -DLLVM_USE_SANITIZER=${ENABLE_SANITIZER}" -fi - -if [ ! -z "${CXX_FLAGS}" ]; then - ADDITIONAL_FLAGS="${ADDITIONAL_FLAGS} -DCMAKE_CXX_FLAGS=\"${CXX_FLAGS}\"" -fi - -if [ ! -z "${LINKER_FLAGS}" ]; then - ADDITIONAL_FLAGS="${ADDITIONAL_FLAGS} -DCMAKE_EXE_LINKER_FLAGS=\"${LINKER_FLAGS}\"" -fi - -cmake -G Ninja -S llvm -B build -DCMAKE_BUILD_TYPE=Release \ - -DLLVM_ENABLE_PROJECTS="mlir" \ - -DBOOTSTRAP_LLVM_ENABLE_LTO=ON \ - -DLLVM_INCLUDE_EXAMPLES=OFF \ - -DLLVM_INCLUDE_TESTS=OFF \ - -DLLVM_INCLUDE_BENCHMARKS=OFF \ - -DLLVM_BUILD_EXAMPLES=OFF \ - -DLIBCXX_INCLUDE_BENCHMARKS=OFF \ - -DLLVM_OPTIMIZED_TABLEGEN=ON \ - -DCMAKE_INSTALL_PREFIX="/build_dir/clang" \ - -DLLVM_TARGETS_TO_BUILD="X86" \ - -DLLVM_BUILD_TOOLS=ON \ - -DLLVM_ENABLE_TERMINFO=OFF \ - -DLLVM_ENABLE_Z3_SOLVER=OFF \ - ${ADDITIONAL_FLAGS} - -cmake --build build --target install -j$(nproc) - - - diff --git a/docker/Dockerfile-ubuntu-22.04 b/docker/Dockerfile-ubuntu-22.04 deleted file mode 100644 index dd168a2..0000000 --- a/docker/Dockerfile-ubuntu-22.04 +++ /dev/null @@ -1,41 +0,0 @@ -FROM ubuntu:22.04 -ARG LLVM_VERSION=18 -RUN apt-get update -qq && DEBIAN_FRONTEND="noninteractive" apt-get install -qq \ - apt-transport-https \ - git \ - wget \ - python2 \ - python3 \ - tar \ - p7zip-full \ - cmake \ - software-properties-common \ - build-essential \ - curl zip unzip tar \ - pkg-config \ - ninja-build \ - && apt-get clean -qq - -RUN curl -fsSL https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor -o /etc/apt/keyrings/llvm-snapshot.gpg \ - && chmod a+r /etc/apt/keyrings/llvm-snapshot.gpg \ - && echo "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/llvm-snapshot.gpg] http://apt.llvm.org/"$(. /etc/os-release && echo "$VERSION_CODENAME")"/ llvm-toolchain-"$(. /etc/os-release && echo "$VERSION_CODENAME")"-${LLVM_VERSION} main" > /etc/apt/sources.list.d/llvm-snapshot.list \ - && echo "deb-src [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/llvm-snapshot.gpg] http://apt.llvm.org/"$(. /etc/os-release && echo "$VERSION_CODENAME")"/ llvm-toolchain-"$(. /etc/os-release && echo "$VERSION_CODENAME")"-${LLVM_VERSION} main" >> /etc/apt/sources.list.d/llvm-snapshot.list \ - && apt update -y && apt install clang-${LLVM_VERSION} libc++-${LLVM_VERSION}-dev libc++abi-${LLVM_VERSION}-dev libclang-rt-${LLVM_VERSION}-dev -y - -# set default compiler to clang and make libc++ available via ldconfig -RUN ln -sf /usr/bin/clang-${LLVM_VERSION} /usr/bin/cc \ - && ln -sf /usr/bin/clang++-${LLVM_VERSION} /usr/bin/c++ \ - && update-alternatives --install /usr/bin/cc cc /usr/bin/clang-${LLVM_VERSION} 30\ - && update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-${LLVM_VERSION} 30\ - && update-alternatives --auto cc \ - && update-alternatives --auto c++ \ - && update-alternatives --display cc \ - && update-alternatives --display c++ \ - && echo /usr/lib/llvm-${LLVM_VERSION}/lib > /etc/ld.so.conf.d/libcxx.conf \ - && ldconfig \ - && ls -l /usr/bin/cc /usr/bin/c++ \ - && cc --version \ - && c++ --version - -ADD ./entrypoint-build.sh /entrypoint.sh -ENTRYPOINT ["/entrypoint.sh"] diff --git a/docker/entrypoint-build.sh b/docker/entrypoint-build.sh deleted file mode 100755 index 5fe1225..0000000 --- a/docker/entrypoint-build.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -# Copyright (C) 2020 by the NebulaStream project (https://nebula.stream) - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# https://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -#quit if command returns non-zero code -set -e - -if [ $# -eq 0 ] -then - cd /build_dir/ - /bin/bash -else - exec $@ -fi