Skip to content

ci(ifx_package_core): pre-install imgtool signing deps for kit_pse84_ai - #24

Merged
IFX-Anusha merged 1 commit into
ifx-mainfrom
ifx-pse84-imgtool-deps
Sep 24, 2026
Merged

IFX-Anusha merged 1 commit into
ifx-mainfrom
ifx-pse84-imgtool-deps

Conversation

@IFX-Anusha

@IFX-Anusha IFX-Anusha commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

By creating this pull request you agree to the terms in CONTRIBUTING.md.
https://github.com/Infineon/.github/blob/master/CONTRIBUTING.md
--- DO NOT DELETE ANYTHING ABOVE THIS LINE ---

CONTRIBUTING.md also tells you what to expect in the PR process.

Description

Problem

kit_pse84_ai's build fails at the final imgtool-signing post-build step
with ModuleNotFoundError: No module named 'cryptography'.

History: how this was handled before the branch split

On pre-branch-split-main, this exact problem was solved with a Zephyr
source patch (0002-soc-infineon-pse84-install-imgtool-python-deps.patch,
applied via apply_zephyr_patches.sh) that added a pip-install
execute_process() block directly into hal_infineon's
pse84_metadata.cmake, so the dependencies got installed at CMake
configure time.

That patch mechanism isn't available on this branch structure by design
(patches touch Zephyr/HAL source under west-managed modules, which we
intentionally avoid modifying in-tree to keep sync/rebase simple). We
also confirmed via a debug CI run that the version of pse84_metadata.cmake
actually pinned by this branch's west.yml manifest doesn't contain any
pip-install logic at all yet — so the old patch's approach isn't currently
applicable here regardless.

This fix

Pre-install the same 5 packages (cryptography, cbor2, click,
intelhex, Pillow) as an explicit workflow step, scoped to
kit_pse84_ai only, right before the board build runs. This is
deliberately NOT a patch and NOT a change to bootstrap.sh (which would
install these unconditionally for every board, forever) — it's the
smallest, most scoped fix: one board, one workflow, no shared-file/HAL
changes, zero rebase-risk.

This is a temporary workaround, not the real fix

The correct long-term fix belongs upstream, in one of:

  • hal_infineon's pse84_metadata.cmake itself reliably installing its own
    imgtool dependencies at CMake-configure time (it already attempts this
    in newer HAL revisions, but only via message(WARNING ...) on failure,
    which lets the build proceed and fail later with a confusing error
    instead of aborting cleanly).
  • Or better: mcuboot's Python requirements (cryptography, cbor2, etc.)
    being installed as part of Zephyr's own standard workspace bootstrap
    (requirements-base.txt), the same way every other Zephyr board that
    signs images with imgtool is expected to have pip3 install imgtool
    run manually beforehand — this is literally called out as a TODO in the
    current pse84_metadata.cmake source: "Remove once mcuboot's Python
    requirements are installed as part of the standard Zephyr workspace
    setup."

Until either of those lands upstream in the HAL/Zephyr modules we
consume, this workflow-level pre-install keeps our CI green without
depending on unreliable, warning-only auto-install logic living in a
module we don't control.

hal_infineon's pse84_metadata.cmake attempts to pip-install imgtool's
Python dependencies (cryptography, cbor2, click, intelhex, Pillow) at
CMake-configure time, but only emits a message(WARNING ...) if that
fails rather than aborting the build. In our CI this silently no-ops,
and the failure resurfaces later as a confusing
ModuleNotFoundError: No module named 'cryptography' from imgtool.py
during the post-build signing step.

Pre-install the same packages explicitly in this workflow, scoped to
kit_pse84_ai only, so the existing HAL-level install attempt becomes
a harmless no-op regardless of whether/why it fails in CI.
@IFX-Anusha
IFX-Anusha force-pushed the ifx-pse84-imgtool-deps branch from f598be1 to c0ff9f7 Compare September 23, 2026 12:56
@IFX-Anusha
IFX-Anusha marked this pull request as ready for review September 23, 2026 12:57
@IFX-Anusha
IFX-Anusha merged commit 7635084 into ifx-main Sep 24, 2026
10 checks passed
@IFX-Anusha
IFX-Anusha deleted the ifx-pse84-imgtool-deps branch September 24, 2026 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants