Skip to content

fix(ci): unbreak alpha CI baseline (format + TOKENS_COUNT + const)#216

Merged
BitHighlander merged 3 commits into
alphafrom
fix/alpha-ci-baseline
Apr 25, 2026
Merged

fix(ci): unbreak alpha CI baseline (format + TOKENS_COUNT + const)#216
BitHighlander merged 3 commits into
alphafrom
fix/alpha-ci-baseline

Conversation

@BitHighlander

Copy link
Copy Markdown
Owner

Summary

Alpha's CI is currently red on every PR — same set of failures across #213, #215, and alpha's own last push (commit `92c8f534`). Three independent pre-existing breakages, all small:

1. `lint-format` — clang-format violations on libkkemu headers

`include/keepkey/emulator/{setup.h,libkkemu.h}` were merged without the formatter being applied. Just ran `clang-format -i` — pure whitespace + macro alignment + pointer-style fixes.

2. `build-arm-firmware-btc-only` — `TOKENS_COUNT` redefined

`coins.h:51` pre-defines `TOKENS_COUNT=0` in `BITCOIN_ONLY` builds (the comment there claims `ethereum_tokens.h` isn't included), but `ethereum.c` actually does include `ethereum_tokens.h`, which then redefines the macro and `-Werror` kills the build.

Surgical fix: guard `ethereum_tokens.h`'s define with `#ifndef TOKENS_COUNT` so `coins.h`'s BTC-only fallback wins when both are pulled in.

3. `static-analysis` — `Canvas *` could be `const Canvas *`

cppcheck flagged `lib/emulator/libkkemu.c:167`: `c` is only used to read `c->buffer`, so declare it const.

Why this matters

Until alpha is green, every PR shows red CI from these unrelated failures, hiding actual regressions. PRs #213 (metadata-keys) and #215 (macOS emu artifact) both block on this same set.

Test plan

Three pre-existing breakages on alpha that block every PR's CI:

1. lint-format failed on include/keepkey/emulator/{setup.h,libkkemu.h}
   — newly-merged libkkemu support landed without clang-format applied.
   Run: clang-format -i ...

2. build-arm-firmware-btc-only failed with TOKENS_COUNT redefined.
   coins.h:51 defines TOKENS_COUNT=0 in BITCOIN_ONLY builds (because
   the comment claims ethereum_tokens.h isn't included), but ethereum.c
   actually does include ethereum_tokens.h, which redefines it.
   Guard ethereum_tokens.h's #define with #ifndef so coins.h's BTC-only
   fallback wins when both are included.

3. static-analysis (cppcheck) failed on lib/emulator/libkkemu.c:167
   — Canvas *c is read-only, declare as const Canvas *.
ethereum_tokens.h IS included in BTC-only builds (transitively via
ethereum.c and ethereum_tokens.c), so the override in coins.h that
forces TOKENS_COUNT=0 collides with the real definition.

Single source of truth: ethereum_tokens.h owns TOKENS_COUNT.
Reverts the #ifndef guard from the previous commit since coins.h no
longer fights it.
@BitHighlander
BitHighlander merged commit 984c60c into alpha Apr 25, 2026
11 checks passed
@BitHighlander
BitHighlander deleted the fix/alpha-ci-baseline branch April 25, 2026 03:29
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