Skip to content

Commit

Permalink
Add support for Ubuntu 22.04 arm
Browse files Browse the repository at this point in the history
  • Loading branch information
mcbarton committed Jan 27, 2025
1 parent 2b9656e commit 5db93d9
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 62 deletions.
25 changes: 13 additions & 12 deletions .github/workflows/Ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -284,31 +284,31 @@ jobs:
cling: On
cling-version: '1.0'
cppyy: On
- name: ubu22-arm-gcc12-clang-repl-19
- name: ubu22-arm-gcc12-clang-repl-19-cppyy
os: ubuntu-22.04-arm
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 @@ -534,7 +534,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 @@ -556,9 +557,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
39 changes: 0 additions & 39 deletions installer/cppyy_monkey_patch.py

This file was deleted.

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"
3 changes: 0 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,6 @@ def get_outputs(self):

keywords='C++ bindings data science calling language integration',

include_package_data=True,
package_data={'': ['installer/cppyy_monkey_patch.py']},

package_dir={'': 'python'},
packages=find_packages('python', include=add_pkg),

Expand Down
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"
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
15 changes: 13 additions & 2 deletions test/test_crossinheritance.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 setup_make, pylong, IS_MAC_ARM, IS_MAC, IS_CLANG_REPL, IS_CLANG_DEBUG
from .support import setup_make, pylong, IS_MAC_ARM, IS_MAC, IS_CLANG_REPL, IS_CLANG_DEBUG, IS_LINUX_ARM


currpath = py.path.local(__file__).dirpath()
Expand Down Expand Up @@ -36,6 +36,7 @@ def get_value(self):
assert Base1.call_get_value(Base1()) == 42
assert Base1.call_get_value(Derived()) == 13

@mark.xfail(run=False, condition=IS_LINUX_ARM, reason="Crashes pytest on Linux ARM")
def test02_constructor(self):
"""Test constructor usage for derived classes"""

Expand Down Expand Up @@ -72,6 +73,7 @@ def get_value(self):
assert d.get_value() == 29
assert Base1.call_get_value(d) == 29

@mark.xfail(run=False, condition=IS_LINUX_ARM, reason="Crashes pytest on Linux ARM")
def test03_override_function_abstract_base(self):
"""Test ability to override a simple function with an abstract base"""

Expand Down Expand Up @@ -164,6 +166,7 @@ def pass_value5(self, b):
d2 = Derived2()
assert Base1.sum_pass_value(d2) == 12+4*d2.m_int

@mark.xfail(run=False, condition=IS_LINUX_ARM, reason="Crashes pytest on Linux ARM")
def test05_override_overloads(self):
"""Test ability to override overloaded functions"""

Expand All @@ -184,6 +187,7 @@ def sum_all(self, *args):
assert d.sum_all(-7, -5) == 1
assert Base1.call_sum_all(d, -7, -5) == 1

@mark.xfail(run=False, condition=IS_LINUX_ARM, reason="Crashes pytest on Linux ARM")
def test06_const_methods(self):
"""Declared const methods should keep that qualifier"""

Expand All @@ -206,6 +210,7 @@ def __init__(self):
assert CX.IBase4.call_get_value(c1) == 17
assert CX.IBase4.call_get_value(c2) == 27

@mark.xfail(run=False, condition=IS_LINUX_ARM, reason="Fails with ModuleNotFound error")
def test07_templated_base(self):
"""Derive from a base class that is instantiated from a template"""

Expand Down Expand Up @@ -505,7 +510,8 @@ def __init__(self):
assert m.my_data == 42
assert m.get_data() == 42
assert m.get_data_v() == 42


@mark.xfail(run=False, condition=IS_LINUX_ARM, reason="Crashes pytest on Linux ARM")
def test15_object_returns(self):
"""Return of C++ objects from overridden functions"""

Expand Down Expand Up @@ -740,6 +746,7 @@ class Derived(ns.Base):
def abstract1(self):
return ns.Result(1)

@mark.xfail(run=False, condition=IS_LINUX_ARM, reason="Crashes pytest on Linux ARM")
def test20_basic_multiple_inheritance(self):
"""Basic multiple inheritance"""

Expand Down Expand Up @@ -818,6 +825,7 @@ def z(self):
assert a.m_2 == 42
assert a.m_3 == 67

@mark.xfail(run=not IS_CLANG_DEBUG, reason="Crashes with ClangRepl with 'toString not implemented'")
def test21_multiple_inheritance_with_constructors(self):
"""Multiple inheritance with constructors"""

Expand Down Expand Up @@ -905,6 +913,7 @@ def z(self):
assert a.m_2 == 88
assert a.m_3 == -11

@mark.xfail(run=not IS_CLANG_DEBUG, reason="Crashes with ClangRepl with 'toString not implemented'")
def test22_multiple_inheritance_with_defaults(self):
"""Multiple inheritance with defaults"""

Expand Down Expand Up @@ -1276,6 +1285,7 @@ class D(B):
assert inst.fun1() == val1
assert inst.fun2() == inst.fun1()

@mark.xfail(run=not IS_CLANG_DEBUG, reason="Crashes with ClangRepl with 'toString not implemented'")
def test29_cross_deep_multi(self):
"""Deep multi-inheritance hierarchy"""

Expand Down Expand Up @@ -1517,6 +1527,7 @@ def getValue(self):
gc.collect()
assert ns.Component.get_count() == 0

@mark.xfail(run=not IS_CLANG_DEBUG, reason="Crashes with ClangRepl with 'toString not implemented'")
def test32_by_value_arguments(self):
"""Override base function taking by-value arguments"""

Expand Down
5 changes: 4 additions & 1 deletion test/test_doc_features.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 setup_make, ispypy, IS_WINDOWS, IS_CLANG_REPL, IS_CLANG_DEBUG, IS_MAC, IS_MAC_X86, IS_MAC_ARM
from .support import setup_make, ispypy, IS_WINDOWS, IS_CLANG_REPL, IS_CLANG_DEBUG, IS_MAC, IS_MAC_X86, IS_MAC_ARM, IS_LINUX_ARM

currpath = py.path.local(__file__).dirpath()
test_dct = str(currpath.join("doc_helperDict"))
Expand Down Expand Up @@ -1106,6 +1106,7 @@ def test_template_instantiation(self):
assert len(v) == 10
assert [m.fData for m in v] == list(range(10))

@mark.xfail(run=False, condition=IS_LINUX_ARM, reason="Crashes pytest on Linux ARM")
def test_cross_inheritance(self):
"""Cross-inheritance example"""

Expand Down Expand Up @@ -1145,6 +1146,7 @@ def add(self, i):

assert v.back().add(17) == 4+42+2*17

@mark.xfail(run=False, condition=IS_LINUX_ARM, reason="Crashes pytest on Linux ARM")
def test_fallbacks(self):
"""Template instantation switches based on value sizes"""

Expand All @@ -1163,6 +1165,7 @@ def test_fallbacks(self):
assert CC.passT(2**64-1) == 2**64-1
assert 'unsigned long long' in CC.passT.__doc__

@mark.xfail(run=False, condition=IS_LINUX_ARM, reason="Crashes pytest on Linux ARM")
def test_callbacks(self):
"""Function callback example"""

Expand Down

0 comments on commit 5db93d9

Please sign in to comment.