diff --git a/.github/workflows/MacOS-arm.yml b/.github/workflows/MacOS-arm.yml index e2af0a042..399960839 100644 --- a/.github/workflows/MacOS-arm.yml +++ b/.github/workflows/MacOS-arm.yml @@ -58,13 +58,13 @@ jobs: cling-version: '1.0' llvm_enable_projects: "clang" llvm_targets_to_build: "host;NVPTX" - + steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set up Python + - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.11' @@ -87,7 +87,7 @@ jobs: fi echo "CLING_HASH=$CLING_HASH" >> $GITHUB_ENV - echo "LLVM_HASH=$LLVM_HASH" >> $GITHUB_ENV + echo "LLVM_HASH=$LLVM_HASH" >> $GITHUB_ENV - name: Restore Cache LLVM/Clang runtime build directory uses: actions/cache/restore@v4 @@ -116,7 +116,7 @@ jobs: echo "CXX=g++-${vers}" >> $GITHUB_ENV else cling_on=$(echo "${{ matrix.cling }}" | tr '[:lower:]' '[:upper:]') - if [[ "${cling_on}" == "ON" ]]; then + if [[ "${cling_on}" == "ON" ]]; then brew install llvm@15 brew remove llvm@18 brew cleanup @@ -147,7 +147,7 @@ jobs: brew unlink "$pkg" brew link --overwrite "$pkg" done - brew upgrade openssl >/dev/null 2>&1 + brew upgrade openssl >/dev/null 2>&1 brew upgrade brew install ninja @@ -157,7 +157,7 @@ jobs: cling_on=$(echo "${{ matrix.cling }}" | tr '[:lower:]' '[:upper:]') if [[ "${cling_on}" == "ON" ]]; then git clone https://github.com/root-project/cling.git - cd ./cling + 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 @@ -288,7 +288,7 @@ jobs: with: fetch-depth: 0 - - name: Set up Python + - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.11' @@ -328,7 +328,7 @@ jobs: echo "CXX=g++-${vers}" >> $GITHUB_ENV else cling_on=$(echo "${{ matrix.cling }}" | tr '[:lower:]' '[:upper:]') - if [[ "${cling_on}" == "ON" ]]; then + if [[ "${cling_on}" == "ON" ]]; then brew install llvm@15 brew remove llvm@18 brew cleanup @@ -351,19 +351,19 @@ jobs: - name: Install deps run: | - brew update --force + brew update --force brew remove unxip # workaround for https://github.com/actions/setup-python/issues/577 for pkg in $(brew list | grep '^python@'); do brew unlink "$pkg" brew link --overwrite "$pkg" done - brew upgrade --force + brew upgrade --force brew install eigen brew install boost brew install gnu-sed pip install distro pytest - + - name: Restore Cache LLVM/Clang runtime build directory uses: actions/cache/restore@v4 @@ -442,7 +442,7 @@ jobs: cmake --build . --parallel ${{ env.ncpus }} cp libcppyy-backend.dylib $CPPINTEROP_DIR/lib/ cd .. - + - name: Install CPyCppyy if: ${{ matrix.cppyy == 'On' }} run: | @@ -529,7 +529,7 @@ jobs: tail -n1 test_xfailed.log echo "Return Code: ${RETCODE}" exit $RETCODE - + - name: Show debug info if: ${{ failure() }} run: | diff --git a/.github/workflows/MacOS.yml b/.github/workflows/MacOS.yml index e59532457..5fa241556 100644 --- a/.github/workflows/MacOS.yml +++ b/.github/workflows/MacOS.yml @@ -58,13 +58,13 @@ jobs: cling-version: '1.0' llvm_enable_projects: "clang" llvm_targets_to_build: "host;NVPTX" - + steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set up Python + - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.11' @@ -87,7 +87,7 @@ jobs: fi echo "CLING_HASH=$CLING_HASH" >> $GITHUB_ENV - echo "LLVM_HASH=$LLVM_HASH" >> $GITHUB_ENV + echo "LLVM_HASH=$LLVM_HASH" >> $GITHUB_ENV - name: Restore Cache LLVM/Clang runtime build directory uses: actions/cache/restore@v4 @@ -131,7 +131,7 @@ jobs: brew unlink "$pkg" brew link --overwrite "$pkg" done - brew upgrade openssl >/dev/null 2>&1 + brew upgrade openssl >/dev/null 2>&1 brew upgrade brew install ninja @@ -141,7 +141,7 @@ jobs: cling_on=$(echo "${{ matrix.cling }}" | tr '[:lower:]' '[:upper:]') if [[ "${cling_on}" == "ON" ]]; then git clone https://github.com/root-project/cling.git - cd ./cling + 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 @@ -272,7 +272,7 @@ jobs: with: fetch-depth: 0 - - name: Set up Python + - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.11' @@ -320,19 +320,19 @@ jobs: - name: Install deps run: | - brew update --force + brew update --force brew remove swiftlint # workaround for https://github.com/actions/setup-python/issues/577 for pkg in $(brew list | grep '^python@'); do brew unlink "$pkg" brew link --overwrite "$pkg" done - brew upgrade --force + brew upgrade --force brew install eigen brew install boost brew install gnu-sed pip install distro pytest - + - name: Restore Cache LLVM/Clang runtime build directory uses: actions/cache/restore@v4 @@ -411,7 +411,7 @@ jobs: cmake --build . --parallel ${{ env.ncpus }} cp libcppyy-backend.dylib $CPPINTEROP_DIR/lib/ cd .. - + - name: Install CPyCppyy if: ${{ matrix.cppyy == 'On' }} run: | @@ -498,7 +498,7 @@ jobs: tail -n1 test_xfailed.log echo "Return Code: ${RETCODE}" exit $RETCODE - + - name: Show debug info if: ${{ failure() }} run: | diff --git a/.github/workflows/Ubuntu-arm.yml b/.github/workflows/Ubuntu-arm.yml index 27c39fa08..37358eb94 100644 --- a/.github/workflows/Ubuntu-arm.yml +++ b/.github/workflows/Ubuntu-arm.yml @@ -94,13 +94,13 @@ jobs: cling-version: '1.0' llvm_enable_projects: "clang" llvm_targets_to_build: "host;NVPTX" - + steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set up Python + - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.11' @@ -123,7 +123,7 @@ jobs: fi echo "CLING_HASH=$CLING_HASH" >> $GITHUB_ENV - echo "LLVM_HASH=$LLVM_HASH" >> $GITHUB_ENV + echo "LLVM_HASH=$LLVM_HASH" >> $GITHUB_ENV - name: Restore Cache LLVM/Clang runtime build directory uses: actions/cache/restore@v4 @@ -181,7 +181,7 @@ jobs: cling_on=$(echo "${{ matrix.cling }}" | tr '[:lower:]' '[:upper:]') if [[ "${cling_on}" == "ON" ]]; then git clone https://github.com/root-project/cling.git - cd ./cling + 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 @@ -343,7 +343,7 @@ jobs: with: fetch-depth: 0 - - name: Set up Python + - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.11' @@ -409,7 +409,7 @@ jobs: # Install libraries used by the cppyy test suite sudo apt install libeigen3-dev sudo apt install libboost-all-dev - + - name: Restore Cache LLVM/Clang runtime build directory uses: actions/cache/restore@v4 @@ -522,7 +522,7 @@ jobs: cmake --build . --parallel ${{ env.ncpus }} cp libcppyy-backend.so $CPPINTEROP_DIR/lib/ cd .. - + - name: Install CPyCppyy if: ${{ matrix.cppyy == 'On' }} run: | @@ -596,7 +596,7 @@ jobs: declare -i RETCODE=0 set -o pipefail - + echo "Running valgrind on passing tests" CLANG_VERSION="${{ matrix.clang-runtime }}" SUPPRESSION_FILE="../etc/clang${CLANG_VERSION}-valgrind_arm.supp" @@ -614,7 +614,7 @@ jobs: tail -n1 test_xfailed.log echo "Return Code: ${RETCODE}" exit $RETCODE - + - name: Show debug info if: ${{ failure() }} run: | diff --git a/.github/workflows/Ubuntu.yml b/.github/workflows/Ubuntu.yml index fb05e37cb..c6074bd94 100644 --- a/.github/workflows/Ubuntu.yml +++ b/.github/workflows/Ubuntu.yml @@ -94,13 +94,13 @@ jobs: cling-version: '1.0' llvm_enable_projects: "clang" llvm_targets_to_build: "host;NVPTX" - + steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set up Python + - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.11' @@ -123,7 +123,7 @@ jobs: fi echo "CLING_HASH=$CLING_HASH" >> $GITHUB_ENV - echo "LLVM_HASH=$LLVM_HASH" >> $GITHUB_ENV + echo "LLVM_HASH=$LLVM_HASH" >> $GITHUB_ENV - name: Restore Cache LLVM/Clang runtime build directory uses: actions/cache/restore@v4 @@ -181,7 +181,7 @@ jobs: cling_on=$(echo "${{ matrix.cling }}" | tr '[:lower:]' '[:upper:]') if [[ "${cling_on}" == "ON" ]]; then git clone https://github.com/root-project/cling.git - cd ./cling + 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 @@ -351,7 +351,7 @@ jobs: with: fetch-depth: 0 - - name: Set up Python + - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.11' @@ -417,7 +417,7 @@ jobs: # Install libraries used by the cppyy test suite sudo apt install libeigen3-dev sudo apt install libboost-all-dev - + - name: Restore Cache LLVM/Clang runtime build directory uses: actions/cache/restore@v4 @@ -530,7 +530,7 @@ jobs: cmake --build . --parallel ${{ env.ncpus }} cp libcppyy-backend.so $CPPINTEROP_DIR/lib/ cd .. - + - name: Install CPyCppyy if: ${{ matrix.cppyy == 'On' }} run: | @@ -604,7 +604,7 @@ jobs: declare -i RETCODE=0 set -o pipefail - + echo "Running valgrind on passing tests" CLANG_VERSION="${{ matrix.clang-runtime }}" SUPPRESSION_FILE="../etc/clang${CLANG_VERSION}-valgrind.supp" @@ -622,7 +622,7 @@ jobs: tail -n1 test_xfailed.log echo "Return Code: ${RETCODE}" exit $RETCODE - + - name: Show debug info if: ${{ failure() }} run: | diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml index cbacc4be1..ebc464b58 100644 --- a/.github/workflows/Windows.yml +++ b/.github/workflows/Windows.yml @@ -28,16 +28,16 @@ jobs: cling: Off llvm_enable_projects: "clang" llvm_targets_to_build: "host;NVPTX" - + steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set up Python + - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: '3.11' - name: Save PR Info on Windows systems run: | @@ -47,8 +47,8 @@ jobs: echo ${{ github.repository }} > ./pr/REPO if ( "${{ matrix.cling }}" -imatch "On" ) - { - $env:CLING_HASH_TEMP = ( git ls-remote https://github.com/root-project/cling.git refs/tags/v${{ matrix.cling-version }} ) + { + $env:CLING_HASH_TEMP = ( git ls-remote https://github.com/root-project/cling.git refs/tags/v${{ matrix.cling-version }} ) $env:CLING_HASH = $env:CLING_HASH_TEMP -replace "\t","-" } else @@ -62,7 +62,7 @@ jobs: echo "CLING_HASH=$env:CLING_HASH" echo "LLVM_HASH=$env:LLVM_HASH" - + echo "CLING_HASH=$env:CLING_HASH" >> $GITHUB_ENV echo "LLVM_HASH=$env:LLVM_HASH" >> $GITHUB_ENV @@ -81,9 +81,9 @@ jobs: run: | echo "BUILD_TYPE=Release" >> $env:GITHUB_ENV echo "CODE_COVERAGE=0" >> $env:GITHUB_ENV - $env:ncpus=$([Environment]::ProcessorCount) + $env:ncpus=$([Environment]::ProcessorCount) echo "ncpus=$env:ncpus" >> $env:GITHUB_ENV - + - name: Setup compiler on Windows if: ${{ steps.cache.outputs.cache-hit != 'true' }} run: | @@ -116,11 +116,11 @@ jobs: - name: Build LLVM/Cling on Windows systems if the cache is invalid if: ${{ steps.cache.outputs.cache-hit != 'true' }} run: | - + if ( "${{ matrix.cling }}" -imatch "On" ) { git clone https://github.com/root-project/cling.git - cd ./cling + 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 @@ -196,7 +196,7 @@ jobs: rm -r -force $(find.exe . -maxdepth 1 ! -name "include" ! -name "lib" ! -name "cmake" ! -name "utils" ! -name ".") cd ..\clang\ rm -r -force $(find.exe . -maxdepth 1 ! -name "include" ! -name "lib" ! -name "cmake" ! -name "utils" ! -name ".") - cd ..\.. + cd ..\.. } else { @@ -204,10 +204,10 @@ jobs: rm -r -force $(find.exe . -maxdepth 1 ! -name "include" ! -name "lib" ! -name "cmake" ! -name ".") cd ..\clang\ rm -r -force $(find.exe . -maxdepth 1 ! -name "include" ! -name "lib" ! -name "cmake" ! -name ".") - cd ..\.. - } + cd ..\.. + } - - name: Save Cache LLVM/Clang runtime build directory + - name: Save Cache LLVM/Clang runtime build directory uses: actions/cache/save@v4 if: ${{ steps.cache.outputs.cache-hit != 'true' }} with: @@ -236,7 +236,7 @@ jobs: with: fetch-depth: 0 - - name: Set up Python + - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.11' @@ -249,8 +249,8 @@ jobs: echo ${{ github.repository }} > ./pr/REPO if ( "${{ matrix.cling }}" -imatch "On" ) - { - $env:CLING_HASH_TEMP = ( git ls-remote https://github.com/root-project/cling.git refs/tags/v${{ matrix.cling-version }} ) + { + $env:CLING_HASH_TEMP = ( git ls-remote https://github.com/root-project/cling.git refs/tags/v${{ matrix.cling-version }} ) $env:CLING_HASH = $env:CLING_HASH_TEMP -replace "\t","-" } else @@ -264,7 +264,7 @@ jobs: echo "CLING_HASH=$env:CLING_HASH" echo "LLVM_HASH=$env:LLVM_HASH" - + echo "CLING_HASH=$env:CLING_HASH" >> $GITHUB_ENV echo "LLVM_HASH=$env:LLVM_HASH" >> $GITHUB_ENV @@ -272,9 +272,9 @@ jobs: run: | echo "BUILD_TYPE=Release" >> $env:GITHUB_ENV echo "CODE_COVERAGE=0" >> $env:GITHUB_ENV - $env:ncpus=$([Environment]::ProcessorCount) + $env:ncpus=$([Environment]::ProcessorCount) echo "ncpus=$env:ncpus" >> $env:GITHUB_ENV - + - name: Setup compiler on Windows run: | if ( "${{ matrix.compiler }}" -imatch "clang" ) @@ -295,7 +295,7 @@ jobs: else { echo "Unsupported compiler - fix YAML file" - } + } - name: Restore Cache LLVM/Clang runtime build directory uses: actions/cache/restore@v4 @@ -305,12 +305,12 @@ jobs: llvm-project ${{ matrix.cling=='On' && 'cling' || '' }} key: ${{ env.CLING_HASH }}-${{ runner.os }}-${{ matrix.os }}-${{ matrix.compiler }}-clang-${{ matrix.clang-runtime }}.x-patch-${{ hashFiles(format('patches/llvm/clang{0}-*.patch', matrix.clang-runtime)) || 'none' }} - + - name: Build and Test/Install CppInterOp on Windows systems run: | #until https://github.com/compiler-research/CppInterOp/issues/188 is solved $env:PWD_DIR= $PWD.Path - + $env:LLVM_DIR="$env:PWD_DIR\llvm-project" echo "LLVM_DIR=$env:LLVM_DIR" echo "LLVM_DIR=$env:LLVM_DIR" >> $env:GITHUB_ENV @@ -323,37 +323,37 @@ jobs: { $env:CLING_DIR="$env:PWD_DIR\cling" echo "CLING_DIR=$env:CLING_DIR" - echo "CLING_DIR=$env:CLING_DIR" >> $env:GITHUB_ENV - + echo "CLING_DIR=$env:CLING_DIR" >> $env:GITHUB_ENV + $env:CLING_BUILD_DIR="$env:PWD_DIR\cling\build" echo "CLING_BUILD_DIR=$env:CLING_BUILD_DIR" - echo "CLING_BUILD_DIR=$env:CLING_BUILD_DIR" >> $env:GITHUB_ENV - + echo "CLING_BUILD_DIR=$env:CLING_BUILD_DIR" >> $env:GITHUB_ENV + $env:CPLUS_INCLUDE_PATH="$env:CLING_DIR\tools\cling\include;$env:CLING_BUILD_DIR\include;$env:LLVM_DIR\llvm\include;$env:LLVM_DIR\clang\include;$env:LLVM_BUILD_DIR\include;$env:LLVM_BUILD_DIR\tools\clang\include;$env:PWD_DIR\include;" echo "CPLUS_INCLUDE_PATH=$env:CPLUS_INCLUDE_PATH" - echo "CPLUS_INCLUDE_PATH=$env:CPLUS_INCLUDE_PATH" >> $env:GITHUB_ENV + echo "CPLUS_INCLUDE_PATH=$env:CPLUS_INCLUDE_PATH" >> $env:GITHUB_ENV } else { $env:CPLUS_INCLUDE_PATH="$env:LLVM_DIR\llvm\include;$env:LLVM_DIR\clang\include;$env:LLVM_BUILD_DIR\include;$env:LLVM_BUILD_DIR\tools\clang\include;$env:PWD_DIR\include;" echo "CPLUS_INCLUDE_PATH=$env:CPLUS_INCLUDE_PATH" - echo "CPLUS_INCLUDE_PATH=$env:CPLUS_INCLUDE_PATH" >> $env:GITHUB_ENV + echo "CPLUS_INCLUDE_PATH=$env:CPLUS_INCLUDE_PATH" >> $env:GITHUB_ENV } - + $env:CB_PYTHON_DIR="$env:PWD_DIR\cppyy-backend\python" echo "CB_PYTHON_DIR=$env:CB_PYTHON_DIR" - echo "CB_PYTHON_DIR=$env:CB_PYTHON_DIR" >> $env:GITHUB_ENV + echo "CB_PYTHON_DIR=$env:CB_PYTHON_DIR" >> $env:GITHUB_ENV $env:CPPINTEROP_DIR="$env:CB_PYTHON_DIR\cppyy-backend" echo "CPPINTEROP_DIR=$env:CPPINTEROP_DIR" - echo "CPPINTEROP_DIR=$env:CPPINTEROP_DIR" >> $env:GITHUB_ENV + echo "CPPINTEROP_DIR=$env:CPPINTEROP_DIR" >> $env:GITHUB_ENV # Build CppInterOp next to cling and llvm-project. - mkdir build + mkdir build cd build $env:CPPINTEROP_BUILD_DIR="$env:PWD_DIR" echo "CPPINTEROP_BUILD_DIR=$env:CPPINTEROP_BUILD_DIR" - echo "CPPINTEROP_BUILD_DIR=$env:CPPINTEROP_BUILD_DIR" >> $env:GITHUB_ENV + echo "CPPINTEROP_BUILD_DIR=$env:CPPINTEROP_BUILD_DIR" >> $env:GITHUB_ENV if ( "${{ matrix.cling }}" -imatch "On" ) { cmake -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} ` diff --git a/.github/workflows/clang-tidy-review.yml b/.github/workflows/clang-tidy-review.yml index c79922ad0..6cdfef8e8 100644 --- a/.github/workflows/clang-tidy-review.yml +++ b/.github/workflows/clang-tidy-review.yml @@ -1,6 +1,6 @@ name: clang-tidy-review -on: +on: pull_request: paths: - '**.h' @@ -29,7 +29,7 @@ jobs: - name: install lit run: pip install lit - + - name: Run clang-tidy uses: ZedThree/clang-tidy-review@v0.20.1 id: review diff --git a/.github/workflows/deploy-pages.yml b/.github/workflows/deploy-pages.yml index 2942c1c79..0707ce4f8 100644 --- a/.github/workflows/deploy-pages.yml +++ b/.github/workflows/deploy-pages.yml @@ -7,12 +7,12 @@ on: - main schedule: - cron: '30 20 * * *' # Warning: Timezone dep - 20:00 is 1:00 - + permissions: contents: read pages: write id-token: write - + jobs: build: runs-on: ${{ matrix.os }} @@ -33,7 +33,7 @@ jobs: with: fetch-depth: 0 - - name: Set up Python + - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.11' @@ -87,7 +87,7 @@ jobs: llvm-project ${{ matrix.cling=='On' && 'cling' || '' }} key: ${{ env.CLING_HASH }}-${{ runner.os }}-${{ matrix.os }}-clang-${{ matrix.clang-runtime }}.x-emscripten - + - name: Emscripten build of CppInterOp on Unix systems if: ${{ runner.os != 'windows' }} shell: bash -l {0} @@ -100,7 +100,7 @@ jobs: export PREFIX=$MAMBA_ROOT_PREFIX/envs/CppInterOp-wasm export CMAKE_PREFIX_PATH=$PREFIX export CMAKE_SYSTEM_PREFIX_PATH=$PREFIX - + LLVM_DIR="$(pwd)/llvm-project" LLVM_BUILD_DIR="$(pwd)/llvm-project/build" cling_on=$(echo "${{ matrix.cling }}" | tr '[:lower:]' '[:upper:]') @@ -149,7 +149,7 @@ jobs: cd .. - echo "SYSROOT_PATH=$SYSROOT_PATH" >> $GITHUB_ENV + echo "SYSROOT_PATH=$SYSROOT_PATH" >> $GITHUB_ENV echo "CB_PYTHON_DIR=$CB_PYTHON_DIR" >> $GITHUB_ENV echo "CPPINTEROP_DIR=$CPPINTEROP_DIR" >> $GITHUB_ENV echo "LLVM_BUILD_DIR=$LLVM_BUILD_DIR" >> $GITHUB_ENV @@ -161,13 +161,13 @@ jobs: run: | ./emsdk/emsdk activate ${{matrix.emsdk_ver}} source ./emsdk/emsdk_env.sh - micromamba activate CppInterOp-wasm + micromamba activate CppInterOp-wasm git clone --depth=1 https://github.com/compiler-research/xeus-cpp.git cd ./xeus-cpp mkdir build pushd build - export CMAKE_PREFIX_PATH=${{ env.PREFIX }} - export CMAKE_SYSTEM_PREFIX_PATH=${{ env.PREFIX }} + export CMAKE_PREFIX_PATH=${{ env.PREFIX }} + export CMAKE_SYSTEM_PREFIX_PATH=${{ env.PREFIX }} emcmake cmake \ -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ -DCMAKE_PREFIX_PATH=${{ env.PREFIX }} \ @@ -178,7 +178,7 @@ jobs: .. emmake make -j ${{ env.ncpus }} install - - name: Jupyter Lite integration + - name: Jupyter Lite integration shell: bash -l {0} run: | cd ./xeus-cpp/ diff --git a/.github/workflows/emscripten.yml b/.github/workflows/emscripten.yml index fbd9de553..16400017d 100644 --- a/.github/workflows/emscripten.yml +++ b/.github/workflows/emscripten.yml @@ -33,7 +33,7 @@ jobs: clang-runtime: '19' cling: Off llvm_enable_projects: "clang;lld" - llvm_targets_to_build: "WebAssembly" + llvm_targets_to_build: "WebAssembly" emsdk_ver: "3.1.73" - name: ubu24-x86-clang-repl-19-emscripten os: ubuntu-24.04 @@ -42,13 +42,13 @@ jobs: llvm_enable_projects: "clang;lld" llvm_targets_to_build: "WebAssembly" emsdk_ver: "3.1.73" - + steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set up Python + - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.11' @@ -72,7 +72,7 @@ jobs: fi echo "CLING_HASH=$CLING_HASH" >> $GITHUB_ENV - echo "LLVM_HASH=$LLVM_HASH" >> $GITHUB_ENV + echo "LLVM_HASH=$LLVM_HASH" >> $GITHUB_ENV - name: Save PR Info on Windows systems if: ${{ runner.os == 'windows' }} @@ -83,8 +83,8 @@ jobs: echo ${{ github.repository }} > ./pr/REPO if ( "${{ matrix.cling }}" -imatch "On" ) - { - $env:CLING_HASH_TEMP = ( git ls-remote https://github.com/root-project/cling.git refs/tags/v${{ matrix.cling-version }} ) + { + $env:CLING_HASH_TEMP = ( git ls-remote https://github.com/root-project/cling.git refs/tags/v${{ matrix.cling-version }} ) $env:CLING_HASH = $env:CLING_HASH_TEMP -replace "\t","-" } else @@ -98,7 +98,7 @@ jobs: echo "CLING_HASH=$env:CLING_HASH" echo "LLVM_HASH=$env:LLVM_HASH" - + echo "CLING_HASH=$env:CLING_HASH" >> $GITHUB_ENV echo "LLVM_HASH=$env:LLVM_HASH" >> $GITHUB_ENV @@ -130,7 +130,7 @@ jobs: run: | echo "BUILD_TYPE=Release" >> $env:GITHUB_ENV echo "CODE_COVERAGE=0" >> $env:GITHUB_ENV - $env:ncpus=$([Environment]::ProcessorCount) + $env:ncpus=$([Environment]::ProcessorCount) echo "ncpus=$env:ncpus" >> $env:GITHUB_ENV - name: Install deps on Windows @@ -152,7 +152,7 @@ jobs: brew unlink "$pkg" brew link --overwrite "$pkg" done - brew upgrade openssl >/dev/null 2>&1 + brew upgrade openssl >/dev/null 2>&1 brew install ninja brew upgrade @@ -173,7 +173,7 @@ jobs: cling_on=$(echo "${{ matrix.cling }}" | tr '[:lower:]' '[:upper:]') if [[ "${cling_on}" == "ON" ]]; then git clone https://github.com/root-project/cling.git - cd ./cling + 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 @@ -261,11 +261,11 @@ jobs: - name: Build LLVM/Cling on Windows systems if the cache is invalid if: ${{ runner.os == 'windows' && steps.cache.outputs.cache-hit != 'true' }} run: | - + if ( "${{ matrix.cling }}" -imatch "On" ) { git clone https://github.com/root-project/cling.git - cd ./cling + 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 @@ -341,7 +341,7 @@ jobs: rm -r -force $(find.exe . -maxdepth 1 ! -name "include" ! -name "lib" ! -name "cmake" ! -name "utils" ! -name ".") cd ..\clang\ rm -r -force $(find.exe . -maxdepth 1 ! -name "include" ! -name "lib" ! -name "cmake" ! -name "utils" ! -name ".") - cd ..\.. + cd ..\.. } else { @@ -349,8 +349,8 @@ jobs: rm -r -force $(find.exe . -maxdepth 1 ! -name "include" ! -name "lib" ! -name "cmake" ! -name ".") cd ..\clang\ rm -r -force $(find.exe . -maxdepth 1 ! -name "include" ! -name "lib" ! -name "cmake" ! -name ".") - cd ..\.. - } + cd ..\.. + } - name: Save Cache LLVM/Clang runtime build directory (Unix Systems Emscripten) uses: actions/cache/save@v4 @@ -447,7 +447,7 @@ jobs: llvm-project ${{ matrix.cling=='On' && 'cling' || '' }} key: ${{ env.CLING_HASH }}-${{ runner.os }}-${{ matrix.os }}-clang-${{ matrix.clang-runtime }}.x-emscripten - + - name: Emscripten build of CppInterOp on Unix systems if: ${{ runner.os != 'windows' }} shell: bash -l {0} @@ -460,7 +460,7 @@ jobs: export PREFIX=$MAMBA_ROOT_PREFIX/envs/CppInterOp-wasm export CMAKE_PREFIX_PATH=$PREFIX export CMAKE_SYSTEM_PREFIX_PATH=$PREFIX - + LLVM_DIR="$(pwd)/llvm-project" LLVM_BUILD_DIR="$(pwd)/llvm-project/build" cling_on=$(echo "${{ matrix.cling }}" | tr '[:lower:]' '[:upper:]') @@ -471,7 +471,7 @@ jobs: else CPLUS_INCLUDE_PATH="${LLVM_DIR}/llvm/include:${LLVM_DIR}/clang/include:${LLVM_BUILD_DIR}/include:${LLVM_BUILD_DIR}/tools/clang/include:$PWD/include" fi - + # Build CppInterOp next to cling and llvm-project. mkdir build cd build @@ -522,13 +522,13 @@ jobs: run: | ./emsdk/emsdk activate ${{matrix.emsdk_ver}} source ./emsdk/emsdk_env.sh - micromamba activate CppInterOp-wasm + micromamba activate CppInterOp-wasm git clone --depth=1 https://github.com/compiler-research/xeus-cpp.git cd ./xeus-cpp mkdir build pushd build - export CMAKE_PREFIX_PATH=${{ env.PREFIX }} - export CMAKE_SYSTEM_PREFIX_PATH=${{ env.PREFIX }} + export CMAKE_PREFIX_PATH=${{ env.PREFIX }} + export CMAKE_SYSTEM_PREFIX_PATH=${{ env.PREFIX }} emcmake cmake \ -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ -DCMAKE_PREFIX_PATH=${{ env.PREFIX }} \ @@ -538,3 +538,4 @@ jobs: -DSYSROOT_PATH=${{ env.SYSROOT_PATH }} \ .. emmake make -j ${{ env.ncpus }} install + diff --git a/.github/workflows/markdown-linter.yml b/.github/workflows/markdown-linter.yml index 83fad45d7..539f8845d 100644 --- a/.github/workflows/markdown-linter.yml +++ b/.github/workflows/markdown-linter.yml @@ -1,7 +1,7 @@ --- name: Markdown-Linter -on: +on: pull_request: branches: [main] paths: @@ -31,7 +31,7 @@ jobs: fetch-depth: 0 - name: Super-linter - uses: super-linter/super-linter@v7.2.0 + uses: super-linter/super-linter@v7.2.0 env: VALIDATE_ALL_CODEBASE: false GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/CMakeLists.txt b/CMakeLists.txt index cb0c588f9..f9020dc34 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -246,9 +246,9 @@ endif() message(fatal "LLVM/CppInterOp requires c++14 or later") endif() endif() - + ## Find supported Cling - + if (CPPINTEROP_USE_CLING) if (NOT Cling_FOUND AND DEFINED Cling_DIR) find_package(Cling REQUIRED CONFIG ${cling_extra_hints} NO_DEFAULT_PATH) diff --git a/include/clang/Interpreter/CppInterOp.h b/include/clang/Interpreter/CppInterOp.h index 875d1227e..5137bb787 100644 --- a/include/clang/Interpreter/CppInterOp.h +++ b/include/clang/Interpreter/CppInterOp.h @@ -315,8 +315,8 @@ namespace Cpp { /// underlying decl is not a class it returns the input unchanged. CPPINTEROP_API TCppScope_t GetUnderlyingScope(TCppScope_t scope); - /// Gets the namespace or class (by stripping typedefs) for the name - /// passed as a parameter, and if the parent is not passed, + /// Gets the namespace or class (by stripping typedefs) for the name + /// passed as a parameter, and if the parent is not passed, /// then global scope will be assumed. CPPINTEROP_API TCppScope_t GetScope(const std::string& name, TCppScope_t parent = nullptr); diff --git a/lib/Interpreter/CMakeLists.txt b/lib/Interpreter/CMakeLists.txt index 7568f7f3f..eccfc39af 100644 --- a/lib/Interpreter/CMakeLists.txt +++ b/lib/Interpreter/CMakeLists.txt @@ -114,12 +114,12 @@ endif() if(EMSCRIPTEN) - # FIXME: When dynamically linking the Emscripten shared library to the + # FIXME: When dynamically linking the Emscripten shared library to the # unit tests main_module you get errors due to undefined symbols. The reading of the file # below into a SYMBOLS_LIST variable is a temporary workaround that exports the undefined # symbols from the shared library, until it can be determined why they are not being exported already. file(READ "${CMAKE_SOURCE_DIR}/lib/Interpreter/exports.ld" SYMBOLS_LIST) - + # Replace newlines with spaces string(REPLACE "\n" " " SYMBOLS_LIST "${SYMBOLS_LIST}") diff --git a/lib/Interpreter/DynamicLibraryManagerSymbol.cpp b/lib/Interpreter/DynamicLibraryManagerSymbol.cpp index ac1857fa5..5a0afce28 100644 --- a/lib/Interpreter/DynamicLibraryManagerSymbol.cpp +++ b/lib/Interpreter/DynamicLibraryManagerSymbol.cpp @@ -908,7 +908,7 @@ namespace Cpp { // of the Object file. They are present in the ExportDirectory section. for (auto I=CoffObj->export_directory_begin(), E=CoffObj->export_directory_end(); I != E; I = ++I) { - // All the symbols are already flagged as exported. + // All the symbols are already flagged as exported. // We cannot really ignore symbols based on flags as we do on unix. StringRef Name; auto Err = I->getSymbolName(Name); diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt index dddb1aaf7..045a4a994 100644 --- a/unittests/CMakeLists.txt +++ b/unittests/CMakeLists.txt @@ -43,7 +43,7 @@ endif() # FIXME: Just call gtest_add_tests this function is available. #gtest_add_tests(${name} "${Arguments}" AUTO) endfunction() - + add_subdirectory(CppInterOp) add_custom_target(check-cppinterop COMMAND ${CMAKE_CTEST_COMMAND} -V --build-config $ diff --git a/unittests/CppInterOp/EnumReflectionTest.cpp b/unittests/CppInterOp/EnumReflectionTest.cpp index 3ec03e136..a8fc1a028 100644 --- a/unittests/CppInterOp/EnumReflectionTest.cpp +++ b/unittests/CppInterOp/EnumReflectionTest.cpp @@ -190,7 +190,7 @@ TEST(EnumReflectionTest, GetIntegerTypeFromEnumType) { #else EXPECT_EQ(get_int_type_from_enum_var(Decls[10]), "unsigned int"); #endif - EXPECT_EQ(get_int_type_from_enum_var(Decls[11]), "NULL TYPE"); // When a non Enum Type variable is used + EXPECT_EQ(get_int_type_from_enum_var(Decls[11]), "NULL TYPE"); // When a non Enum Type variable is used } TEST(EnumReflectionTest, GetEnumConstants) { diff --git a/unittests/CppInterOp/FunctionReflectionTest.cpp b/unittests/CppInterOp/FunctionReflectionTest.cpp index 42ab8cb6a..72a157be1 100644 --- a/unittests/CppInterOp/FunctionReflectionTest.cpp +++ b/unittests/CppInterOp/FunctionReflectionTest.cpp @@ -170,7 +170,7 @@ TEST(FunctionReflectionTest, HasDefaultConstructor) { int sum(int a, int b){ return a+b; } - + )"; GetAllTopLevelDecls(code, Decls); @@ -277,7 +277,7 @@ TEST(FunctionReflectionTest, GetClassDecls) { template long get_float_size(int i, A a = A(), B b = B()) {} - + template void get_char_size(long k, A, char ch = 'a', double l = 0.0) {} @@ -294,7 +294,7 @@ TEST(FunctionReflectionTest, GetClassDecls) { GetAllTopLevelDecls(code, Decls); GetAllSubDecls(Decls[0], SubDecls); - + std::vector methods; std::vector template_methods; @@ -337,7 +337,7 @@ TEST(FunctionReflectionTest, GetFunctionReturnType) { char get_string(A) { return 'A'; } - + template void get_size() {} @@ -412,7 +412,7 @@ TEST(FunctionReflectionTest, GetFunctionNumArgs) { char get_string(A, int i) { return 'A'; } - + template void get_size() {} @@ -452,7 +452,7 @@ TEST(FunctionReflectionTest, GetFunctionRequiredArgs) { template long get_size(int i, A a = A(), B b = B()) {} - + template void get_size(long k, A, char ch = 'a', double l = 0.0) {} }; @@ -693,7 +693,7 @@ TEST(FunctionReflectionTest, BestOverloadFunctionMatch1) { long MyTemplatedMethodClass::get_size(A a, B b) { return sizeof(A) + sizeof(B); } - + template long MyTemplatedMethodClass::get_size(T a) { return N + sizeof(T) + a; @@ -818,7 +818,7 @@ TEST(FunctionReflectionTest, BestOverloadFunctionMatch3) { template struct A { T value; - + template A operator-(A rhs) { return A{value - rhs.value}; @@ -1293,12 +1293,12 @@ TEST(FunctionReflectionTest, GetFunctionCallWrapper) { FCI_Dtor.Invoke(object); output = testing::internal::GetCapturedStdout(); EXPECT_EQ(output, "Dtor Called\n"); - + std::vector Decls1; std::string code1 = R"( - template + template struct S { - + static T Add(T a, T b) { return a + b; } }; @@ -1430,7 +1430,7 @@ TEST(FunctionReflectionTest, GetFunctionArgName) { template long get_size(int i, A a = A(), B b = B()) {} - + template void get_size(long k, A, char ch = 'a', double l = 0.0) {} )"; @@ -1470,7 +1470,7 @@ TEST(FunctionReflectionTest, GetFunctionArgDefault) { template long get_size(int i, A a = A(), B b = B()) {} - + template void get_size(long k, A, char ch = 'a', double l = 0.0) {} diff --git a/unittests/CppInterOp/ScopeReflectionTest.cpp b/unittests/CppInterOp/ScopeReflectionTest.cpp index cda468bc0..db441e124 100644 --- a/unittests/CppInterOp/ScopeReflectionTest.cpp +++ b/unittests/CppInterOp/ScopeReflectionTest.cpp @@ -101,14 +101,14 @@ TEST(ScopeReflectionTest, IsClassPolymorphic) { std::vector Decls; GetAllTopLevelDecls(R"( namespace N {} - + class C{}; - + class C2 { public: virtual ~C2() {} }; - + int I; )", Decls); @@ -577,7 +577,7 @@ TEST(ScopeReflectionTest, GetScopeFromType) { N::S s; int i; - + N::T t; N::E e; diff --git a/unittests/CppInterOp/TypeReflectionTest.cpp b/unittests/CppInterOp/TypeReflectionTest.cpp index 5c5e12118..7d5dafcc2 100644 --- a/unittests/CppInterOp/TypeReflectionTest.cpp +++ b/unittests/CppInterOp/TypeReflectionTest.cpp @@ -384,7 +384,7 @@ TEST(TypeReflectionTest, GetTypeFromScope) { struct S {}; int a = 10; )"; - + GetAllTopLevelDecls(code, Decls); EXPECT_EQ(Cpp::GetTypeAsString(Cpp::GetTypeFromScope(Decls[0])), "C"); @@ -476,7 +476,7 @@ TEST(TypeReflectionTest, GetDimensions) { { EXPECT_EQ(dims[i], truth_dims[i]); } - + // Variable c dims = Cpp::GetDimensions(Cpp::GetVariableType(Decls[2])); truth_dims = std::vector({1, 2}); diff --git a/unittests/CppInterOp/VariableReflectionTest.cpp b/unittests/CppInterOp/VariableReflectionTest.cpp index 0122a156f..0d8376f4d 100644 --- a/unittests/CppInterOp/VariableReflectionTest.cpp +++ b/unittests/CppInterOp/VariableReflectionTest.cpp @@ -166,11 +166,11 @@ TEST(VariableReflectionTest, GetTypeAsString) { std::string code = R"( namespace my_namespace { - + struct Container { int value; }; - + struct Wrapper { Container item; }; @@ -490,7 +490,7 @@ TEST(VariableReflectionTest, DISABLED_GetArrayDimensions) { //FIXME: is_vec_eq is an unused variable until test does something //auto is_vec_eq = [](const std::vector &arr_dims, // const std::vector &truth_vals) { - // if (arr_dims.size() != truth_vals.size()) + // if (arr_dims.size() != truth_vals.size()) // return false; // // return std::equal(arr_dims.begin(), arr_dims.end(), truth_vals.begin());