json icon indicating copy to clipboard operation
json copied to clipboard

MSVC: make #4526 pass (use #if for optional) - fixes #3859; re-amalgamate

Open chelseadzdr opened this issue 2 months ago • 7 comments

Changes made

  • pulled pr #4526 and amalgamated
  • merged into develop and fixed conflicts, kept most recent version of from_json.hpp (removed extra JSON_USE_IMPLICIT_CONVERSIONS that broke C++11 builds).
  • Regenerated single-header files via the amalgamation target.

Existing issue is referenced:

  • https://github.com/nlohmann/json/issues/3859

How I tested

  • Windows: VS 2019, x64 toolset, CMake
    • -DJSON_BuildTests=ON
    • Built and ran tests (Debug/Release).

Amalgamation

  • The source code is amalgamated by running py -3 tools\amalgamate\amalgamate.py.

chelseadzdr avatar Oct 27 '25 22:10 chelseadzdr

I don't understand what's happening with this PR. It is not showing the change in the original file, but it is showing it in the amalgamated file, and there's no complaint about that from the checks. Also strange, there are only 5 checks.

gregmarr avatar Oct 28 '25 01:10 gregmarr

@gregmarr i think most workflows are awaiting approval because it is my first contribution, and the changes in the source files has been made in previous commits, the latest commits just amalgamated the headers, that's why at first it may look like only the amalgamated files are modified

chelseadzdr avatar Oct 28 '25 03:10 chelseadzdr

🔴 Amalgamation check failed! 🔴

The source code has not been amalgamated. @chelseadzdr Please read and follow the Contribution Guidelines.

github-actions[bot] avatar Oct 28 '25 05:10 github-actions[bot]

Coverage Status

coverage: 99.191%. remained the same when pulling 4c55fcb54ab60a7366c682ea417007d29f3b63b5 on chelseadzdr:fix-msvc-optional into 4f8ee1d5e0117ab8d3c805655649386f323f868f on nlohmann:develop.

coveralls avatar Oct 28 '25 06:10 coveralls

This pull request has been marked as stale because it has had no activity for 30 days. While we won’t close it automatically, we encourage you to update or comment if it is still relevant. Keeping pull requests active and up-to-date helps us review and merge changes more efficiently. Thank you for your contributions!

github-actions[bot] avatar Nov 28 '25 00:11 github-actions[bot]

There are whitespace changes in the amalgamated header, but no changes in any of the other headers, so the base commit was not properly amalgamated (unlikely) or there's a problem with your setup. The change in from_json in the original PR is no longer needed because the #ifdef in question was removed as incorrect.

As for the test, it looks like some of the tests require checking JSON_USE_IMPLICIT_CONVERSIONS and some don't.

gregmarr avatar Dec 01 '25 14:12 gregmarr

I think you might need to start over with a single fresh commit that just fixes the test, due to the DCO checks, and the older commits that aren't signed off.

gregmarr avatar Dec 01 '25 15:12 gregmarr