Skip to content

build: fail fast in deb Makefile and allow overriding the Python interpreter - #102

Closed
Willi Mann (wmann-celonis) wants to merge 1 commit into
mainfrom
fix/deb-build-fail-fast
Closed

build: fail fast in deb Makefile and allow overriding the Python interpreter#102
Willi Mann (wmann-celonis) wants to merge 1 commit into
mainfrom
fix/deb-build-fail-fast

Conversation

@wmann-celonis

Copy link
Copy Markdown
Collaborator

Problem

Running make to build the .deb packages fails with a misleading debian/changelog missing error. That is a downstream symptom, not the root cause.

The debian/changelog (and the rest of the package's debian/ tree) is generated by stdeb's sdist_dsc step. That step is what actually fails — but the recipes use .ONESHELL: without set -e, so on failure the recipe keeps going: cd deb_dist/<pkg>-* silently no-ops (the glob never matches), and dpkg-buildpackage then runs in the repo root, whose debian/ has only compat + homccd.service and no changelog. Hence the confusing error.

sdist_dsc fails for environment reasons such as:

  • the python3 that make invokes not having stdeb installed (error: invalid command 'sdist_dsc'), or
  • stdeb 0.10.0 being incompatible with Python 3.12+ (AttributeError: module 'configparser' has no attribute 'SafeConfigParser').

Fix

Makefile hardening only — surface the real failure and make the interpreter selectable:

  • .SHELLFLAGS := -ec so recipes abort at the first failing command instead of limping into the changelog error.
  • PYTHON ?= python3, used for both sdist_dsc calls, so the build can target an interpreter with a working stdeb, e.g. make PYTHON=python3.11 all.

Notes

  • This does not itself make stdeb work on Python 3.12; producing .debs still requires an interpreter ≤ 3.11 with a working stdeb (or a jammy build environment as the README assumes). The build now reports that clearly rather than masking it.
  • No behavior change to a working build.

🤖 Generated with Claude Code

…rpreter

The deb build masked its real failure: with `.ONESHELL:` and no `set -e`,
a failing `sdist_dsc` step (missing or Python-3.12-incompatible stdeb) let
the recipe continue until `dpkg-buildpackage` ran in the repo root, which
has no `debian/changelog`, producing a misleading "changelog missing" error.

- Set `.SHELLFLAGS := -ec` so recipes abort at the first failing command
- Add `PYTHON ?= python3` (used for both sdist_dsc calls) so the build can
  target an interpreter with a working stdeb, e.g. `make PYTHON=python3.11 all`

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@wmann-celonis

Copy link
Copy Markdown
Collaborator Author

No longer needed due to #104

@wmann-celonis
Willi Mann (wmann-celonis) deleted the fix/deb-build-fail-fast branch July 20, 2026 08:19
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.

1 participant