-
Notifications
You must be signed in to change notification settings - Fork 8
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
Case Study: absl_time_zone #36
Comments
Here's my thoughts (because LLVM is such a pain, and always on my mind): I think it makes sense to encourage one CPS file per conceptual project (it's possible a single repo contains multiple conceptual projects, like libLLVM and clang, which live in the same repo but are conceptually different projects, even if clang requires LLVM), and then use components for representing, well, components. So absl would have a single CPS file, which might (with redactions look like): {
"components": {
"time": {"requires": [":time_zone"]},
"time_zone": {}
}
} This makes sense in that it prevents odd situations where components from one version of a library accidentally get mixed with another one; it should also speed up load time since an implementation does less I/O. It also would allow exploiting private components (which I like more and more) to hide implementation details which having separate CPS files would not |
I don't know that it's our place to make such a blanket recommendation. Rather, what is the project trying to accomplish? Qt, for example, enforces that you can't mix and match components (e.g. core, gui, widgets, xmlpatterns, webengine). A project like that should ship as a single CPS "project". I suspect llvm/clang should, or at least could, ship as multiple projects. More generally, the "rule" is that the project is a tool for ensuring that a set of components all comes from the same build. It's even possible for multiple repos to ship as a single CPS project (one has to be "primary"). Another rule is that if users expect to consume A without also consuming B (again, e.g. llvm without clang), then you should ship as separate projects.
Exactly; that is a major purpose, if not the purpose, of projects. |
Let's keep in mind the implications for build systems going forward. If we expect This fits naturally for some things like CMake, Meson, and bazel (maybe substituting [1] Maybe the delimiter for |
Note: the name according to CPS is In other words, the canonical name isn't a string that contains one or more |
Meson has as syntax for handling these kind of dependencies, qt for example: dependency('qt', version : ['>=6', '<7'], modules : ['core', 'widgets']) Which the meson implementation would transform into As such I frankly don't care what the divider is :)
pkg-config naming is such a mess because there are no recommendations and various projects have different solutions:
|
This probably deserves a separate discussion. On Linux at least it is common for the debug info to be split out of the package provided by the distro. |
Configurations are... complicated, and right now CPS isn't trying to say what they look like, just that they're a thing that can exist. In practice, you're more likely to encounter
There is not currently support. I'd suggested that #29 should metamorphose into said issue. |
Completion Criteria
Documentation about how to practically convert existing CMake and/or pkg-config projects to CPS should be started. It can be iterated on as we gain experience, but sharing lessons learned in discoverable ways is important to new adopters and contributors.
Background
Structure
It seems like
absl_time_zone
is an implementation library that installs headers but expects only otherabsl
libraries to make use of them,absl_time
especially. It needs to provide build systems information for discovering headers and libraries to link, of course, but end-users shouldn't be directly referencing this library, so it's an example of a "private" library.CMake Metadata
On my Linux machine,
find_package(absl)
in CMake imports dozens and dozens ofIMPORTED
library targets withabsl::
namespace scopes.For instance,
absl::time_zone
has aRelWithDebInfo
IMPORTED
SHARED
library located at${_IMPORT_PREFIX}/lib/libabsl_time_zone.so.2308.0.0
.pkg-config
metadataThe relevant
pkg-config
metadata in/usr/lib/pkgconfig/absl_time_zone.pc
is as follows:Questions
Do we recommend
absl_time_zone.cps
or do we recommend an omnibusabsl.cps
that includes models for each library shipped by theabsl
project?Should CPS files adopt
RelWithDebInfo
as an explicit default or should it be unqualified like thepkg-config
metadata?Is there currently support for "private" libraries like this? If not, should we add a tracking issue?
The text was updated successfully, but these errors were encountered: