-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci] Add a debug build of Clang (#662)
This patch builds clang and llvm from source in debug mode and run clad. We have several test failures which are marked with XFAIL now.
- Loading branch information
1 parent
be3dba1
commit 8647f13
Showing
13 changed files
with
104 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -170,6 +170,7 @@ jobs: | |
os: ubuntu-20.04 | ||
compiler: gcc-9 | ||
clang-runtime: '12' | ||
|
||
- name: ubu20-clang8-runtime12 | ||
os: ubuntu-20.04 | ||
compiler: clang-8 | ||
|
@@ -381,6 +382,12 @@ jobs: | |
compiler: clang-15 | ||
clang-runtime: '16' | ||
|
||
- name: ubu22-clang15-runtime16-debug | ||
os: ubuntu-22.04 | ||
compiler: clang-15 | ||
clang-runtime: '16' | ||
debug_build: true | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
|
@@ -401,11 +408,15 @@ jobs: | |
name: pr | ||
path: pr/ | ||
- uses: nelonoel/[email protected] | ||
- name: Setup default Build Type on *nux | ||
if: runner.os != 'windows' | ||
- name: Setup default Build Type on *nux (coverity) | ||
if: ${{ (matrix.debug_build != true) && (runner.os != 'windows') }} | ||
run: | | ||
echo "BUILD_TYPE=Release" >> $GITHUB_ENV | ||
echo "CODE_COVERAGE=0" >> $GITHUB_ENV | ||
- name: Setup default Build Type on *nux (build_debug & asserts) | ||
if: ${{ (matrix.debug_build == true) && (runner.os != 'windows') }} | ||
run: | | ||
echo "BUILD_TYPE=Debug" >> $GITHUB_ENV | ||
- name: Setup default Build Type on Windows | ||
if: runner.os == 'windows' | ||
run: | | ||
|
@@ -546,8 +557,65 @@ jobs: | |
done | ||
# We need PATH_TO_LLVM_BUILD later | ||
echo "PATH_TO_LLVM_BUILD=$PATH_TO_LLVM_BUILD" >> $GITHUB_ENV | ||
- name: Restore Cache LLVM/Clang runtime build directory (debug_build==true) | ||
if: ${{ (matrix.debug_build == true) && (runner.os != 'windows') }} | ||
uses: actions/cache/restore@v3 | ||
id: cache | ||
with: | ||
path: | | ||
llvm-project | ||
key: ${{ matrix.os }}-clang-${{ matrix.clang-runtime }}.x-${{ env.BUILD_TYPE }} | ||
- name: Build LLVM/Cling on Unix if the cache is invalid (debug_build==true) | ||
if: ${{ (matrix.debug_build == true) && (runner.os != 'windows') && (steps.cache.outputs.cache-hit != 'true') }} | ||
run: | | ||
os="${{ matrix.os }}" | ||
git clone --depth=1 -b release/${{ matrix.clang-runtime }}.x https://github.com/llvm/llvm-project.git | ||
cd llvm-project | ||
# Build | ||
mkdir build | ||
cd build | ||
export CPU_COUNT="$(nproc --all)" | ||
cmake \ | ||
-DLLVM_ENABLE_PROJECTS="clang" \ | ||
-DLLVM_TARGETS_TO_BUILD="host;NVPTX" \ | ||
-DCMAKE_BUILD_TYPE=`[[ -z "$BUILD_TYPE" ]] && echo RelWithDebInfo || echo $BUILD_TYPE` \ | ||
-DLLVM_ENABLE_ASSERTIONS=ON \ | ||
-DCLANG_ENABLE_STATIC_ANALYZER=OFF \ | ||
-DCLANG_ENABLE_ARCMT=OFF \ | ||
-DCLANG_ENABLE_FORMAT=OFF \ | ||
-DCLANG_ENABLE_BOOTSTRAP=OFF \ | ||
-DLLVM_ENABLE_TERMINFO=OFF \ | ||
-DCLANG_INCLUDE_TESTS=OFF \ | ||
-DCLANG_INCLUDE_DOCS=OFF \ | ||
-DLLVM_INCLUDE_TESTS=OFF \ | ||
-DLLVM_INCLUDE_DOCS=OFF \ | ||
../llvm | ||
cmake --build . --target clang FileCheck llvm-config --parallel ${CPU_COUNT} | ||
cd ../../ | ||
- name: Save Cache LLVM/Clang runtime build directory (debug_build==true) | ||
uses: actions/cache/save@v3 | ||
if: ${{ (matrix.debug_build == true) && (runner.os != 'windows') && (steps.cache.outputs.cache-hit != 'true') }} | ||
with: | ||
path: | | ||
llvm-project | ||
key: ${{ steps.cache.outputs.cache-primary-key }} | ||
- name: Set LLVM/Cling build path on Unix (debug_build==true) | ||
if: ${{ (matrix.debug_build == true) && (runner.os != 'windows') }} | ||
run: | | ||
export PATH_TO_LLVM_BUILD="$PWD/llvm-project/build" | ||
echo "PATH_TO_LLVM_BUILD=$PATH_TO_LLVM_BUILD" | ||
echo "PATH_TO_LLVM_BUILD=$PATH_TO_LLVM_BUILD" >> $GITHUB_ENV | ||
pip3 install lit # LLVM lit is not part of the llvm releases... | ||
vers="${compiler#*-}" | ||
if [[ ! -f "$PATH_TO_LLVM_BUILD/bin/FileCheck" ]]; then | ||
ln -s /usr/bin/FileCheck-$vers $PATH_TO_LLVM_BUILD/bin/FileCheck | ||
fi | ||
env: | ||
compiler: ${{ matrix.compiler }} | ||
|
||
- name: Setup LLVM/Clang on Linux | ||
if: runner.os == 'Linux' | ||
if: ${{ (runner.os == 'Linux') && (matrix.debug_build != true) }} | ||
run: | | ||
UNIX_DISTRO=$(lsb_release -rs) | ||
PATH_TO_LLVM_BUILD=/usr/lib/llvm-${{ matrix.clang-runtime }}/ | ||
|
@@ -564,7 +632,7 @@ jobs: | |
# We need PATH_TO_LLVM_BUILD later | ||
echo "PATH_TO_LLVM_BUILD=$PATH_TO_LLVM_BUILD" >> $GITHUB_ENV | ||
- name: Setup LLVM/Clang on Windows | ||
if: runner.os == 'windows' | ||
if: ${{ runner.os == 'windows' }} | ||
run: | | ||
C:\Miniconda\condabin\conda.bat install -y -c conda-forge "clangdev=${{ matrix.clang-runtime }}" | ||
$env:PATH_TO_LLVM_BUILD="$env:CONDA\Library" | ||
|
@@ -593,7 +661,7 @@ jobs: | |
echo "CODE_COVERAGE=1" >> $GITHUB_ENV | ||
echo "BUILD_TYPE=Debug" >> $GITHUB_ENV | ||
- name: Display config *nix | ||
if: runner.os != 'windows' | ||
if: ${{ runner.os != 'windows' }} | ||
run: | | ||
cmake --version | ||
$CC --version | ||
|
@@ -604,7 +672,7 @@ jobs: | |
echo "Building clad in `[[ -z "$BUILD_TYPE" ]] && echo RelWithDebInfo || echo $BUILD_TYPE`" | ||
python3 --version | ||
- name: Display config Windows | ||
if: runner.os == 'windows' | ||
if: ${{ runner.os == 'windows' }} | ||
run: | | ||
cmake --version | ||
echo "CC=$env:CC" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters