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

[wip] Turn on cppyy for Ubuntu 22.04 arm jobs ci #126

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
31 changes: 19 additions & 12 deletions .github/workflows/Ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -343,26 +343,26 @@ jobs:
compiler: gcc-12
clang-runtime: '19'
cling: Off
cppyy: Off
- name: ubu22-arm-gcc12-clang-repl-18
cppyy: On
- name: ubu22-arm-gcc12-clang-repl-18-cppyy
os: ubuntu-22.04-arm
compiler: gcc-12
clang-runtime: '18'
cling: Off
cppyy: Off
- name: ubu22-arm-gcc12-clang-repl-17
cppyy: On
- name: ubu22-arm-gcc12-clang-repl-17-cppyy
os: ubuntu-22.04-arm
compiler: gcc-12
clang-runtime: '17'
cling: Off
cppyy: Off
- name: ubu22-arm-gcc9-clang13-cling
cppyy: On
- name: ubu22-arm-gcc9-clang13-cling-cppyy
os: ubuntu-22.04-arm
compiler: gcc-9
clang-runtime: '13'
cling: On
cling-version: '1.0'
cppyy: Off
cppyy: On

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -588,7 +588,8 @@ jobs:
# source virtual environment
source ${{ github.workspace }}/CppInterOp/.venv/bin/activate
cd ${{ github.workspace }}
python -m pip install --upgrade . --no-deps
python -m pip install uv
python -m uv pip install --upgrade . --no-deps --verbose
cd ..

- name: Run cppyy
Expand All @@ -610,9 +611,9 @@ jobs:
echo ::group::Prepare For Testing
make all
python -m pip install --upgrade pip
python -m pip install pytest
python -m pip install pytest-xdist
python -m pip install numba
python -m uv pip install pytest
python -m uv pip install pytest-xdist
python -m uv pip install numba
echo ::endgroup::
echo ::group::Run complete test suite
set -o pipefail
Expand Down Expand Up @@ -642,7 +643,13 @@ jobs:

echo "Running valgrind on passing tests"
CLANG_VERSION="${{ matrix.clang-runtime }}"
SUPPRESSION_FILE="../etc/clang${CLANG_VERSION}-valgrind.supp"

if [[ "${{ matrix.os }}" == *"arm"* ]]; then
SUPPRESSION_FILE="../etc/clang${CLANG_VERSION}-valgrind_arm.supp"
else
SUPPRESSION_FILE="../etc/clang${CLANG_VERSION}-valgrind.supp"
fi

valgrind --show-error-list=yes --error-exitcode=1 --track-origins=yes --gen-suppressions=all --suppressions="${SUPPRESSION_FILE}" --suppressions=../etc/valgrind-cppyy-cling.supp python -m pytest -m "not xfail" -sv -ra
export RETCODE=+$?
echo ::endgroup::
Expand Down
34 changes: 34 additions & 0 deletions etc/clang13-valgrind_arm.supp
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
Cppyy Suppression
Memcheck:Free
fun:free
obj:*
fun:_ZNK3Cpp7JitCall6InvokeEPvNS0_7ArgListES1_
fun:_ZL11WrapperCallPvmS_S_S_
fun:_ZN5Cppyy5CallVEPvS0_mS0_
fun:_ZL8GILCallVPvS_PN8CPyCppyy11CallContextE
fun:_ZN8CPyCppyy12_GLOBAL__N_112VoidExecutor7ExecuteEPvS2_PNS_11CallContextE
fun:_ZN8CPyCppyy9CPPMethod11ExecuteFastEPvlPNS_11CallContextE
fun:_ZN8CPyCppyy9CPPMethod7ExecuteEPvlPNS_11CallContextE
fun:_ZN8CPyCppyy11CPPFunction4CallERPNS_11CPPInstanceEPKP7_objectmS5_PNS_11CallContextE
fun:_ZN8CPyCppyy12_GLOBAL__N_1L13mp_vectorcallEPNS_11CPPOverloadEPKP7_objectmS4_
fun:_PyObject_VectorcallTstate
fun:PyObject_Vectorcall
}

