tarides / opam-monorepo

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

Allow adding the overlays when overlay is not added #273

Open Leonidas-from-XIV opened 2 years ago

Leonidas-from-XIV commented 2 years ago

Currently we only display a warning to let the user know that the overlays are not included and it might lead to packages not installable because of missing dune ports. @samoht suggested that we make opam-monorepo add the overlay opam repo. It sounds like a reasonable idea (provided we ask the user for permission first), the opam libraries might allow doing this directly.

NathanReb commented 2 years ago

I think it would be best not to temper with the user opam configuration. This is the reason why we didn't do this in the first place.

Using the repo list based solver instead for this would likely be better!

Leonidas-from-XIV commented 2 years ago

I think if we make it opt-in it could be fine, but you're right - using repos explicitly instead of dealing with the opam configuration is better in many ways.

NathanReb commented 2 years ago

One of the reason I'm suggesting this is because I think it requires about the same amount of work.

Setting the repo in the config via the opam libraries is likely a bit involved and requires write access to the opam state so opens up for serious issues.

If we realize it's a lot of work to do this using the new solver, I'm happy to have a temporary workaround using the opam switch config!

TheLortex commented 2 years ago

Adding the overlay repository in a stateless fashion (without modifying the opam switch) would be very useful for mirage! Currently what we do is that the Makefile lock operation temporarily add dune-duniverse opam overlay to the switch's repositories. So I believe what's missing to use the repo list based solved is to support URL remotes.

tmattio commented 1 year ago

Related to https://github.com/tarides/opam-monorepo/issues/315, we can implement this easily in the explicit_repos_solver.

@TheLortex note that if Mirage was using the explicit_repos_solver, you wouldn't have to remove the opam-overlays after locking, you could specify the list of repo in the command line for instance.