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

Revert "[cxxmodules] Enable a module if json is present." #9267

Closed
wants to merge 3 commits into from

Conversation

vgvassilev
Copy link
Member

@vgvassilev vgvassilev commented Nov 9, 2021

Reverts #9251 due to failures in LCG.

In 1c38aa0 we made it possible to use installed json versions which do not have json_fwd.h to forward declare the json classes. However in this case, that brings the entire json package in the dictionaries. In turn, then we will need to build Json.pcm to avoid content duplication. This in turn requires LCG to provide ROOT_INCLUDE_PATH=/path/to/json at runtime.

Is this all worth it?

@phsft-bot
Copy link
Collaborator

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-ubuntu16/nortcxxmod, ROOT-ubuntu2004/soversion, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

@phsft-bot
Copy link
Collaborator

Build failed on mac1014/python3.
See console output.

@phsft-bot
Copy link
Collaborator

Build failed on mac11.0/cxx17.
Running on macphsft20.dyndns.cern.ch:/Users/sftnight/build/workspace/root-pullrequests-build
See console output.

Failing tests:

@phsft-bot
Copy link
Collaborator

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-ubuntu16/nortcxxmod, ROOT-ubuntu2004/soversion, mac1015/python3, mac11.6/cxx17, windows10/cxx14
How to customize builds

@phsft-bot
Copy link
Collaborator

Build failed on ROOT-ubuntu2004/soversion.
Running on root-ubuntu-2004-1.cern.ch:/home/sftnight/build/workspace/root-pullrequests-build
See console output.

Failing tests:

@phsft-bot
Copy link
Collaborator

Build failed on mac11.6/cxx17.
Running on macphsft23.dyndns.cern.ch:/Users/sftnight/build/workspace/root-pullrequests-build
See console output.

Errors:

  • [2021-11-12T00:24:06.003Z] FAILED: graf3d/eve7/CMakeFiles/ROOTEve.dir/src/REveViewer.cxx.o
  • [2021-11-12T00:24:06.568Z] /Users/sftnight/build/workspace/root-pullrequests-build/root/graf3d/eve7/src/REveViewer.cxx:113:5: error: no viable overloaded operator[] for type 'nlohmann::json' (aka 'basic_json<>')

@Axel-Naumann
Copy link
Member

@osschar we really need to replace the JSON include in the eve header with a forward declaration, it's causing problems with modules. If that cannot be done, can we be more selective on the supported versions of nlohmann, to either still use fwd decls, or do be sure to have json_fwd.h?

@phsft-bot
Copy link
Collaborator

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-ubuntu16/nortcxxmod, ROOT-ubuntu2004/soversion, mac1015/python3, mac11.6/cxx17, windows10/cxx14
How to customize builds

@@ -18,11 +18,7 @@

#include <memory>

#ifdef NLOHMANN_JSON_PROVIDES_FWD_HPP
#include <nlohmann/json_fwd.hpp>
Copy link
Member

Choose a reason for hiding this comment

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

I believe that only #include <nlohmann/json.hpp> should be used, as nlohmann/json_fwd.hpp is not always available, and we don't have control over when it's available or not if nlohmann_json is taken from the system. Other than that, seems fine.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, maybe the build system should detect that early on and switch to builtin_json=On...

Copy link
Member

@amadio amadio Nov 12, 2021

Choose a reason for hiding this comment

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

No, for distros you cannot enable builtins, it has to be taken from the system. Same for LCG, probably, but there we can change the installation of nlohman_json.

@Axel-Naumann
Copy link
Member

Let's see what #9278 says - that's still my preferred solution, even if it'd mean that we can only support a restricted set of nlohmann_json versions. Or have multiple, version specific fwd decls.

@vgvassilev
Copy link
Member Author

Let's see what #9278 says - that's still my preferred solution, even if it'd mean that we can only support a restricted set of nlohmann_json versions. Or have multiple, version specific fwd decls.

That presumes the underlying template forward declaration is the same across versions and I am not sure how safe is that. We should just support json versions that have this header and that is it.

@Axel-Naumann
Copy link
Member

Axel-Naumann commented Nov 12, 2021

We should just support json versions that have this header and that is it.

It's not a question of versions, it's a question of packages, and some distros don't have it. And I am happy to add fwd decls for different nlohmann_json versions if needed - right now we don't know whether that's actually needed or a theoretical issue. We can also "just support json versions" that match the fwd decls ;-)

@amadio
Copy link
Member

amadio commented Nov 12, 2021

See also #8345, where the check for the header was included.

@Axel-Naumann
Copy link
Member

@amadio I am aware but I don't think this helps in any way, as we can see from the current situation. FYI that fwd decl (basic_json) changes +/- never, so a fwd declare as in #9278 seems indeed manageable.

@amadio
Copy link
Member

amadio commented Nov 12, 2021

Yes, any solution that doesn't use the json_fwd.h header should be ok.

@vgvassilev
Copy link
Member Author

I can close that now.

@vgvassilev vgvassilev closed this Nov 12, 2021
@vgvassilev vgvassilev deleted the revert-9251-json-module branch November 12, 2021 17:10
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.

5 participants