compile-time-regular-expressions icon indicating copy to clipboard operation
compile-time-regular-expressions copied to clipboard

Headers installed without library prefix/decoration

Open boris-kolpackov opened this issue 3 years ago • 5 comments
trafficstars

We are trying to package ctre for build2 where, in order to allow multiple libraries to co-exist, we have rules a bit stricter than "install whatever you want anywhere you want under /usr/include". Specifically, we normally require the headers either to be decorated with the library name (or be the library name) or they must be installed into a subdirectory of /usr/include decorated with the library name (or be the library name). This way we can be reasonably sure that independent libraries won't overwrite each other's headers.

Looking at ctre, I see a few problems in this area:

  1. There is the unicode-db.hpp header and the unicode-db/ subdirectory. In fact, this looks like an external library bundled with ctre (@cor3ntin, perhaps it's this one https://github.com/cor3ntin/ext-unicode-db). If that's the case, would it make sense to unbundle it or at least make it possible to unbundle (e.g., by including upstream's headers as-is)? Alternatively, if unbundling is not a good idea, would it be possible to prefix the header/directory with ctre (you would probably also want to prefix the namespace)?

  2. Similarly, there is ctll.hpp and ctll/. I suppose we can let this one slide (at least it includes half of the library name) but it makes me wonder if this could/should be a separate library (author of issue #207 seems to think so).

Could someone clarify what's going on here and if there are any plans to address these issues?

boris-kolpackov avatar Feb 07 '22 14:02 boris-kolpackov

Hi, you can easily take everything in single-header and place it with ctre/ prefix into /usr/include that's the intended usage anyway. The unicode-db was designed to be integrated with and used mostly by CTRE.

About unification of namespaces ... I would prefer ctre and ctll to be separated, I don't have an opionion about moving uni into ctre.

hanickadot avatar Feb 07 '22 14:02 hanickadot

you can easily take everything in single-header and place it with ctre/ prefix into /usr/include that's the intended usage anyway

That could work (we wouldn't even need the ctre/ prefix if we drop unicode-db.hpp -- not sure why it's exposed in single-header/). Tests would be a problem, however: some of them include individual headers rather than <ctre.hpp>.

boris-kolpackov avatar Feb 07 '22 16:02 boris-kolpackov

I will change the tests.

hanickadot avatar Feb 07 '22 16:02 hanickadot

unicode-db.hpp is there in case you already included ctre.hpp you can include only unicode-db.hpp

hanickadot avatar Feb 07 '22 16:02 hanickadot

Thanks for the offer to change the tests.

Regarding unicode-db.hpp in single-header/: if it is part of the official interface, then we still have the naming issue. Do you think it would be possible to rename it to ctre-unicode-db.hpp or some such?

boris-kolpackov avatar Feb 08 '22 13:02 boris-kolpackov