tarides / opam-monorepo

Assemble dune workspaces to build your project and its dependencies as a whole
ISC License
130 stars 27 forks source link

Read package flags from OPAM metadata #328

Closed Leonidas-from-XIV closed 2 years ago

Leonidas-from-XIV commented 2 years ago

This changes the logic from hardcoding the compiler "base packages" to instead read the OPAM flags to check whether the package in question is a compiler in which case it will be considered a base package.

It also adds code to check for packages whether they are conf packages, which could be used to check for virtual packages.

Inspired by #327, this would allow dkml-base-compiler to be considered a base package and not accidentally vendor it. However it doesn't yet allow using the DKML compiler, because the name of the ocaml conf package is still hardcoded with no way to override it (yet).

samoht commented 2 years ago

Could you squash the is_conf change and remove the description of the conf change in the commit message?

Also, could you add a test with a non-empty flag? Thanks!

Leonidas-from-XIV commented 2 years ago

@gridbugs Can you take a look again? I've done some renaming and while thinking about it realized that even to me it was unclear what constituted a "base" package. With the compiler gone from the list it turns out that these are mostly build systems and dependencies of oasis (that aren't much used outside of it) so I explained the reasoning for them.