# To address:
# Mismatched free() / delete / delete []
# at 0x4878480: free (vg_replace_malloc.c:989)
# by 0x2C82F02B: ???
# Address 0x258d7f70 is 0 bytes inside a block of size 6 alloc'd
# at 0x4877194: operator new[](unsigned long) (vg_replace_malloc.c:729)
# by 0x2C82B057: ???
#
# On Ubuntu ARM, that also causes certain tests to fail.

{
Mismatched free()
Memcheck:Free
fun:free
obj:*
}
380 changes: 380 additions & 0 deletions etc/clang17-valgrind_arm.supp

Large diffs are not rendered by default.

380 changes: 380 additions & 0 deletions etc/clang18-valgrind_arm.supp

Large diffs are not rendered by default.

187 changes: 187 additions & 0 deletions etc/clang19-valgrind_arm.supp
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
{
LLVM 19 suppressions : CodeGen
Memcheck:Cond
fun:_ZN5clang7CodeGen13CodeGenModule38SetLLVMFunctionAttributesForDefinitionEPKNS_4DeclEPN4llvm8FunctionE
fun:_ZN5clang7CodeGen13CodeGenModule28EmitGlobalFunctionDefinitionENS_10GlobalDeclEPN4llvm11GlobalValueE
fun:_ZN5clang7CodeGen13CodeGenModule20EmitGlobalDefinitionENS_10GlobalDeclEPN4llvm11GlobalValueE
fun:_ZN5clang7CodeGen13CodeGenModule10EmitGlobalENS_10GlobalDeclE
fun:_ZN5clang7CodeGen13CodeGenModule16EmitTopLevelDeclEPNS_4DeclE.part.0
fun:_ZN12_GLOBAL__N_117CodeGeneratorImpl18HandleTopLevelDeclEN5clang12DeclGroupRefE
fun:_ZN5clang15BackendConsumer18HandleTopLevelDeclENS_12DeclGroupRefE
fun:_ZN5clang22IncrementalASTConsumer18HandleTopLevelDeclENS_12DeclGroupRefE
fun:_ZN5clang17IncrementalParser23ParseOrWrapTopLevelDeclEv
fun:_ZN5clang17IncrementalParser5ParseEN4llvm9StringRefE
fun:_ZN5clang11Interpreter5ParseEN4llvm9StringRefE
fun:_ZN3Cpp11Interpreter7processERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN5clang5ValueEPPNS9_22PartialTranslationUnitEb.isra.0
}

{
LLVM 19 suppressions : setBits
Memcheck:Cond
fun:_ZN4llvm5APInt7setBitsEjj
fun:_ZL16computeKnownBitsPKN4llvm5ValueERKNS_5APIntERNS_9KnownBitsEjRKNS_13SimplifyQueryE
fun:_ZN4llvm16computeKnownBitsEPKNS_5ValueERNS_9KnownBitsEjRKNS_13SimplifyQueryE
fun:_ZN4llvm16computeKnownBitsEPKNS_5ValueERNS_9KnownBitsERKNS_10DataLayoutEjPNS_15AssumptionCacheEPKNS_11InstructionEPKNS_13DominatorTreeEb
fun:_ZNK4llvm12SelectionDAG13InferPtrAlignENS_7SDValueE
fun:_ZN12_GLOBAL__N_111DAGCombiner9visitLOADEPN4llvm6SDNodeE
fun:_ZN12_GLOBAL__N_111DAGCombiner7combineEPN4llvm6SDNodeE
fun:_ZN12_GLOBAL__N_111DAGCombiner3RunEN4llvm12CombineLevelE
fun:_ZN4llvm12SelectionDAG7CombineENS_12CombineLevelEPNS_9AAResultsENS_15CodeGenOptLevelE
fun:_ZN4llvm16SelectionDAGISel17CodeGenAndEmitDAGEv
fun:_ZN4llvm16SelectionDAGISel20SelectAllBasicBlocksERKNS_8FunctionE
fun:_ZN4llvm16SelectionDAGISel20runOnMachineFunctionERNS_15MachineFunctionE
}

{
LLVM 19 suppressions : setBits
Memcheck:Cond
fun:_ZN4llvm5APInt7setBitsEjj
fun:_ZL16computeKnownBitsPKN4llvm5ValueERKNS_5APIntERNS_9KnownBitsEjRKNS_13SimplifyQueryE
fun:_ZN4llvm16computeKnownBitsEPKNS_5ValueERNS_9KnownBitsEjRKNS_13SimplifyQueryE
fun:_ZN4llvm16computeKnownBitsEPKNS_5ValueERNS_9KnownBitsERKNS_10DataLayoutEjPNS_15AssumptionCacheEPKNS_11InstructionEPKNS_13DominatorTreeEb
fun:_ZNK4llvm12SelectionDAG13InferPtrAlignENS_7SDValueE
fun:_ZN12_GLOBAL__N_111DAGCombiner9visitLOADEPN4llvm6SDNodeE
fun:_ZN12_GLOBAL__N_111DAGCombiner7combineEPN4llvm6SDNodeE
fun:_ZN12_GLOBAL__N_111DAGCombiner3RunEN4llvm12CombineLevelE
fun:_ZN4llvm12SelectionDAG7CombineENS_12CombineLevelEPNS_9AAResultsENS_15CodeGenOptLevelE
fun:_ZN4llvm16SelectionDAGISel17CodeGenAndEmitDAGEv
fun:_ZN4llvm16SelectionDAGISel20SelectAllBasicBlocksERKNS_8FunctionE
fun:_ZN4llvm16SelectionDAGISel20runOnMachineFunctionERNS_15MachineFunctionE
}

{
LLVM 19 suppressions : setBits
Memcheck:Cond
fun:_ZN4llvm5APInt7setBitsEjj
fun:_ZL16computeKnownBitsPKN4llvm5ValueERKNS_5APIntERNS_9KnownBitsEjRKNS_13SimplifyQueryE
fun:_ZN4llvm16computeKnownBitsEPKNS_5ValueERNS_9KnownBitsEjRKNS_13SimplifyQueryE
fun:_ZN4llvm16computeKnownBitsEPKNS_5ValueERNS_9KnownBitsERKNS_10DataLayoutEjPNS_15AssumptionCacheEPKNS_11InstructionEPKNS_13DominatorTreeEb
fun:_ZNK4llvm12SelectionDAG13InferPtrAlignENS_7SDValueE
fun:_ZN12_GLOBAL__N_111DAGCombiner9visitLOADEPN4llvm6SDNodeE
fun:_ZN12_GLOBAL__N_111DAGCombiner7combineEPN4llvm6SDNodeE
fun:_ZN12_GLOBAL__N_111DAGCombiner3RunEN4llvm12CombineLevelE
fun:_ZN4llvm12SelectionDAG7CombineENS_12CombineLevelEPNS_9AAResultsENS_15CodeGenOptLevelE
fun:_ZN4llvm16SelectionDAGISel17CodeGenAndEmitDAGEv
fun:_ZN4llvm16SelectionDAGISel20SelectAllBasicBlocksERKNS_8FunctionE
fun:_ZN4llvm16SelectionDAGISel20runOnMachineFunctionERNS_15MachineFunctionE
}

