Skip to content

zephyr-cp: quote the Kconfig fragment list so DEBUG=1 works - #11423

Merged
dhalbert merged 1 commit into
adafruit:mainfrom
dhalbert:zephyr-quote-extra-conf
Sep 20, 2026
Merged

dhalbert merged 1 commit into
adafruit:mainfrom
dhalbert:zephyr-quote-extra-conf

Conversation

@dhalbert

Copy link
Copy Markdown
Collaborator

Claude found and fixed this, reviewed by @dhalbert.

Problem

make BOARD=<board> DEBUG=1 fails with exit 126 on any board that has a board.conf, after doing a complete non-debug build. The Makefile joins the fragments as board.conf;debug.conf and passes them unquoted as -Dzephyr-cp_EXTRA_CONF_FILE=.... Make runs the recipe through /bin/sh, where an unquoted semicolon ends the command: west build runs with board.conf only, then the shell tries to execute .../debug.conf and reports "Permission denied". cmake's log for such a run lists board.conf among the merged fragments but not debug.conf.

Fix

Quote the value. The shell strips the quotes and cmake receives the semicolon-separated list as one argument. menuconfig uses the same variable and is fixed by the same line.

Verification

  • adafruit_feather_rp2040_zephyr with DEBUG=1: build succeeds, cmake merges debug.conf, .config has CONFIG_DEBUG_OPTIMIZATIONS=y. Without DEBUG=1 nothing changes.
  • adafruit_feather_nrf52840_zephyr with DEBUG=1 now gets as far as the link and overflows flash by 123 KB, which is the board's real limit for a debug build rather than a Makefile problem.

With DEBUG=1 the Makefile passes `board.conf;debug.conf` as `-Dzephyr-cp_EXTRA_CONF_FILE`. Unquoted, the shell treats the semicolon as the end of the command, so west built without `debug.conf` and the shell then tried to run `debug.conf` and failed with "Permission denied", exit 126, after a complete non-debug build.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

@mikeysklar mikeysklar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I reproduced the exit 126 in a toy Makefile and quoting fixes it.

@dhalbert
dhalbert merged commit 8ff3f61 into adafruit:main Sep 20, 2026
47 checks passed
@dhalbert
dhalbert deleted the zephyr-quote-extra-conf branch September 20, 2026 13:04
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