Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
365aa3b
build: rely on pkg-config and cmake to detect dependencies and API ve…
MrIndeciso May 27, 2025
4639a08
build: try to compile a simple executable to check for libdwarf version
MrIndeciso May 27, 2025
c07fcdc
build: ensure libiberty is available and compiled as PIC
MrIndeciso May 27, 2025
a2af255
feat: use libiberty only if available
MrIndeciso May 27, 2025
0731a5e
test: check that non-demangled symbols are available too
MrIndeciso May 27, 2025
26735f6
build: add option to avoid linking libelf or libdwarf
MrIndeciso May 27, 2025
1795332
feat: add support for builds without libelf or libdwarf
MrIndeciso May 27, 2025
6679fa5
ci: add test to make sure libdebug is buildable on major distros
MrIndeciso May 27, 2025
7ff8ca1
ci: add ubuntu-latest to the distros checked
MrIndeciso May 27, 2025
815a1e2
build: install interface stubs in the proper directories
MrIndeciso May 27, 2025
4839001
fix: oops, wrong directory
MrIndeciso May 27, 2025
2f8152c
ci: add job for automatic wheel builds
MrIndeciso May 27, 2025
5ccd068
ci: specify version for cibuildwheel
MrIndeciso May 27, 2025
e0397c1
ci: install dependencies for wheel builds
MrIndeciso May 27, 2025
da37465
ci: ignore manylinux env when building static libs for wheel distrib
MrIndeciso May 27, 2025
7c0a88f
build: ensure required libdwarf deps are linked when checking for API…
MrIndeciso May 28, 2025
f7b0694
build: add partial support for static linking of libelf and libdwarf
MrIndeciso May 28, 2025
e206e93
ci: build libdwarf as PIC
MrIndeciso May 28, 2025
17817a7
ci: enter correct directory for wheel tests
MrIndeciso May 28, 2025
7c64ccc
ci: make the manylinux container privileged for test running
MrIndeciso May 28, 2025
e86d5bd
ci: add missing test dependency
MrIndeciso May 28, 2025
11b899f
ci: disable running tests when building wheels
MrIndeciso May 28, 2025
f6f59e5
ci: temporarily build only 64-bit wheels and skip musl
MrIndeciso May 29, 2025
0b315f0
ci: give each artifact an arch-dependent name
MrIndeciso May 29, 2025
c7bdf16
build: speed up dependency builds for wheel distribution
MrIndeciso May 29, 2025
922ae03
build: use stable Python ABI for versions >= 3.12
MrIndeciso May 29, 2025
aa14e15
ci: strip wheels from debug symbols
MrIndeciso May 29, 2025
b453e22
ci: add scripts for all possible manylinux distros
MrIndeciso May 30, 2025
c3a8547
ci: enable build of i686 wheels
MrIndeciso May 31, 2025
36465a6
ci: add missing source for libzstd
MrIndeciso May 31, 2025
7e7deec
ci: add test for build wheels
MrIndeciso May 31, 2025
70931f5
ci: update wheel tests
MrIndeciso Jun 1, 2025
9b524c9
ci: exclude some impossible builds from the ci
MrIndeciso Jun 1, 2025
50e491b
build: add option to disable linking with libiberty
MrIndeciso Jun 1, 2025
286fa50
ci: exclude newly added Alpine distros from comprehensive tests
MrIndeciso Jun 1, 2025
dbec29c
ci: add OpenSUSE Tumbleweed and fix Leap
MrIndeciso Jun 1, 2025
1422475
ci: extend triggers for workflows
MrIndeciso Jun 1, 2025
5b98b47
fix: add separation between binding and symbol lib
MrIndeciso Jun 1, 2025
c798577
ci: install pip only for Python >= 3.11 on OpenSUSE Tumbleweed
MrIndeciso Jun 1, 2025
617bdd5
docs: add explanation on the installation and build process
MrIndeciso Jun 1, 2025
5352941
ci: fix dependencies to known-good versions
MrIndeciso Jun 1, 2025
c0c08bf
ci: add caches for the wheel tests
MrIndeciso Jun 1, 2025
aed31ac
docs: style changes to build system documentation
Frank01001 Jun 4, 2025
e1b3226
build fix: added some missing checks qwhen pkg return empty paths
io-no Jun 8, 2025
b61044f
fix build: enforced compatibility with cmake legacy versions
io-no Jun 8, 2025
62568f7
feat: improve compatibility with musl-based systems
MrIndeciso Apr 20, 2025
2b7ed79
chore: gitignore updated
io-no Jun 8, 2025
fdbbcd2
build fix: different try_compile for version
io-no Jun 8, 2025
c3abd9f
fix build: order in newer versions
io-no Jun 8, 2025
043c51b
ci: force the action to run
io-no Jun 8, 2025
4f09fc5
fix: enable support for CPUs with no xsave feature flag
MrIndeciso Jun 4, 2025
52c11c2
fix: correct semicolons in x86_autogenerate_xsave_layout
MrIndeciso Jun 4, 2025
c41cebe
test: recompile floating_point_sse_test to not use avx instructions
MrIndeciso Jun 4, 2025
fbc80a2
fix: when you change getfpregs, you should change setfpregs too
MrIndeciso Jun 4, 2025
5fea1b2
chore: update copyright on relevant files
MrIndeciso Jun 4, 2025
6b3994c
fix: i need to sleep
MrIndeciso Jun 4, 2025
bed27a5
build: updated version number
io-no Jun 8, 2025
c8a35c2
doc: coherence with not ready whell
io-no Jun 8, 2025
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
168 changes: 168 additions & 0 deletions .github/workflows/distro_compat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
# This workflow will install libdebug on various distros and check the result

