Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(bazel): add MODULE.bazel files for bzlmod #4314

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

mmorel-35
Copy link

[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/nlohmann directory, run make amalgamate to create the single-header files single_include/nlohmann/json.hpp and single_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.

@github-actions github-actions bot added the S label Mar 17, 2024
@nlohmann
Copy link
Owner

Is adding file MODULE.bazel really necessary?

@mmorel-35
Copy link
Author

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 ?

@nlohmann
Copy link
Owner

I personally do not maintain any of the package manager integrations. Hence I am reluctant to having these files in the repository.

@coveralls
Copy link

coveralls commented Mar 17, 2024

Coverage Status

coverage: 100.0%. remained the same
when pulling 94bcdb4 on mmorel-35:bzlmod
into 199dea1 on nlohmann:develop.

@mmorel-35
Copy link
Author

@Vertexwahn did the configuration in the BCR maybe he has an opinion on that.
Maybe MODULE.bazel shall even replace WORKSPACE.bazel

MODULE.bazel Outdated Show resolved Hide resolved
@Vertexwahn
Copy link
Contributor

Vertexwahn commented Mar 17, 2024

@mmorel-35 I proposed to add a MODULE.bazel file to this repo already here -> #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 ;)

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants