From 46cff2569be4a8932dee8c9a38bc51755d13b235 Mon Sep 17 00:00:00 2001 From: "Gabriele N. Tornetta" Date: Mon, 25 Jul 2022 09:58:36 +0100 Subject: [PATCH] declare glibc function signatures --- .github/workflows/tests.yml | 12 +----------- test/cunit/__init__.py | 4 ++++ 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4b039dd0..6b973ece 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -35,20 +35,10 @@ jobs: valgrind \ gdb - # See (https://github.com/actions/setup-python/issues/442#issuecomment-1167837162) - - name: Temprorary setup-python workaround - run: | - curl -LO http://archive.ubuntu.com/ubuntu/pool/main/libf/libffi/libffi6_3.2.1-8_amd64.deb - curl -LO http://archive.ubuntu.com/ubuntu/pool/main/libf/libffi/libffi7_3.3-4_amd64.deb - sudo dpkg -i libffi6_3.2.1-8_amd64.deb - sudo ln -sf libffi.so.6.0.4 /usr/lib/x86_64-linux-gnu/libffi.so - sudo dpkg -i libffi7_3.3-4_amd64.deb - sudo ln -sf libffi.so.7.1.0 /lib/x86_64-linux-gnu/libffi.so.7 - - name: Install Python uses: actions/setup-python@v4 with: - python-version: ${{ matrix.python-version }} + python-version: ${{ matrix.python-version }}-dev - name: Install Python 3.10 uses: actions/setup-python@v4 diff --git a/test/cunit/__init__.py b/test/cunit/__init__.py index 5ebe70a3..32aedc67 100644 --- a/test/cunit/__init__.py +++ b/test/cunit/__init__.py @@ -88,6 +88,10 @@ def compile( C = CDLL("libc.so.6") +# https://github.com/actions/setup-python/issues/442#issuecomment-1193140956 +C.malloc.restype = ctypes.c_void_p +C.free.argtypes = [ctypes.c_void_p] + class CFunctionDef: def __init__(self, name: str, args: list[str], rtype: Any) -> None: