onigurumacffi installation error while trying to create a custom decision environment

I’m getting an installation dependency error when trying to create my own custom decision environment using the Redhat DE Supported RHEL9 image. My goal was to add my custom collection that was uploaded into private automation hub into the decision environment to be able to use and test my custom event filter.

My Podman version is 5.2.5.
Ansible core version is 2.16.14.
ansible-builder version is 3.1.0.
AAP version is 2.6.

I’m getting an error trying to install the onigurumacffi package.

Building wheels for collected packages: onigurumacffi, systemd-python
  Building wheel for onigurumacffi (pyproject.toml): started
  Building wheel for onigurumacffi (pyproject.toml): finished with status 'error'
  error: subprocess-exited-with-error
  
  × Building wheel for onigurumacffi (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [29 lines of output]
      /tmp/pip-build-env-29j43a47/overlay/lib/python3.11/site-packages/setuptools/dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated.
      !!
      
              ********************************************************************************
              Please consider removing the following classifiers in favor of a SPDX license expression:
      
              License :: OSI Approved :: MIT License
      
              See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
              ********************************************************************************
      
      !!
        self._finalize_license_expression()
      running bdist_wheel
      running build
      running build_py
      creating build/lib.linux-aarch64-cpython-311
      copying onigurumacffi.py -> build/lib.linux-aarch64-cpython-311
      running build_ext
      generating cffi module 'build/temp.linux-aarch64-cpython-311/_onigurumacffi.c'
      creating build/temp.linux-aarch64-cpython-311
      building '_onigurumacffi' extension
      creating build/temp.linux-aarch64-cpython-311/build/temp.linux-aarch64-cpython-311
      gcc -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -fasynchronous-unwind-tables -fstack-clash-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -fasynchronous-unwind-tables -fstack-clash-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -fasynchronous-unwind-tables -fstack-clash-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python3.11 -c build/temp.linux-aarch64-cpython-311/_onigurumacffi.c -o build/temp.linux-aarch64-cpython-311/build/temp.linux-aarch64-cpython-311/_onigurumacffi.o
      build/temp.linux-aarch64-cpython-311/_onigurumacffi.c:573:10: fatal error: oniguruma.h: No such file or directory
        573 | #include <oniguruma.h>
            |          ^~~~~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for onigurumacffi
  Building wheel for systemd-python (pyproject.toml): started
  Building wheel for systemd-python (pyproject.toml): finished with status 'done'
  Created wheel for systemd-python: filename=systemd_python-235-cp311-cp311-linux_aarch64.whl size=160544 sha256=0f3cb36014d01c0cd2feff03f3a44201d2dfb90f03001e479e11295db468e4b9
  Stored in directory: /output/wheels/wheels/13/77/24/4266dc1d98e2672f5575d49b15070d5a6274e2e977fbf50146
Successfully built systemd-python
Failed to build onigurumacffi
error: failed-wheel-build-for-install

× Failed to build installable wheels for some pyproject.toml based projects
╰─> onigurumacffi
Error: building at STEP "RUN /output/scripts/assemble": while running runtime: exit status 1

This is my execution-environment.yml file.

version: 3

images:
  base_image:
    name: 'registry.redhat.io/ansible-automation-platform-26/de-supported-rhel9:latest'

build_arg_defaults:
  ANSIBLE_GALAXY_CLI_COLLECTION_OPTS: '--ignore-certs --pre'

additional_build_steps:
  prepend_base:
    - ENV PIP_USE_PEP517=1
    - RUN $PYCMD -m pip install wheel
    - RUN $PYCMD -m pip install --upgrade pip
    - COPY _build/configs/ansible.cfg /etc/ansible/ansible.cfg
  prepend_galaxy:
    - COPY _build/configs/ansible.cfg /etc/ansible/ansible.cfg

dependencies:
  system:
    - gcc [platform:rpm]
    - systemd-devel [platform:rpm]
    - python3.11-devel [platform:rpm]
    - libonig-dev [test platform:rpm]
  galaxy: requirements.yml
  python_interpreter:
    package_system: "python3.11"
    python_path: /usr/bin/python3.11
  ansible_core:
    package_pip: ansible-core>=2.15
  ansible_runner:
    package_pip: ansible-runner
additional_build_files:
  - src: ansible.cfg
    dest: configs

options:
  package_manager_path: /usr/bin/microdnf
  user: root
  workdir: /home/runner

I added libonig-dev as a dependency for the system because after searching around per this Github issue.

I’ve tried it as a dependency under system with libonig-dev [platform:rpm], libonig-dev [platform:debian], and adding onigurumacffi under the python dependency section and it was the same error.

Any help would be greatly appreciated!