zephyr-cp: quote the Kconfig fragment list so DEBUG=1 works - #11423
Merged
Merged
Conversation
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
approved these changes
Sep 20, 2026
mikeysklar
left a comment
Collaborator
There was a problem hiding this comment.
Looks good. I reproduced the exit 126 in a toy Makefile and quoting fixes it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claude found and fixed this, reviewed by @dhalbert.
Problem
make BOARD=<board> DEBUG=1fails with exit 126 on any board that has aboard.conf, after doing a complete non-debug build. The Makefile joins the fragments asboard.conf;debug.confand passes them unquoted as-Dzephyr-cp_EXTRA_CONF_FILE=.... Make runs the recipe through/bin/sh, where an unquoted semicolon ends the command:west buildruns withboard.confonly, then the shell tries to execute.../debug.confand reports "Permission denied". cmake's log for such a run listsboard.confamong the merged fragments but notdebug.conf.Fix
Quote the value. The shell strips the quotes and cmake receives the semicolon-separated list as one argument.
menuconfiguses the same variable and is fixed by the same line.Verification
adafruit_feather_rp2040_zephyrwithDEBUG=1: build succeeds, cmake mergesdebug.conf,.confighasCONFIG_DEBUG_OPTIMIZATIONS=y. WithoutDEBUG=1nothing changes.adafruit_feather_nrf52840_zephyrwithDEBUG=1now 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.