mirror of
https://github.com/rizinorg/rz-bindgen.git
synced 2026-11-07 18:36:41 -10:00
Compare commits
15
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8618b4051a | ||
|
|
318cfbc9b3 | ||
|
|
05ce528bc2 | ||
|
|
d9b84f46e7 | ||
|
|
fe8468ea29 | ||
|
|
4e324800d8 | ||
|
|
eecc6bb442 | ||
|
|
b93006e24b | ||
|
|
f1dbe864e6 | ||
|
|
1723f6e06e | ||
|
|
c527db8fcb | ||
|
|
918136cbc2 | ||
|
|
84a9542c9e | ||
|
|
b47d3071c2 | ||
|
|
66f06da3cf |
No files matched your search
@@ -4,6 +4,11 @@ on:
|
||||
workflow_dispatch:
|
||||
workflow_call:
|
||||
inputs:
|
||||
external_call:
|
||||
description: 'To distinguish workflow_call from regular push'
|
||||
type: boolean
|
||||
required: false
|
||||
default: true
|
||||
rizin_ref:
|
||||
required: false
|
||||
type: string
|
||||
@@ -16,7 +21,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-22.04, windows-2019, macos-14]
|
||||
os: [ubuntu-24.04, windows-2019, macos-14]
|
||||
|
||||
steps:
|
||||
- name: Install SWIG with Homebrew
|
||||
@@ -26,13 +31,31 @@ jobs:
|
||||
- name: Checkout rz-bindgen
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# runned only from workflow_call
|
||||
- name: Checkout rizin
|
||||
if: ${{ inputs.external_call }}
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: rizinorg/rizin
|
||||
path: rizin
|
||||
ref: ${{ inputs.rizin_ref }}
|
||||
|
||||
- name: Checkout rizin (stable)
|
||||
if: ${{ !inputs.external_call && ((github.ref_name == 'stable') || (github.base_ref == 'stable')) }}
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: rizinorg/rizin
|
||||
path: rizin
|
||||
ref: stable
|
||||
|
||||
- name: Checkout rizin (dev)
|
||||
if: ${{ !inputs.external_call && ((github.ref_name != 'stable') && (github.base_ref != 'stable')) }}
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: rizinorg/rizin
|
||||
path: rizin
|
||||
ref: dev
|
||||
|
||||
- name: Build rz-bindgen
|
||||
uses: pypa/[email protected]
|
||||
|
||||
@@ -49,7 +72,7 @@ jobs:
|
||||
path: wheelhouse/*.whl
|
||||
|
||||
ubuntu-default-llvm:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
steps:
|
||||
- name: Checkout rz-bindgen
|
||||
@@ -57,22 +80,36 @@ jobs:
|
||||
with:
|
||||
path: rz-bindgen
|
||||
|
||||
# runned only from workflow_call
|
||||
- name: Checkout rizin
|
||||
if: ${{ inputs.external_call }}
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: rizinorg/rizin
|
||||
path: rizin
|
||||
ref: ${{ inputs.rizin_ref }}
|
||||
|
||||
- name: Checkout rizin (stable)
|
||||
if: ${{ !inputs.external_call && ((github.ref_name == 'stable') || (github.base_ref == 'stable')) }}
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: rizinorg/rizin
|
||||
path: rizin
|
||||
ref: stable
|
||||
|
||||
- name: Checkout rizin (dev)
|
||||
if: ${{ !inputs.external_call && ((github.ref_name != 'stable') && (github.base_ref != 'stable')) }}
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: rizinorg/rizin
|
||||
path: rizin
|
||||
ref: dev
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt-get --assume-yes install cmake swig pkg-config clang libclang-dev llvm wget unzip python3-wheel python3-setuptools build-essential python3-pip
|
||||
pygt311=$(python3 -c 'import sys; print(0) if sys.version_info.minor > 11 else print(1)' 2>&1)
|
||||
if [[ $pygt311 == '0' ]]; then
|
||||
sudo pip3 --break-system-packages install meson ninja
|
||||
else
|
||||
sudo pip3 install meson ninja
|
||||
fi
|
||||
sudo pip3 install meson ninja
|
||||
|
||||
- name: Install rizin
|
||||
run: |
|
||||
|
||||
@@ -2,7 +2,7 @@ name: lint
|
||||
on: push
|
||||
jobs:
|
||||
licenses:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- name: Checkout rz-bindgen
|
||||
uses: actions/checkout@v3
|
||||
@@ -10,7 +10,7 @@ jobs:
|
||||
uses: fsfe/reuse-action@v1
|
||||
|
||||
python:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- name: Checkout rz-bindgen
|
||||
uses: actions/checkout@v3
|
||||
@@ -19,7 +19,7 @@ jobs:
|
||||
pip install mypy pyflakes pylint black
|
||||
- name: Run mypy
|
||||
run: |
|
||||
mypy src/main.py
|
||||
mypy --disable-error-code misc src/main.py
|
||||
if: ${{ always() }}
|
||||
- name: Run pyflakes
|
||||
run: |
|
||||
@@ -35,7 +35,7 @@ jobs:
|
||||
if: ${{ always() }}
|
||||
|
||||
codeql:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-24.04
|
||||
permissions:
|
||||
security-events: write
|
||||
steps:
|
||||
|
||||
@@ -7,7 +7,7 @@ on:
|
||||
|
||||
jobs:
|
||||
extract-rizin-version:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-24.04
|
||||
outputs:
|
||||
rizin_version: ${{ steps.extract_version.outputs.result }}
|
||||
steps:
|
||||
@@ -21,7 +21,7 @@ jobs:
|
||||
rizin_ref: ${{ needs.extract-rizin-version.outputs.rizin_version }}
|
||||
|
||||
publish-pypi:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-24.04
|
||||
needs: [build]
|
||||
steps:
|
||||
- name: Download artifacts
|
||||
|
||||
@@ -39,6 +39,9 @@ if [[ "$OSTYPE" =~ msys* ]]; then
|
||||
meson setup --buildtype=release --prefix='c:/rizin' --vsenv build
|
||||
meson install -C build
|
||||
else
|
||||
if [[ "$OSTYPE" =~ linux* ]]; then
|
||||
export CFLAGS="-include linux/limits.h"
|
||||
fi
|
||||
meson setup --buildtype=release --libdir=lib build
|
||||
sudo meson install -C build
|
||||
fi
|
||||
|
||||
@@ -2,6 +2,13 @@
|
||||
// SPDX-License-Identifier: LGPL-3.0-only
|
||||
|
||||
#include <Python.h>
|
||||
/**
|
||||
* Some defines in rz_userconf.h are conflicting with the ones in python.h
|
||||
**/
|
||||
#undef HAVE_EXPLICIT_BZERO
|
||||
#undef HAVE_SIGACTION
|
||||
#undef HAVE_REALPATH
|
||||
|
||||
#include <rz_core.h>
|
||||
#include <rz_util/rz_file.h>
|
||||
#include <swig_runtime.h>
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ environment = { PATH="/opt/rh/llvm-toolset-7.0/root/usr/bin:/opt/rh/llvm-toolset
|
||||
archs = ["x86_64"]
|
||||
|
||||
[tool.cibuildwheel.windows]
|
||||
environment = { CMAKE_PREFIX_PATH="C:\\rizin" }
|
||||
environment = { CMAKE_PREFIX_PATH="C:/rizin" }
|
||||
archs = ["AMD64"]
|
||||
|
||||
[tool.cibuildwheel.macos]
|
||||
|
||||
@@ -327,6 +327,29 @@ def bind_core(core_h: Header) -> None:
|
||||
|
||||
Class(core_h, typedef="RzCoreFile")
|
||||
|
||||
@threaded_header("rz_util/rz_annotated_code.h")
|
||||
def bind_annotated_code(annotated_code_h: Header) -> None:
|
||||
"""
|
||||
RzAnnotatedCode
|
||||
"""
|
||||
rz_code_annotation = Class(
|
||||
annotated_code_h,
|
||||
typedef="RzCodeAnnotation",
|
||||
struct="rz_code_annotation_t",
|
||||
)
|
||||
rz_code_annotation.add_prefixed_methods("rz_annotation_")
|
||||
rz_code_annotation.add_prefixed_funcs("rz_annotation_")
|
||||
|
||||
rz_annotated_code = Class(
|
||||
annotated_code_h,
|
||||
typedef="RzAnnotatedCode",
|
||||
struct="rz_annotated_code_t",
|
||||
)
|
||||
rz_annotated_code.add_constructor("rz_annotated_code_new")
|
||||
rz_annotated_code.add_destructor("rz_annotated_code_free")
|
||||
|
||||
rz_annotated_code.add_prefixed_methods("rz_annotated_code_")
|
||||
rz_annotated_code.add_prefixed_funcs("rz_annotated_code_")
|
||||
|
||||
@threaded_header("rz_flag.h")
|
||||
def bind_flag(flag_h: Header) -> None:
|
||||
|
||||
+2
-2
@@ -2224,7 +2224,7 @@ class Type(Structure):
|
||||
|
||||
return result
|
||||
|
||||
assert self.kind == TypeKind.FUNCTIONPROTO
|
||||
assert self.kind in (TypeKind.FUNCTIONPROTO, TypeKind.FUNCTIONNOPROTO)
|
||||
return ArgumentsIterator(self)
|
||||
|
||||
@property
|
||||
@@ -2320,7 +2320,7 @@ class Type(Structure):
|
||||
|
||||
def is_function_variadic(self):
|
||||
"""Determine whether this function Type is a variadic function type."""
|
||||
assert self.kind == TypeKind.FUNCTIONPROTO
|
||||
assert self.kind in (TypeKind.FUNCTIONPROTO, TypeKind.FUNCTIONNOPROTO)
|
||||
|
||||
return conf.lib.clang_isFunctionTypeVariadic(self)
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ class TypeKind(Enum):
|
||||
POINTER: TypeKind
|
||||
CONSTANTARRAY: TypeKind
|
||||
FUNCTIONPROTO: TypeKind
|
||||
FUNCTIONNOPROTO: TypeKind
|
||||
INCOMPLETEARRAY: TypeKind
|
||||
|
||||
RECORD: TypeKind
|
||||
|
||||
@@ -123,7 +123,7 @@ def wrap_type(type_: Type) -> CType:
|
||||
cursor=type_.get_declaration(),
|
||||
)
|
||||
|
||||
if type_.kind == TypeKind.FUNCTIONPROTO:
|
||||
if type_.kind in (TypeKind.FUNCTIONPROTO, TypeKind.FUNCTIONNOPROTO):
|
||||
return CFunctionType(
|
||||
orig_type,
|
||||
result=wrap_type(type_.get_result()),
|
||||
|
||||
Reference in new issue
Block a user