Skip to content

💥 Depend on nlohmann_json privately - #2138

Merged
denialhaag merged 9 commits into
remove-na-stackfrom
independent-nlohmann-json
Aug 17, 2026
Merged

💥 Depend on nlohmann_json privately#2138
denialhaag merged 9 commits into
remove-na-stackfrom
independent-nlohmann-json

Conversation

@denialhaag

@denialhaag denialhaag commented Aug 17, 2026

Copy link
Copy Markdown
Member

Description

🤖 AI text below 🤖

MQT Core no longer exposes nlohmann_json as part of its public package contract. It uses the library only inside its implementation, for QDMI device discovery and superconducting device configuration, and stops installing it, exporting it, and looking for it in its package configuration.

The decision-diagram statistics drove most of the public exposure. They now report through strings and streams: json() on Statistics, MemoryManagerStatistics, TableStatistics, and UniqueTableStatistics, as well as UniqueTable::getStatsJson, getStatistics, and getDataStructureStatistics, are removed. The primitive counters, toString(), and the stream operator remain, and getStatisticsString and the new getDataStructureStatisticsString return the same report as a JSON-formatted string. Rendering moved to a header that is not installed, so the reports keep their format while no installed header includes a nlohmann header.

The remaining users link the library through $<BUILD_INTERFACE:>. Without the generator expression, a private dependency of a static library still appears as a $<LINK_ONLY:> entry in the installed interface, which would leave consumers resolving a target that MQT Core no longer provides.

This also removes the MQT_CORE_JSON_INSTALL option together with the machinery that installed the library's headers, package configuration, and natvis file.

Consumers that use nlohmann_json themselves have to depend on it directly. MQT QCEC, MQT DDSIM, and MQT QuSAT already do; MQT QMAP always did.

This pull request forms a stack with #2137 and targets that pull request's branch rather than main.

Fixes #2099

AI notice

This PR and its contents were created with the assistance of Opus 5 via Claude Code.

Checklist

  • The pull request only contains commits that are focused and relevant to this change.
  • I have added appropriate tests that cover the new/changed functionality.
  • I have updated the documentation to reflect these changes.
  • I have added entries to the changelog for any noteworthy additions, changes, fixes, or removals.
  • I have added migration instructions to the upgrade guide (if needed).
  • The changes follow the project's style guidelines and introduce no new warnings.
  • The changes are fully tested and pass the CI checks.
  • I have reviewed my own code changes.

If PR contains AI-assisted content:

  • Any agent that created, edited, or submitted GitHub content was explicitly authorized for that scope, as required by our AI Usage Guidelines.
  • Every agent-authored or agent-edited public text body begins with the visible disclosure 🤖 *AI text below* 🤖 (titles are exempt).
  • I have disclosed AI assistance in the PR description.
  • I confirm that I have personally reviewed and understood all AI-generated content, and accept full responsibility for it.

@denialhaag denialhaag self-assigned this Aug 17, 2026
@denialhaag denialhaag added dependencies Pull requests that update a dependency file refactor Anything related to code refactoring major Major version update labels Aug 17, 2026
@codecov

codecov Bot commented Aug 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.84615% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/dd/statistics/MemoryManagerStatistics.cpp 88.2% 2 Missing ⚠️
src/dd/statistics/Statistics.cpp 0.0% 1 Missing ⚠️
src/dd/statistics/TableStatistics.cpp 93.3% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@denialhaag
denialhaag requested a review from burgholzer August 17, 2026 19:08
@denialhaag
denialhaag force-pushed the independent-nlohmann-json branch 3 times, most recently from 650910e to 84834b4 Compare August 17, 2026 19:54
Assisted-by: Opus 5 via Claude Code
Assisted-by: Opus 5 via Claude Code
Assisted-by: Opus 5 via Claude Code
Assisted-by: Opus 5 via Claude Code
Assisted-by: Opus 5 via Claude Code
Assisted-by: Opus 5 via Claude Code
@denialhaag
denialhaag force-pushed the independent-nlohmann-json branch from 84834b4 to 30ff511 Compare August 17, 2026 20:04

@burgholzer burgholzer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Very clean. Just one minor suggestion 😌

Comment thread src/dd/CMakeLists.txt Outdated
Co-authored-by: Lukas Burgholzer <burgholzer@me.com>
Signed-off-by: Daniel Haag <121057143+denialhaag@users.noreply.github.com>
Comment thread src/dd/CMakeLists.txt Outdated
burgholzer and others added 2 commits August 17, 2026 22:14
Signed-off-by: Lukas Burgholzer <burgholzer@me.com>
@denialhaag
denialhaag merged commit 4304733 into main Aug 17, 2026
27 checks passed
@denialhaag
denialhaag deleted the independent-nlohmann-json branch August 17, 2026 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file major Major version update refactor Anything related to code refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

📦 Remove nlohmann_json from the public package contract

2 participants