json icon indicating copy to clipboard operation
json copied to clipboard

Namespace collision between PEGTL and Sequences lib

Open robinchrist opened this issue 1 year ago • 6 comments

I wanted to use the taocpp/json lib as well as the taocpp/sequences lib via conan:

self.requires("taocpp-json/1.0.0-beta.14")
self.requires("taocpp-sequences/2.0.1")

I some files, I need both (JSON and the sequences lib):

However, there seems to be a namespace collision?

In file included from /home/robin/.conan2/p/taocp84aef767d5bc6/p/include/tao/json.hpp:11:
In file included from /home/robin/.conan2/p/taocp84aef767d5bc6/p/include/tao/json/from_file.hpp:9:
In file included from /home/robin/.conan2/p/taocp84aef767d5bc6/p/include/tao/json/events/from_file.hpp:7:
In file included from /home/robin/.conan2/p/taocp84aef767d5bc6/p/include/tao/json/events/../internal/action.hpp:15:
/home/robin/.conan2/p/taocp84aef767d5bc6/p/include/tao/json/internal/grammar.hpp:45:20: error: reference to 'seq' is ambiguous
      struct exp : seq< one< 'e', 'E' >, opt< esign >, must< edigits > > {};
                   ^
/home/robin/.conan2/p/taocp173f157877af3/p/include/tao/seq/contrib/permutate.hpp:13:14: note: candidate found by name lookup is 'tao::seq'
   namespace seq
             ^
/home/robin/.conan2/p/taocp27097aa57be5d/p/include/tao/pegtl/rules.hpp:48:41: note: candidate found by name lookup is 'tao::pegtl::seq'
   template< typename... Rules > struct seq : internal::seq< Rules... > {};

Any idea how to fix this, except separating things somehow?

robinchrist avatar Dec 06 '24 13:12 robinchrist

Any updates on this? I think either one of the structs or one of the namespaces will have to be renamed

robinchrist avatar Dec 28 '24 11:12 robinchrist

I've renamed the namespace from tao::seq to tao::sequence. I guess I'm too lazy to fix the CI-jobs of this really old repository right now, maybe I'll do it in the upcoming days, but don't hold your breath ;)

d-frey avatar Dec 28 '24 13:12 d-frey

Cool, thanks a lot! If you release a new version, I‘ll prepare a Conan Index PR and perhaps take a look at the CI jobs.

I guess because it’s a breaking change, it would have to be v3.0.0 if you following semver rules?

Until the Conan Index PR is accepted, I‘ll use a local version with patches

EDIT: Nvm. You already did a v3 release. I’ll create a Conan PR later

robinchrist avatar Dec 28 '24 13:12 robinchrist

I added the Changelog entry for 3.0.0, but it is not yet released. I will create a release tag after the CI jobs are fixed.

d-frey avatar Dec 28 '24 14:12 d-frey

I guess I'm too lazy to fix the CI-jobs of this really old repository

@d-frey don't worry, I can take a look this weekend :smile:

uilianries avatar Dec 28 '24 15:12 uilianries

@d-frey Done, the CI is working without errors again. Please, check https://github.com/taocpp/json/actions?query=branch%3Amain

uilianries avatar Dec 29 '24 11:12 uilianries