{
LLVM 19 suppressions : CodeGen
Memcheck:Cond
fun:_ZN5clang7CodeGen13CodeGenModule38SetLLVMFunctionAttributesForDefinitionEPKNS_4DeclEPN4llvm8FunctionE
fun:_ZN5clang7CodeGen13CodeGenModule28EmitGlobalFunctionDefinitionENS_10GlobalDeclEPN4llvm11GlobalValueE
fun:_ZN5clang7CodeGen13CodeGenModule20EmitGlobalDefinitionENS_10GlobalDeclEPN4llvm11GlobalValueE
fun:_ZN5clang7CodeGen13CodeGenModule10EmitGlobalENS_10GlobalDeclE
fun:_ZN5clang7CodeGen13CodeGenModule16EmitTopLevelDeclEPNS_4DeclE.part.0
fun:_ZN12_GLOBAL__N_117CodeGeneratorImpl18HandleTopLevelDeclEN5clang12DeclGroupRefE
fun:_ZN5clang15BackendConsumer18HandleTopLevelDeclENS_12DeclGroupRefE
fun:_ZN5clang22IncrementalASTConsumer18HandleTopLevelDeclENS_12DeclGroupRefE
fun:_ZN5clang17IncrementalParser23ParseOrWrapTopLevelDeclEv
fun:_ZN5clang17IncrementalParser5ParseEN4llvm9StringRefE
fun:_ZN5clang11Interpreter5ParseEN4llvm9StringRefE
fun:_ZN3Cpp11Interpreter5ParseEN4llvm9StringRefE
}

{
LLVM 19 suppressions : CodeGen
Memcheck:Cond
fun:_ZN5clang7CodeGen13CodeGenModule38SetLLVMFunctionAttributesForDefinitionEPKNS_4DeclEPN4llvm8FunctionE
fun:_ZN5clang7CodeGen14CodeGenVTables14maybeEmitThunkENS_10GlobalDeclERKNS_9ThunkInfoEb
fun:_ZN5clang7CodeGen14CodeGenVTables10EmitThunksENS_10GlobalDeclE
fun:_ZN5clang7CodeGen13CodeGenModule20EmitGlobalDefinitionENS_10GlobalDeclEPN4llvm11GlobalValueE
fun:_ZN5clang7CodeGen13CodeGenModule12EmitDeferredEv
fun:_ZN5clang7CodeGen13CodeGenModule12EmitDeferredEv
fun:_ZN5clang7CodeGen13CodeGenModule7ReleaseEv
fun:_ZN12_GLOBAL__N_117CodeGeneratorImpl21HandleTranslationUnitERN5clang10ASTContextE
fun:_ZN5clang15BackendConsumer21HandleTranslationUnitERNS_10ASTContextE
fun:_ZN5clang17IncrementalParser23ParseOrWrapTopLevelDeclEv
fun:_ZN5clang17IncrementalParser5ParseEN4llvm9StringRefE
fun:_ZN5clang11Interpreter5ParseEN4llvm9StringRefE
}

{
LLVM 19 suppressions : CodeGen
Memcheck:Cond
fun:_ZN5clang7CodeGen13CodeGenModule38SetLLVMFunctionAttributesForDefinitionEPKNS_4DeclEPN4llvm8FunctionE
fun:_ZN5clang7CodeGen13CodeGenModule18codegenCXXStructorENS_10GlobalDeclE
fun:_ZN12_GLOBAL__N_113ItaniumCXXABI15emitCXXStructorEN5clang10GlobalDeclE
fun:_ZN5clang7CodeGen13CodeGenModule20EmitGlobalDefinitionENS_10GlobalDeclEPN4llvm11GlobalValueE
fun:_ZN5clang7CodeGen13CodeGenModule12EmitDeferredEv
fun:_ZN5clang7CodeGen13CodeGenModule12EmitDeferredEv
fun:_ZN5clang7CodeGen13CodeGenModule12EmitDeferredEv
fun:_ZN5clang7CodeGen13CodeGenModule12EmitDeferredEv
fun:_ZN5clang7CodeGen13CodeGenModule7ReleaseEv
fun:_ZN12_GLOBAL__N_117CodeGeneratorImpl21HandleTranslationUnitERN5clang10ASTContextE
fun:_ZN5clang15BackendConsumer21HandleTranslationUnitERNS_10ASTContextE
fun:_ZN5clang17IncrementalParser23ParseOrWrapTopLevelDeclEv
}

