Skip to content

picolibc: add check for --cfg espidf_picolibc#414

Open
drinkcat wants to merge 2 commits into
esp-rs:masterfrom
drinkcat:idf-6.0-picolibc
Open

picolibc: add check for --cfg espidf_picolibc#414
drinkcat wants to merge 2 commits into
esp-rs:masterfrom
drinkcat:idf-6.0-picolibc

Conversation

@drinkcat
Copy link
Copy Markdown
Contributor

@drinkcat drinkcat commented Apr 8, 2026

Submission Checklist 📝

  • I have updated existing examples or added new ones (if applicable). => N/A
  • I have used cargo fmt command to ensure that all changed code is formatted correctly.
  • I have used cargo clippy command to ensure that all changed code passes latest Clippy nightly lints.
  • My changes were added to the CHANGELOG.md in the proper section.

Pull Request Details 📖

Description

Makes sure that --cfg espidf_picolibc is set if picolibc is selected, and update CI.

Question: Do we want to test newlib config on esp-idf 6.0+? We could add to the CI matrix if we wanted to.

Not quite merge-able as-is, the third HACK commit will need to be removed when the next libc 0.2 is released (looks reasonably frequent so we could just wait I guess).

Testing

Local, then CI.

@drinkcat
Copy link
Copy Markdown
Contributor Author

Removed the hack. libc 0.2.185 has been released so this should be good to go.

@drinkcat drinkcat changed the title [draft] picolibc: add check for --cfg espidf_picolibc picolibc: add check for --cfg espidf_picolibc Apr 16, 2026
drinkcat and others added 2 commits April 16, 2026 12:06
…port

ESP-IDF v6.0 switched from newlib to picolibc as default C library.
Add compile-time checks that enforce the espidf_picolibc rustc cfg flag
is set (or unset) consistently with the ESP-IDF sdkconfig, and that
libc::O_APPEND matches the expected value. Update CI to pass
--cfg espidf_picolibc for v6 builds.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ivmarkov
Copy link
Copy Markdown
Collaborator

Removed the hack. libc 0.2.185 has been released so this should be good to go.

I'm not 100% sure. :-( The thing is, libc is also part of rustc itself, and in the past the libc which was part of rustc somehow stayed different / equal to whatever version is selected in the Rust STD library Cargo.toml. I.e. we also had to wait until rustc picks up the new libc version. Not sure if it is different now...

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.

2 participants