Next Steps 2023.05.15 #4
Replies: 6 comments 20 replies
-
Thanks for summing it up @bretbrownjr ! Nicely done ! Here is the paper we wrote with Yannic for the reference: package and modules registry.pdf . @pysco68 from @tipi-build to the discussion. |
Beta Was this translation helpful? Give feedback.
-
It is essential that even in the release project model, we don't limit to only released sources, unless source here is not meant literally as "program or library source". There ought to be a way to describe a package (not yet installed) that is a mixture of pre-build and source files in the "release project model". |
Beta Was this translation helpful? Give feedback.
-
We are currently working on this at tipi, for us the compiler, linker and everything involved is a dependency and should be declared/declarable as a dependency, even cmake is a dependency that we build. Widespread example of this are Yocto Buildroot that builds everything from sources from a first bootstrapping host compiler and differentiates between build time dependencies: static library for target or host- specific tools and runtime dependencies that are supposed to be shipped with on the target for the program to run, like shared libraries. Similarly some of your dependencies might need another build system like GN from google, one would like to specify it's a dependency of the build so it can be used to build the packages you need. Another typical example is anything that requires code generators, like protocol-buffer, when you depend on gRPC as library, you also want protoc as tool for your host system to be used to generate the C++ files from the .proto, hence the package that provides .proto sources should have as dependency the protoc compiler executable, otherwise one can't build the sources from this package. Hence you need to be able to specify that this package is a dependency of yours that it is a build time dependency or a target dependency. For example when cross-compiling for arm32 I still require an host tool x86 "protoc" to be able to generate the files that will be used in the build process, but I don't want to build or ship protoc for the arm32 target. Our solution so far in {
"ninja-build/ninja" : {
"@" : "v1.11.1"
, "provides_host_tools" : { "PATH" : ["bin/"] }
, "as_target_dep" : false
}
} That means that ninja will be built for the host system when building the packages from source but won't be linked into the final dependent binary nor shipped with on the target system. |
Beta Was this translation helpful? Give feedback.
-
Thank you for the summary. I wish I was there to chat. We can chat at some other conference as to why I don't go to C++Now :)
I think we are missing the other side of interoperability with this. What you describe here only answers one question "How does one use an existing package?". Which is great if you only want to consume packages. But it doesn't answer the other side of "How does one build a package?". In other words.. How does a package manager invoke the build system of a library to generate a package that it (and others) can publish and use. Having said that though.. It is fine if having an answer for this other side is not a goal for this effort. Hence I'm wondering if supporting both routes are goals or not? |
Beta Was this translation helpful? Give feedback.
-
Lots of great comments here so far! Rather than respond in a couple subthreads at once, I'll make another top-level comment to clarify my thinking on this. MotivationTo clarify my motivation for this work, the 2023 Annual C++ Developer Survey "Lite", five of the top six most common frustrations about C++ (question 6) are directly or indirectly about dependency management:
First StepsAgain, I think initially we can start with data models (entity-component diagrams, perhaps), though I do think we'll want more coherent design documents of some sort. Relevant portions of those documents would be appropriate to present to the ISO Tooling WG for inclusion in a C++ Ecosystem Standard document. To clarify the two avenues we identified in Aspen at C++Now:
Future WorkThere are certainly other avenues to consider. In my mind, they can be tackled later, and so the priority list in my head has them categorized as important goals for future investment. For instance (still not an exhaustive list!):
How do we consistently identify a prebuilt project installed on disk?Basically we need build systems to communicate at a distance through dependency management systems. See CPS by @mwoehlke. A library built by meson or even Makefile should be possible to be consumed by CMake or bazel. A "header-only" or "module-interface-only" library should be able to clearly describe dependencies. There are plenty of reasons we have always needed this kind of metadata. For instance, a future "link what you include" tool cannot really work without some information about what dependencies are possible and what interfaces they provide. More, as I look at how modules can be correctly delivered and consumed, it's becoming clear to me that C++ modules really want a healthy packaging ecosystem to exist in. Modular interfaces need to come with structured metadata describing module mappings, parse instructions, transitive dependencies, and so on. How do we consistently identify a project in abstract?As we consider built package metadata, we quickly run into identity problems.
Note that all these use cases also exist for closed-source or otherwise prebuilt libraries. And the use cases apply across languages in the sort of polyglot codebases that C++ seems to consistently target (i.e., C, python, Fortran, and C++ all in the same shared library). So it seems like we need a way to attribute identity and ownership with a flexibility that most existing package managers tend to avoid. So some of us are coming to the conclusion is that we need at least a project name registry with some identity management and authentication features. @ruoso thinks an organization like IANA might be a good fit for governance (and hosting?) for these sorts of operations. I'm not familiar with how to engage IANA or similar organizations, but it sounds like a place to start. But without waiting on that sort of research, we can come up with a data model describing how one would identify a project and its ownership. Possibly we could also add interesting metadata to those projects like mandatory dependencies, supported environments, and so on. |
Beta Was this translation helpful? Give feedback.
-
This should include exact versions of all dependencies that were used to built a specific version of "installed" package. Something similar to conan's lockfile or npm's package-lock.json. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
At C++Now, there were some discussions about next steps for packaging standards involving the following people: @bretbrownjr, @ruoso, @daminetreg, and @billhoffman
To my recollection, the current thinking is that there are two parallel avenues of work that can be pursued as a next step, both involving clarification of data models for the purposes of packaging interoperability.
One data model is for describing releases of projects. The data included would need to be able to describe:
Thinking among the group at C++Now is that some sort of federated or federation-friendly arrangement would be interesting given the amount of closed-source and otherwise vendor-provided projects that would need to operate in this environment. It seems that clear identification of source releases will be essential to ensure that various packaging systems, monorepos, and build systems all communicate clearly.
The other data model would describe projects as installed on a system. The data included would need to be able to describe:
There seems to be a desire to also describe built packages that are not libraries, such as tools to be used in build processes. If someone wants to elaborate on use cases for those, I would appreciate it.
The metadata about installed projects would provide context to build and packaging systems in consistent ways. Ideally, this metadata would replace pkg-config metadata and hardcoded information in CMake scripts used in
find_package
workflows.Given C++ is used consistently in polyglot environments, the above systems would by polyglot systems, especially providing support for C, Fortran, C++, etc., but not necessarily limited to those. To the extent that there are compelling use cases, providing support for projects in language-specific packaging ecosystems (pypi, crates, etc.) would be ideal.
Beta Was this translation helpful? Give feedback.
All reactions