name: Distro Build Check

on:
push:
branches: [ "main", "dev", "build-patch-main" ]
workflow_dispatch:

permissions:
contents: read

jobs:
build_on_distros:
name: Build on ${{ matrix.distro_image }} (Python ${{ matrix.python-version }}, ${{ matrix.build_scenario }})
runs-on: ubuntu-latest
needs: []
timeout-minutes: 30
strategy:
fail-fast: false # Allow all distro builds to complete
matrix:
distro_image:
- 'ubuntu:20.04'
- 'ubuntu:22.04'
- 'ubuntu:24.04'
- 'ubuntu:latest'
- 'debian:bookworm'
- 'debian:sid'
- 'fedora:41'
- 'fedora:42'
- 'archlinux:latest'
- 'opensuse/tumbleweed:latest'
- 'alpine:latest'
build_scenario: ['with_deps', 'without_deps']

container:
image: ${{ matrix.distro_image }}
options: --privileged --user root # Ensure root privileges for package installation in container

steps:
- name: Install tar if needed
if: contains(matrix.distro_image, 'opensuse')
run: |
zypper --non-interactive --gpg-auto-import-keys refresh
zypper --non-interactive install -y tar gzip

- name: Install bash on Alpine Linux
if: contains(matrix.distro_image, 'alpine')
shell: sh
run: |
echo "Alpine detected. Installing bash..."
apk add --no-cache --quiet bash

- name: Checkout code
uses: actions/checkout@v4

