Skip to content

interpreters/berry: Fix Wshadow build errors#3578

Merged
acassis merged 1 commit into
apache:masterfrom
speccy88:codex/fix-berry-wshadow
Jul 2, 2026
Merged

interpreters/berry: Fix Wshadow build errors#3578
acassis merged 1 commit into
apache:masterfrom
speccy88:codex/fix-berry-wshadow

Conversation

@speccy88

@speccy88 speccy88 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

This fixes the current sim:berry Linux CI failure seen from apache/nuttx#19224 after the CRLF patch fix was merged.

The pinned Berry source compiles with two -Wshadow diagnostics in:

  • src/be_introspectlib.c
  • src/be_module.c

NuttX CI builds sim:berry with -Werror, so those diagnostics fail the build. I added a second local Berry patch that only renames the shadowing local variables, without changing behavior, and apply it in both the Make and CMake fetch paths.

Verification

I verified the patch applies cleanly to the exact pinned Berry ZIP payload after the existing NuttX patch.

I also ran the targeted failing config in the Apache Linux CI container against apache/nuttx#19224 head plus this apps commit:

./tools/testbuild.sh -l -C -x -j $(nproc) -a ../apps \
  -t /github/workspace/sources/nuttx \
  -e '-Wno-cpp -Werror' -S /github/workspace/sim-berry-make.dat

Result: sim:berry Make build passed.

I also tested the CMake/Ninja path:

./tools/testbuild.sh -l -C -x -N -j $(nproc) -a ../apps \
  -t /github/workspace/sources/nuttx \
  -e '-Wno-cpp -Werror' -S /github/workspace/sim-berry-cmake.dat

Result: sim:berry CMake/Ninja build passed.

Local checks:

git diff --check origin/master..HEAD
/tmp/nuttx-pr19224/tools/checkpatch.sh -c -u -m -g origin/master..HEAD

Comment thread interpreters/berry/CMakeLists.txt Outdated
The pinned Berry source emits -Wshadow diagnostics in a couple of files. NuttX CI passes -Werror, so sim:berry fails when those third-party warnings are promoted to errors.\n\nAdd -Wno-shadow to Berry-specific compiler flags in both Make and CMake paths, keeping the local source patch limited to the NuttX port changes.

Signed-off-by: Frederick Blais <fred_blais5@hotmail.com>
@speccy88 speccy88 force-pushed the codex/fix-berry-wshadow branch from 0409fca to 7fcaebf Compare July 1, 2026 15:21
@speccy88

speccy88 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

Updated to use -Wno-shadow instead of carrying a second source patch.

I kept the flag scoped to the Berry build only:

  • Make: CFLAGS += -Wno-shadow
  • CMake: BERRY_FLAGS now includes -Wno-shadow

I reran the targeted failing config in the Apache Linux CI container against the NuttX PR head plus this apps commit:

./tools/testbuild.sh -l -C -x -j $(nproc) -a ../apps \
  -t /github/workspace/sources/nuttx \
  -e '-Wno-cpp -Werror' -S /github/workspace/sim-berry-make.dat

./tools/testbuild.sh -l -C -x -N -j $(nproc) -a ../apps \
  -t /github/workspace/sources/nuttx \
  -e '-Wno-cpp -Werror' -S /github/workspace/sim-berry-cmake.dat

Both Make and CMake/Ninja sim:berry builds passed.

@github-actions github-actions Bot added Size: XS and removed Size: S labels Jul 1, 2026
@cederom

cederom commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

CI Linux Arm14 failed, restarted, let make sure it pass this time :-)

@acassis acassis merged commit e61f465 into apache:master Jul 2, 2026
75 of 79 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants