From 533cbfee5117383584654c6290dc91c39b52b107 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Wed, 21 Oct 2026 22:57:54 +0200 Subject: [PATCH] Let generate_natvis.py cover custom ABI tag combinations (#5880) Since #5877, the checked-in nlohmann_json.natvis only covers namespaces with up to two ABI tags. The generator gets options to produce a file for other configurations: - --abi-tags TAGS adds the namespaces of one configuration (repeatable) - --all generates every combination of ABI tags - --list-tags prints the tags with the macros that enable them - --output FILE writes somewhere else than the repository root `make natvis NATVIS_ARGS="..."` passes the options through. The default output is unchanged. The options are documented in the generator's README, the debugging page, and FILES.md, and checked in CI. Signed-off-by: Niels Lohmann --- .github/workflows/check_amalgamation.yml | 22 ++++++ FILES.md | 27 +++++++ Makefile | 6 +- docs/mkdocs/docs/home/debugging.md | 22 +++++- tools/generate_natvis/README.md | 39 +++++++++- tools/generate_natvis/generate_natvis.py | 92 +++++++++++++++++++----- 6 files changed, 185 insertions(+), 23 deletions(-) diff --git a/.github/workflows/check_amalgamation.yml b/.github/workflows/check_amalgamation.yml index 551e82be0..8104a20af 100644 --- a/.github/workflows/check_amalgamation.yml +++ b/.github/workflows/check_amalgamation.yml @@ -154,6 +154,28 @@ jobs: # PR content in a job without credentials. python3 tools/generate_natvis/generate_natvis.py $MAIN_DIR + - name: Check the nlohmann_json.natvis generator options + run: | + cd $MAIN_DIR + # The options for configurations outside the checked-in file write + # to a temporary file, so they do not affect the diff below. + GENERATOR=tools/generate_natvis/generate_natvis.py + python3 $GENERATOR --list-tags + TAG_COUNT=$(python3 $GENERATOR --list-tags | wc -l) + + python3 $GENERATOR --abi-tags diag,_dp,_vns --abi-tags _diag --output $RUNNER_TEMP/abi_tags.natvis + grep -q '' $RUNNER_TEMP/abi_tags.natvis + grep -q '' $RUNNER_TEMP/abi_tags.natvis + test $(grep -c '