- name: Install OS-level build tools and Optional Native Libraries
shell: bash
env:
DEBIAN_FRONTEND: noninteractive # For non-interactive apt-get
run: |
echo "Installing OS dependencies for ${{ matrix.distro_image }} with scenario: ${{ matrix.build_scenario }}"
# Common build tools. Python headers are expected to come from setup-python's Python distribution.
if command -v apt-get &> /dev/null; then
apt-get update -qq
apt-get install -y -qq --no-install-recommends g++ make python3 python3-dev python3-pip python3-venv libc6-dbg
if [[ "${{ matrix.build_scenario }}" == "with_deps" ]]; then
echo "Installing libdwarf-dev libelf-dev libiberty-dev (Debian-based)"
apt-get install -y -qq --no-install-recommends libdwarf-dev libelf-dev libiberty-dev
fi
elif command -v dnf &> /dev/null; then
dnf install -y -q g++ make python3 python3-devel
if [[ "${{ matrix.build_scenario }}" == "with_deps" ]]; then
echo "Installing elfutils-devel libdwarf-devel binutils-devel (DNF-based)"
dnf install -y -q elfutils-devel libdwarf-devel binutils-devel # binutils-devel for libiberty
fi
elif command -v yum &> /dev/null; then # For older RHEL clones (e.g. CentOS 7) - AlmaLinux 9 uses dnf
yum install -y -q gcc-c++ make python3 python3-devel
if [[ "${{ matrix.build_scenario }}" == "with_deps" ]]; then
echo "Installing elfutils-devel libdwarf-devel binutils-devel (YUM-based)"
yum install -y -q elfutils-devel libdwarf-devel binutils-devel
fi
elif command -v pacman &> /dev/null; then
pacman -Sy --noconfirm --quiet # Sync package databases
pacman -S --noconfirm --quiet --needed base-devel python3 python-pip
if [[ "${{ matrix.build_scenario }}" == "with_deps" ]]; then
echo "Installing elfutils libdwarf binutils (Arch-based)"
pacman -S --noconfirm --quiet --needed elfutils libdwarf binutils # binutils for libiberty
fi
elif command -v zypper &> /dev/null; then
zypper --non-interactive --gpg-auto-import-keys refresh
zypper --non-interactive install -y gcc-c++ make python3 python3-devel python3-pip
if [[ "${{ matrix.build_scenario }}" == "with_deps" ]]; then
echo "Installing libelf-devel libdwarf-devel binutils-devel (SUSE-based)"
zypper --non-interactive install -y libelf-devel libdwarf-devel binutils-devel # binutils-devel for libiberty
fi
elif command -v apk &> /dev/null; then
apk add --no-cache --quiet build-base python3 python3-dev py3-pip linux-headers
if [[ "${{ matrix.build_scenario }}" == "with_deps" ]]; then
echo "Installing elfutils-dev libdwarf-dev binutils-dev (Alpine-based)"
apk add --no-cache --quiet elfutils-dev libdwarf-dev binutils-dev # binutils-dev for libiberty
fi
else
echo "Unsupported distribution for automatic dependency installation: ${{ matrix.distro_image }}"
exit 1
fi

- name: Add Deadsnakes Repository
env:
DEBIAN_FRONTEND: noninteractive # For non-interactive apt-get
shell: bash
if: contains(matrix.distro_image, '20.04')
run: |
apt-get install software-properties-common -y
add-apt-repository -y ppa:deadsnakes/ppa
apt-get update
apt-get install -y python3.10 python3.10-venv python3.10-dev
rm /bin/python3
ln -s /bin/python3.10 /bin/python3 # This breaks everything but we don't care

- name: Create a Virtual Environment
shell: bash
run: |
python3 -m venv venv

- name: Install Python build tools and test dependencies
shell: bash
run: |
source venv/bin/activate
python3 -m pip install --upgrade pip wheel build
python3 -m pip install pytest pwntools requests objgraph
if [[ "${{ matrix.distro_image }}" == "opensuse/tumbleweed:latest" ]]; then
zypper --non-interactive install -y python313-curses
fi
if [[ "${{ matrix.build_scenario }}" == "without_deps" ]]; then
python3 -m pip install cmake nanobind scikit-build-core
fi

- name: Set CMake Args for Build
shell: bash
run: |
if [[ "${{ matrix.build_scenario }}" == "without_deps" ]]; then
echo "Setting CMake args to disable optional libraries"
echo "CMAKE_ARGS=-DUSE_LIBDWARF=OFF -DUSE_LIBELF=OFF" >> $GITHUB_ENV
else
echo "Building with optional libraries enabled (default CMake options)"
# Ensure CMAKE_ARGS is empty or not set if not disabling, to allow CMake defaults
# Or set specific flags if your CMake expects them for "with_deps"
echo "CMAKE_ARGS=" >> $GITHUB_ENV
fi

- name: Install library
shell: bash
run: |
source venv/bin/activate
if [[ "${{ matrix.build_scenario }}" == "without_deps" ]]; then
echo "Building library with CMAKE_ARGS: $CMAKE_ARGS"
python3 -m pip install --no-build-isolation . -v
else
python3 -m pip install . -v
fi

- name: Test with pytest
if: matrix.build_scenario == 'with_deps' && matrix.distro_image != 'alpine:latest' && matrix.distro_image != 'ubuntu:20.04'
shell: bash
run: |
source venv/bin/activate
cd test && python3 -m pytest --ignore=other_tests --ignore scripts/atexit_handler_test.py
Loading