@@ -161,6 +161,14 @@ if [ ! -f "$IDF_DIR/export.sh" ]; then
161161 exit 1
162162fi
163163
164+ # Use the same physical checkout prefix that ESP-IDF exports to CMake. This is
165+ # also the prefix covered by the final, more-specific deterministic path map.
166+ if ! IDF_DIR=" $( cd " $IDF_DIR " 2> /dev/null && pwd -P) " ; then
167+ echo " build.sh: cannot resolve the pinned ESP-IDF checkout" >&2
168+ exit 1
169+ fi
170+ export PYBLE_IDF_DIR=" $IDF_DIR "
171+
164172# Release provenance may say clean=true only after this check. Generated build
165173# outputs and overlay copies are ignored/submodule-untracked and do not weaken
166174# tracked source cleanliness.
@@ -255,11 +263,15 @@ export MICROPY_MPYCROSS
255263# and PyBLE USER_C_MODULES sit outside those prefixes. -ffile-prefix-map is the
256264# pinned GCC spelling that covers debug paths and macro/file expansions. GCC
257265# gives the final matching map precedence, so order broad prefixes before the
258- # more-specific target build and retained MicroPython checkout.
266+ # more-specific target build, retained MicroPython checkout, and ESP-IDF
267+ # checkout. The IDF mapping must remain last because a repo-local pinned
268+ # checkout is nested below REPO_ROOT and must keep ESP-IDF's stable /IDF
269+ # spelling rather than the broader /PYBLE spelling.
259270DETERMINISTIC_CFLAGS=" \
260271-ffile-prefix-map=$REPO_ROOT =/PYBLE \
261272-ffile-prefix-map=$OUT =/IDF_BUILD \
262- -ffile-prefix-map=$UPSTREAM_DIR =/MICROPYTHON"
273+ -ffile-prefix-map=$UPSTREAM_DIR =/MICROPYTHON \
274+ -ffile-prefix-map=$IDF_DIR =/IDF"
263275
264276make -C " $PORT " \
265277 submodules \
0 commit comments