Skip to content

fix(recipe): restore unconditional nlohmann_json; gate cpp_info entry… - #167

Merged
michalmaj merged 1 commit into
mainfrom
development
Jun 9, 2026
Merged

fix(recipe): restore unconditional nlohmann_json; gate cpp_info entry…#167
michalmaj merged 1 commit into
mainfrom
development

Conversation

@michalmaj

Copy link
Copy Markdown
Owner

… on with_onnx

nlohmann_json is used unconditionally by src/ml/coco_dataset.cpp so it must always be in requirements(). However Conan 2's package_info() validation behaves differently across configurations:

  • static + with_onnx: onnxruntime also depends on nlohmann_json, making it visible in the graph; Conan requires it listed in cpp_info.requires.
  • static/shared + no_onnx: visible=False keeps it quiet; adding it to cpp_info.requires causes "not a direct requirement" on shared builds.

Solution: keep nlohmann_json unconditional in requirements(), but only append "nlohmann_json::nlohmann_json" to cpp_info.requires inside the with_onnx guard.

Summary

Type of change

  • feat — new op / feature
  • fix — bug fix
  • docs — tutorial, example, or doc comment
  • bench — benchmark
  • chore — version bump, CI, build system, release

Ops / APIs added or changed

Op Namespace Header

Test plan

  • cmake --build build --parallel — no errors
  • cd build && ctest --output-on-failure — all tests pass (or pre-existing failures documented below)
  • New ops have GTest coverage in tests/
  • New examples build and run without crashing

Pre-existing test failures (if any)

None

CHANGELOG updated?

  • Yes — new entry under ## [Unreleased] (or version section for releases)
  • N/a — docs / chore only

… on with_onnx

nlohmann_json is used unconditionally by src/ml/coco_dataset.cpp so it must
always be in requirements(). However Conan 2's package_info() validation
behaves differently across configurations:

- static + with_onnx: onnxruntime also depends on nlohmann_json, making it
  visible in the graph; Conan requires it listed in cpp_info.requires.
- static/shared + no_onnx: visible=False keeps it quiet; adding it to
  cpp_info.requires causes "not a direct requirement" on shared builds.

Solution: keep nlohmann_json unconditional in requirements(), but only append
"nlohmann_json::nlohmann_json" to cpp_info.requires inside the with_onnx guard.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@michalmaj
michalmaj merged commit 3df3bdc into main Jun 9, 2026
4 checks passed
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