{
LLVM 19 suppressions : CodeGen
Memcheck:Cond
fun:_ZN5clang7CodeGen13CodeGenModule38SetLLVMFunctionAttributesForDefinitionEPKNS_4DeclEPN4llvm8FunctionE
fun:_ZN5clang7CodeGen13CodeGenModule18codegenCXXStructorENS_10GlobalDeclE
fun:_ZN12_GLOBAL__N_113ItaniumCXXABI15emitCXXStructorEN5clang10GlobalDeclE
fun:_ZN5clang7CodeGen13CodeGenModule20EmitGlobalDefinitionENS_10GlobalDeclEPN4llvm11GlobalValueE
fun:_ZN5clang7CodeGen13CodeGenModule12EmitDeferredEv
fun:_ZN5clang7CodeGen13CodeGenModule12EmitDeferredEv
fun:_ZN5clang7CodeGen13CodeGenModule7ReleaseEv
fun:_ZN12_GLOBAL__N_117CodeGeneratorImpl21HandleTranslationUnitERN5clang10ASTContextE
fun:_ZN5clang15BackendConsumer21HandleTranslationUnitERNS_10ASTContextE
fun:_ZN5clang17IncrementalParser23ParseOrWrapTopLevelDeclEv
fun:_ZN5clang17IncrementalParser5ParseEN4llvm9StringRefE
fun:_ZN5clang11Interpreter5ParseEN4llvm9StringRefE
}

{
LLVM 19 suppressions : CodeGen
Memcheck:Cond
fun:_ZN5clang7CodeGen13CodeGenModule38SetLLVMFunctionAttributesForDefinitionEPKNS_4DeclEPN4llvm8FunctionE
fun:_ZN5clang7CodeGen13CodeGenModule28EmitGlobalFunctionDefinitionENS_10GlobalDeclEPN4llvm11GlobalValueE
fun:_ZN5clang7CodeGen13CodeGenModule20EmitGlobalDefinitionENS_10GlobalDeclEPN4llvm11GlobalValueE
fun:_ZN5clang7CodeGen13CodeGenModule12EmitDeferredEv
fun:_ZN5clang7CodeGen13CodeGenModule12EmitDeferredEv
fun:_ZN5clang7CodeGen13CodeGenModule12EmitDeferredEv
fun:_ZN5clang7CodeGen13CodeGenModule7ReleaseEv
fun:_ZN12_GLOBAL__N_117CodeGeneratorImpl21HandleTranslationUnitERN5clang10ASTContextE
fun:_ZN5clang15BackendConsumer21HandleTranslationUnitERNS_10ASTContextE
fun:_ZN5clang17IncrementalParser23ParseOrWrapTopLevelDeclEv
fun:_ZN5clang17IncrementalParser5ParseEN4llvm9StringRefE
fun:_ZN5clang11Interpreter5ParseEN4llvm9StringRefE
}

{
Cppyy Suppression
Memcheck:Free
fun:free
obj:*
fun:_ZNK3Cpp7JitCall6InvokeEPvNS0_7ArgListES1_
fun:_ZL11WrapperCallPvmS_S_S_
fun:_ZN5Cppyy5CallVEPvS0_mS0_
fun:_ZL8GILCallVPvS_PN8CPyCppyy11CallContextE
fun:_ZN8CPyCppyy12_GLOBAL__N_112VoidExecutor7ExecuteEPvS2_PNS_11CallContextE
fun:_ZN8CPyCppyy9CPPMethod11ExecuteFastEPvlPNS_11CallContextE
fun:_ZN8CPyCppyy9CPPMethod7ExecuteEPvlPNS_11CallContextE
fun:_ZN8CPyCppyy11CPPFunction4CallERPNS_11CPPInstanceEPKP7_objectmS5_PNS_11CallContextE
fun:_ZN8CPyCppyy12_GLOBAL__N_1L13mp_vectorcallEPNS_11CPPOverloadEPKP7_objectmS4_
fun:_PyObject_VectorcallTstate
fun:PyObject_Vectorcall
}

