Skip to content

Fix: Local Zephyr snippets not detected without SNIPPET_ROOT#255

Open
MassimilianoPavesio wants to merge 1 commit intoraspberrypi:mainfrom
MassimilianoPavesio:zephyr-project-fix
Open

Fix: Local Zephyr snippets not detected without SNIPPET_ROOT#255
MassimilianoPavesio wants to merge 1 commit intoraspberrypi:mainfrom
MassimilianoPavesio:zephyr-project-fix

Conversation

@MassimilianoPavesio
Copy link

Description

This PR fixes an issue where local Zephyr snippets inside:

<workspace>/snippets/

were not detected during build.

When selecting USB console, the extension added:

-S usb_serial_port

but did not set SNIPPET_ROOT.

As a result, Zephyr only searched in the zephyr repository:

Snippet roots for application: <zephyr-main>

and failed with:

snippets: error: snippets not found: usb_serial_port

Fix

Add:

-DSNIPPET_ROOT=${workspaceFolder}

when pushing the USB snippet argument:

if (data.console === "USB") { westArgs.push("-S", "usb_serial_port"); westArgs.push("-DSNIPPET_ROOT=${workspaceFolder}"); }

This ensures local snippets are correctly discovered.

Tested On

  • Windows
  • rpi_pico2/rp2350a/m33
  • Local snippet in /snippets/usb_serial_port

Build succeeds after fix.

Local Zephyr snippets inside <workspace>/snippets were not detected
during build because SNIPPET_ROOT was not explicitly set.

When using:

    west build -S usb_serial_port

Zephyr only searched inside the Zephyr repository and failed with:

    snippets: error: snippets not found: usb_serial_port

Add:

    -DSNIPPET_ROOT=${workspaceFolder}

when enabling the USB console snippet so local snippets are
correctly discovered by the build system.
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