json
json copied to clipboard
chore(bazel): add MODULE.bazel files for bzlmod
[Describe your pull request here. Please read the text below the line, and make sure you follow the checklist.]
Integrate MODULE.bazel from https://github.com/bazelbuild/bazel-central-registry/tree/main/modules/nlohmann_json Then it shall be possible to publish automatically with the new version with the help of bcr bot : https://github.com/bazelbuild/bazel-central-registry/blob/main/docs/README.md#contribute-a-bazel-module
Pull request checklist
Read the Contribution Guidelines for detailed information.
- [ ] Changes are described in the pull request, or an existing issue is referenced.
- [ ] The test suite compiles and runs without error.
- [ ] Code coverage is 100%. Test cases can be added by editing the test suite.
- [ ] The source code is amalgamated; that is, after making changes to the sources in the
include/nlohmanndirectory, runmake amalgamateto create the single-header filessingle_include/nlohmann/json.hppandsingle_include/nlohmann/json_fwd.hpp. The whole process is described here.
Please don't
- The C++11 support varies between different compilers and versions. Please note the list of supported compilers. Some compilers like GCC 4.7 (and earlier), Clang 3.3 (and earlier), or Microsoft Visual Studio 13.0 and earlier are known not to work due to missing or incomplete C++11 support. Please refrain from proposing changes that work around these compiler's limitations with
#ifdefs or other means. - Specifically, I am aware of compilation problems with Microsoft Visual Studio (there even is an issue label for this kind of bug). I understand that even in 2016, complete C++11 support isn't there yet. But please also understand that I do not want to drop features or uglify the code just to make Microsoft's sub-standard compiler happy. The past has shown that there are ways to express the functionality such that the code compiles with the most recent MSVC - unfortunately, this is not the main objective of the project.
- Please refrain from proposing changes that would break JSON conformance. If you propose a conformant extension of JSON to be supported by the library, please motivate this extension.
- Please do not open pull requests that address multiple issues.
Is adding file MODULE.bazel really necessary?
To my understanding this will at least avoid generate a patch file every time a new release is published to the BCR.
Having this file in the repository seems to be a trouble, can you explain why ?
I personally do not maintain any of the package manager integrations. Hence I am reluctant to having these files in the repository.
coverage: 100.0%. remained the same when pulling 94bcdb44afb8ee402b640d6f91891da5e105df42 on mmorel-35:bzlmod into 199dea11b17c533721b26249e2dcaee6ca1d51d3 on nlohmann:develop.
@Vertexwahn did the configuration in the BCR maybe he has an opinion on that. Maybe MODULE.bazel shall even replace WORKSPACE.bazel
@mmorel-35 I proposed to add a MODULE.bazel file to this repo already here -> https://github.com/nlohmann/json/pull/4111
I personally would suggest to add a MODULE.bazel it to this repo since this makes life with Bazel easier (no patch at BCR, usage without a BCR is easier, etc.)
In the current state of Bazel (7.x) we need a WORKSPACE/WORKSPACE.bazel (which can be empty) and a MODULE.bazel file. The empty WORKSPACE/WORKSPACE.bazel is there only for legacy reasons - in the future this file will not be needed anymore.
Currently, we are in a transition phase from Bazel 7 -> 8 (maybe end of this year) -> 9 (maybe end of next year) - i.e. it will take some time until we can remove the WORKSPACE file.
@nlohmann For me it seems that there are people around that care about the Catch2 Bazel support. You have the cost of having one additional Bazel related file vs. a community of Bazel users that can easier pick Catch2 for the development of their own projects + Avoid this discussion in the future ;) - anyways it your decision - close the PR if you do not want to have more Bazel files ;)