# To address:
# Mismatched free() / delete / delete []
# at 0x4878480: free (vg_replace_malloc.c:989)
# by 0x2C82F02B: ???
# Address 0x258d7f70 is 0 bytes inside a block of size 6 alloc'd
# at 0x4877194: operator new[](unsigned long) (vg_replace_malloc.c:729)
# by 0x2C82B057: ???
#
# On Ubuntu ARM, that also causes certain tests to fail.

{
Mismatched free()
Memcheck:Free
fun:free
obj:*
}
2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
[build-system]
requires = ["setuptools", "wheel"]
backend-path = ["installer"]
build-backend = "cppyy_monkey_patch:main"
8 changes: 8 additions & 0 deletions test/support.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,16 @@ def setup_make(targetname):
IS_MAC = IS_MAC_ARM or IS_MAC_X86

IS_LINUX = 0
IS_LINUX_ARM = 0
IS_LINUX_X86 = 0
if 'linux' in sys.platform:
IS_LINUX = 1
import platform
if 'aarch64' in platform.machine():
IS_LINUX_ARM = 64
os.environ["CPPYY_UNCAUGHT_QUIET"] = "1"
mcbarton marked this conversation as resolved.
Show resolved Hide resolved
else:
IS_LINUX_X86 = 1

try:
import __pypy__
Expand Down
4 changes: 3 additions & 1 deletion test/test_api.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import py, os, sys
from pytest import raises, skip, mark
from .support import ispypy, IS_MAC
from .support import ispypy, IS_MAC, IS_LINUX_ARM


class TestAPI:
Expand Down Expand Up @@ -64,6 +64,7 @@ class APICheck2 {
m2 = API.Instance_FromVoidPtr(voidp, 'APICheck2')
assert m is m2

@mark.xfail(run=False, condition=IS_LINUX_ARM, reason="Crashes pytest on Linux ARM")
def test04_custom_converter(self):
"""Custom type converter"""

Expand Down Expand Up @@ -142,6 +143,7 @@ class APICheck3Converter : public CPyCppyy::Converter {
assert type(gA3b) == cppyy.gbl.APICheck3
assert not gA3b.wasFromMemoryCalled()

@mark.xfail(run=False, condition=IS_LINUX_ARM, reason="Crashes pytest on Linux ARM")
def test05_custom_executor(self):
"""Custom type executor"""

Expand Down
3 changes: 2 additions & 1 deletion test/test_concurrent.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import py, os, sys
from pytest import raises, skip, mark
from .support import IS_MAC_ARM, IS_MAC_X86
from .support import IS_MAC_ARM, IS_MAC_X86, IS_LINUX_ARM


class TestCONCURRENT:
Expand Down Expand Up @@ -166,6 +166,7 @@ def process(self, c):
assert "RuntimeError" in w.err_msg
assert "all wrong" in w.err_msg

@mark.xfail(run=False, condition=IS_LINUX_ARM, reason="Crashes pytest on Linux ARM")
def test05_float2d_callback(self):
"""Passing of 2-dim float arguments"""

Expand Down
3 changes: 2 additions & 1 deletion test/test_cpp11features.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import py, os, sys
from pytest import raises, mark
from .support import setup_make, ispypy, IS_CLANG_REPL
from .support import setup_make, ispypy, IS_CLANG_REPL, IS_LINUX_ARM


currpath = py.path.local(__file__).dirpath()
Expand All @@ -15,6 +15,7 @@ def setup_class(cls):
import cppyy
cls.cpp11features = cppyy.load_reflection_info(cls.test_dct)

@mark.xfail(run=False, condition=IS_LINUX_ARM, reason="Crashes pytest on Linux ARM")
def test01_smart_ptr(self):
"""Usage and access of std::shared/unique_ptr<>"""

Expand Down
Loading