Skip to content

fix(libsodium): fix build failure with platformio (IEC-543)#752

Open
Ashish285 wants to merge 2 commits into
espressif:masterfrom
Ashish285:fix/libsodium_fix_platformio_build
Open

fix(libsodium): fix build failure with platformio (IEC-543)#752
Ashish285 wants to merge 2 commits into
espressif:masterfrom
Ashish285:fix/libsodium_fix_platformio_build

Conversation

@Ashish285
Copy link
Copy Markdown
Collaborator

Change description

When CONFIG_LIBSODIUM_USE_MBEDTLS_SHA is enabled, libsodium/CMakeLists.txt injects two -include flags (for the sha256/sha512 port shims) via a CMake SHELL: generator expression. Building this component under PlatformIO fails, its build generator does not honor the SHELL: prefix, so the option is then re-split on whitespace and CMake deduplicates one of the two -include entries, leaving the relevant header un-included at compile time.

Fix

Drop the SHELL: prefix and join -include to the header path so the whole flag is a single, indivisible token:

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a PlatformIO build failure for the libsodium ESP-IDF component when CONFIG_LIBSODIUM_USE_MBEDTLS_SHA is enabled by ensuring the two forced -include shims are passed as indivisible compile-option tokens (avoiding SHELL: handling differences across generators).

Changes:

  • Bump libsodium component version to a ~1 revision.
  • Adjust libsodium/CMakeLists.txt compile options to drop SHELL: and use joined -include<path> flags for the SHA256/SHA512 shim headers.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
libsodium/idf_component.yml Bumps component version to 1.0.22~1 to reflect the packaging/build fix.
libsodium/CMakeLists.txt Changes forced-include flags to be generator-friendly under PlatformIO by making each -include a single token.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@emlynmac
Copy link
Copy Markdown

emlynmac commented May 21, 2026

Confirmed this fixes up a regression in behaviour in 21 recorded here: rbouteiller/airplay-esp32#72

@mahavirj
Copy link
Copy Markdown
Member

@suda-morris @igrr Can you please check this once? Related: #554 (comment)

@github-actions github-actions Bot changed the title fix(libsodium): fix build failure with platformio fix(libsodium): fix build failure with platformio (IEC-543) May 23, 2026
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.

5 participants