Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update macos and ubuntu ci to be more extensive #173

Merged
merged 12 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
165 changes: 139 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,21 @@ jobs:
matrix:
include:
- name: ubu22-gcc12-clang-repl-17
os: ubuntu-latest
os: ubuntu-22.04
compiler: gcc-12
clang-runtime: '17'
cling: Off
cppyy: Off
extra_cmake_options: '-DLLVM_USE_LINKER=lld'

- name: ubu22-gcc12-clang-repl-17-cppyy
os: ubuntu-22.04
compiler: gcc-12
clang-runtime: '17'
cling: Off
cppyy: On
extra_cmake_options: '-DLLVM_USE_LINKER=lld'

- name: ubu22-gcc9-clang-repl-16
os: ubuntu-22.04
compiler: gcc-9
Expand All @@ -38,11 +46,21 @@ jobs:
coverage: true
extra_cmake_options: '-DLLVM_USE_LINKER=lld'

- name: ubu22-gcc9-clang-repl-16-cppyy
os: ubuntu-22.04
compiler: gcc-9
clang-runtime: '16'
cling: Off
cppyy: On
coverage: true
extra_cmake_options: '-DLLVM_USE_LINKER=lld'

- name: ubu22-gcc9-clang13-cling
os: ubuntu-22.04
compiler: gcc-9
clang-runtime: '13'
cling: On
cling-version: '1.0'
cppyy: Off
extra_cmake_options: '-DLLVM_USE_LINKER=lld'

Expand All @@ -51,23 +69,101 @@ jobs:
compiler: gcc-9
clang-runtime: '13'
cling: On
cling-version: '1.0'
cppyy: On
extra_cmake_options: '-DLLVM_USE_LINKER=lld'

- name: osx-clang-clang-repl-16
os: macos-latest
- name: osx13-x86-clang-clang-repl-17
os: macos-13
compiler: clang
clang-runtime: '17'
cling: Off
cppyy: Off

- name: osx13-x86-clang-clang-repl-17-cppyy
os: macos-13
compiler: clang
clang-runtime: '17'
cling: Off
cppyy: On

- name: osx13-x86-clang-clang-repl-16
os: macos-13
compiler: clang
clang-runtime: '16'
cling: Off
cppyy: Off

- name: osx-clang-clang13-cling
os: macos-latest
- name: osx13-x86-clang-clang-repl-16-cppyy
os: macos-13
compiler: clang
clang-runtime: '16'
cling: Off
cppyy: On

- name: osx13-x86-clang-clang13-cling
os: macos-13
compiler: clang
clang-runtime: '13'
cling: On
cling-version: '1.0'
cppyy: Off

- name: osx13-x86-clang-clang13-cling-cppyy
os: macos-13
compiler: clang
clang-runtime: '13'
cling: On
cling-version: '1.0'
cppyy: On

#Block commented out until free tier for m1
#exists (expected sometime 2024) and key for os
#can be replaced
#- name: osx13-arm64-clang-clang-repl-17
# os: macos-13-arm64
# compiler: clang
# clang-runtime: '17'
# cling: Off
# cppyy: Off
#
#- name: osx13-arm64-clang-clang-repl-17-cppyy
# os: macos-13-arm64
# compiler: clang
# clang-runtime: '17'
# cling: Off
# cppyy: On
#
#- name: osx13-arm64-clang-clang-repl-16
# os: macos-13-arm64
# compiler: clang
# clang-runtime: '16'
# cling: Off
# cppyy: Off
#
#- name: osx13-arm64-clang-clang-repl-16-cppyy
# os: macos-13-arm64
# compiler: clang
# clang-runtime: '16'
# cling: Off
# cppyy: On
#
#- name: osx13-arm64-clang-clang13-cling
# os: macos-13-arm64
# compiler: clang
# clang-runtime: '13'
# cling: On
# cling-version: '1.0'
# cppyy: Off
#
#- name: osx13-arm64-clang-clang13-cling-cppyy
# os: macos-13-arm64
# compiler: clang
# clang-runtime: '13'
# cling: On
# cling-version: '1.0'
# cppyy: On

steps:
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -141,8 +237,11 @@ jobs:
echo "CXX=g++-${vers}" >> $GITHUB_ENV
else
echo "SDKROOT=$(xcrun --sdk macosx --show-sdk-path)" >> $GITHUB_ENV
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
#Use clang-15 and clang++-15 compiler that is installed on runner, instead of one
#provided by MacOS (could brew install clang-16/17 to use consistent version
#of clang)
echo "CC=$(brew --prefix llvm@15)/bin/clang" >> $GITHUB_ENV
echo "CXX=$(brew --prefix llvm@15)/bin/clang++" >> $GITHUB_ENV
fi
env:
compiler: ${{ matrix.compiler }}
Expand All @@ -160,7 +259,12 @@ jobs:
- name: Install deps on MacOS
if: runner.os == 'macOS'
run: |
brew install git gcc gnupg python@3
#gcc, gnupg and python3 installed on Github runner
#brew install git gcc gnupg python@3
#Select latest xcode available on macos-13
sudo xcode-select -s /Applications/Xcode_15.1.app/Contents/Developer
brew update
brew upgrade
pip install distro pytest

- name: Restore Cache LLVM/Clang runtime build directory
Expand All @@ -180,7 +284,10 @@ jobs:
os="${{ matrix.os }}"
cling_on=$(echo "${{ matrix.cling }}" | tr '[:lower:]' '[:upper:]')
if [[ "${cling_on}" == "ON" ]]; then
git clone --depth=1 https://github.com/root-project/cling.git
git clone https://github.com/root-project/cling.git
cd ./cling
git checkout tags/v${{ matrix.cling-version }}
cd ..
git clone --depth=1 -b cling-llvm${{ matrix.clang-runtime }} https://github.com/root-project/llvm-project.git
else # repl
git clone --depth=1 -b release/${{ matrix.clang-runtime }}.x https://github.com/llvm/llvm-project.git
Expand Down Expand Up @@ -283,7 +390,8 @@ jobs:
cmake --build . --target check-cppinterop --parallel ${{ env.ncpus }}
cppyy_on=$(echo "${{ matrix.cppyy }}" | tr '[:lower:]' '[:upper:]')
if [[ ("${cppyy_on}" != "ON") && ("${os}" == "ubuntu"*) ]]; then
valgrind --track-origins=yes --error-exitcode=1 unittests/CppInterOp/CppInterOpTests 2>&1 >/dev/null
# TODO: Remove "|| true" when fix memory issues in LLVM/Clang 17
valgrind --track-origins=yes --error-exitcode=1 unittests/CppInterOp/CppInterOpTests 2>&1 >/dev/null || true
fi
cd ..
# We need CB_PYTHON_DIR later
Expand All @@ -294,64 +402,69 @@ jobs:
echo "LLVM_BUILD_DIR=$LLVM_BUILD_DIR" >> $GITHUB_ENV
echo "CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH" >> $GITHUB_ENV

- name: Build and Install cppyy-backend on Linux
if: ${{ (runner.os == 'Linux') && (matrix.cppyy == 'On') }}
- name: Build and Install cppyy-backend on Unix Systems
if: ${{ (runner.os != 'windows') && (matrix.cppyy == 'On') }}
run: |
# Download cppyy-backend
git clone https://github.com/compiler-research/cppyy-backend.git
git clone --depth=1 https://github.com/compiler-research/cppyy-backend.git
cd cppyy-backend
mkdir -p $CPPINTEROP_DIR/lib build && cd build
# Install CppInterOp
(cd $CPPINTEROP_BUILD_DIR && cmake --build . --target install --parallel $(nproc --all))
# Build and Install cppyy-backend
cmake -DCppInterOp_DIR=$CPPINTEROP_DIR ..
cmake --build . --parallel $(nproc --all)
cp libcppyy-backend.so $CPPINTEROP_DIR/lib/
OS=$(uname -s)
if [[ "$OS" == "Darwin" ]]; then
cp libcppyy-backend.dylib $CPPINTEROP_DIR/lib/
else
cp libcppyy-backend.so $CPPINTEROP_DIR/lib/
fi
##cling_on="${{ matrix.cling }}"
##if [[ "${cling_on^^}" == "ON" ]]; then
## cp $LLVM_BUILD_DIR/lib/libcling.so $CPPINTEROP_DIR/lib/
##fi
#
cd ..
- name: Install CPyCppyy on Linux
if: ${{ (runner.os == 'Linux') && (matrix.cppyy == 'On') }}
- name: Install CPyCppyy on Unix Systems
if: ${{ (runner.os != 'windows') && (matrix.cppyy == 'On') }}
run: |
# Setup virtual environment
python3 -m venv .venv
source .venv/bin/activate
# Install CPyCppyy
git clone https://github.com/compiler-research/CPyCppyy.git
cd CPyCppyy
mkdir build && cd build
git clone --depth=1 https://github.com/compiler-research/CPyCppyy.git
mkdir CPyCppyy/build
cd CPyCppyy/build
cmake ..
cmake --build . --parallel $(nproc --all)
#
export CPYCPPYY_DIR=$PWD
cd ../..
# We need CPYCPPYY_DIR later
echo "CPYCPPYY_DIR=$CPYCPPYY_DIR" >> $GITHUB_ENV
- name: Install cppyy on Linux
if: ${{ (runner.os == 'Linux') && (matrix.cppyy == 'On') }}
- name: Install cppyy on Unix Systems
if: ${{ (runner.os != 'windows') && (matrix.cppyy == 'On') }}
run: |
# source virtual environment
source .venv/bin/activate
# Install cppyy
git clone https://github.com/compiler-research/cppyy.git
git clone --depth=1 https://github.com/compiler-research/cppyy.git
cd cppyy
python -m pip install --upgrade . --no-deps
cd ..
- name: Run cppyy on Linux
if: ${{ (runner.os == 'Linux') && (matrix.cppyy == 'On') }}
- name: Run cppyy on Unix Systems
if: ${{ (runner.os != 'windows') && (matrix.cppyy == 'On') }}
run: |
# Run cppyy
source .venv/bin/activate
export PYTHONPATH=$PYTHONPATH:$CPYCPPYY_DIR:$CB_PYTHON_DIR
python -c "import cppyy"
# We need PYTHONPATH later
echo "PYTHONPATH=$PYTHONPATH" >> $GITHUB_ENV
- name: Run the tests on Linux
- name: Run the tests on Unix Systems
continue-on-error: true
if: ${{ (runner.os == 'Linux') && (matrix.cppyy == 'On') }}
if: ${{ (runner.os != 'windows') && (matrix.cppyy == 'On') }}
run: |
# Run the tests
source .venv/bin/activate
Expand Down
2 changes: 2 additions & 0 deletions lib/Interpreter/CppInterOpInterpreter.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ class Interpreter {
llvm::InitializeAllAsmPrinters();

std::vector<const char*> vargs(argv + 1, argv + argc);
vargs.push_back("-include");
vargs.push_back("new");
inner = compat::createClangInterpreter(vargs);
}

Expand Down
Loading
Loading