Skip to content

fix(odrive_native): repair the interop gate broken by the golden's espp-lib section - #727

Merged
finger563 merged 2 commits into
mainfrom
fix/odrive-native-interop-golden
Aug 18, 2026
Merged

fix(odrive_native): repair the interop gate broken by the golden's espp-lib section#727
finger563 merged 2 commits into
mainfrom
fix/odrive-native-interop-golden

Conversation

@finger563

Copy link
Copy Markdown
Contributor

Description

#721's final interop run failed at the build step and the rerun was cancelled by the merge, so main's odrive_native interop gate is currently red. Root cause: the lib_wrapper_roundtrip section added to pc/tests/odrive_native_golden.cpp includes odrive_native.hpp (the espp::OdriveNative wrapper), but the interop harness compiles that file with only c++ -std=c++20 -I components/odrive_native/include — no espp lib on the include/link path, so base_component.hpp cannot resolve:

components/odrive_native/include/odrive_native.hpp:9:10: fatal error: base_component.hpp: No such file or directory
RESULT FAIL: build

Fix: guard the wrapper section with __has_include("base_component.hpp"). The pc-package build (full espp::espp, which links the compiled Logger the wrapper needs) still compiles and runs it; the minimal interop-harness build compiles it out and prints an explicit lib_wrapper_roundtrip skipped line instead of silently shrinking coverage.

Testing

  • The exact minimal CI compile (c++ -std=c++20 -I components/odrive_native/include) now builds and prints ALL PASSED with the wrapper section skipped.
  • The full-lib build (espp headers + logger.cpp) runs the wrapper section: ALL PASSED.
  • The complete interop harness (golden + device shim + genuine reference fibre client over the PTY loopback) passes 7/7 in an ubuntu:24.04 container — the same environment as the CI gate, which also runs on this PR via its pc/tests/odrive_native_* path trigger.

🤖 Generated with Claude Code

…pp-lib section

The lib_wrapper_roundtrip section added to pc/tests/odrive_native_golden.cpp
includes odrive_native.hpp (the espp::OdriveNative wrapper), but the interop
harness builds that file with only
  c++ -std=c++20 -I components/odrive_native/include
so base_component.hpp could not resolve and the gate failed at the build
step (and #721 was merged with the last rerun cancelled, so main's gate is
red). Guard the wrapper section with __has_include("base_component.hpp"):
the pc-package build (full espp::espp) still compiles and runs it, while
the minimal harness build compiles it out and prints an explicit skip line.

Verified: the exact minimal CI compile now builds + ALL PASSED (wrapper
skipped), the full-lib build runs the wrapper section (ALL PASSED), and the
complete interop harness passes 7/7 in an ubuntu:24.04 container.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 18, 2026 19:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Repairs the odrive_native interop gate build by conditionally compiling the espp::OdriveNative wrapper test section only when the full espp headers are available, avoiding failures in the minimal interop harness compile.

Changes:

  • Added a __has_include("base_component.hpp") preprocessor guard to gate inclusion of odrive_native.hpp.
  • Wrapped lib_wrapper_roundtrip() (and its invocation) behind the same macro and added an explicit “skipped” print in minimal builds.
  • Updated file header comments to document the two build modes and why the wrapper section is optional.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread pc/tests/odrive_native_golden.cpp Outdated
Comment thread pc/tests/odrive_native_golden.cpp Outdated
…system

Per PR review: ODRIVE_GOLDEN_HAS_ESPP_LIB is now ALWAYS defined to 0 or 1
(-Wundef-clean), the pc harness defines it to 1 explicitly (it links the
whole espp::espp archive, so headers AND the compiled Logger are guaranteed
-- closing the headers-present-but-not-linked gap), and __has_include
remains only as the fallback for bare compiles with no build-system signal.

Verified: minimal harness compile with -Werror=undef (wrapper skipped),
explicit -D...=0 with headers present (skipped, no link error), header
fallback with Logger linked (wrapper runs), and the pc harness build
against the installed package (wrapper runs). ALL PASSED in every mode.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

✅Static analysis result - no issues found! ✅

@finger563 finger563 self-assigned this Aug 18, 2026
@finger563
finger563 merged commit d3b3c0d into main Aug 18, 2026
14 checks passed
@finger563
finger563 deleted the fix/odrive-native-interop-golden branch August 18, 2026 21:07
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