Skip to content
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

RFC: Manage duniverse manual #271

Merged

Conversation

Leonidas-from-XIV
Copy link
Member

We discussed what the preferable way was but haven't written it down in an comprehensive way so that users understand the Pros and Cons of each solution.

This PR adds a new page to the manual to discuss what we think is the best way to run opam-monorepo and how to deal with the caveats.

Suggestions welcome!

doc/manage-duniverse.mld Outdated Show resolved Hide resolved
doc/manage-duniverse.mld Outdated Show resolved Hide resolved
doc/manage-duniverse.mld Outdated Show resolved Hide resolved
doc/manage-duniverse.mld Outdated Show resolved Hide resolved
Comment on lines 98 to 100
For ease of collaboration and to keep the repositories manageable
[opam-monorepo] maintainers recommend against this approach and suggest the
approach in {!label-lockfile-in-git} instead.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not agree: there are valid use-cases for committing vendor code to the repositories, let's not try to dictate their requirements to our users. Would be much better to just reckon this, and point to possible issues and fixes (as the next paragraph does well).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, irrespective of the recommendations of the opam-monorepo maintainers, I am going to continue checking in my code into duniverse/ :-) The reason for this is that the benefit of this approach is somewhat understated and hidden away:

The repository can be immediately used after cloning as everything is self-contained

The above is an absolutely massive benefit for newcomers to a project:

  • it doesn't require opam to be installed, and, more crucially, doesn't require a working opam init to have happened.
  • only dune is required for a build, and (since dune 2.0) the dune binary can be distributed independently of the dune libraries (which are vendored). Thus a newcomer can apt install ocaml-dune and get on with things.
  • it doesn't require opam-monorepo to remain working into the future. I can git checkout an older revision of RWO and have a reasonable expectation that it'll build, for example.

This guide is an excellent start, but it is organised around "operational" uses of monorepo. But a reader of the document unfamiliar with opam-monorepo is going to start from a different mindset: they are going to wonder how best to serve various users of their projects and achieve outcomes such as "distribute this binary for people that don't know ocaml", to "make first contribution to the core tool", to "experienced user wants to patch a library and upstream the change".

If you organise things by "how deeply someone wants to get into the project", then the ordering of how you introduce vendoring, lockfiles and on-the-fly locking changes.

doc/manage-duniverse.mld Outdated Show resolved Hide resolved
doc/manage-duniverse.mld Outdated Show resolved Hide resolved
doc/manage-duniverse.mld Outdated Show resolved Hide resolved
doc/manage-duniverse.mld Outdated Show resolved Hide resolved
Copy link
Contributor

@NathanReb NathanReb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good! Overall I think it can be simplified a little a bit, some sections are very similar between the two main workflows and can likely be merged.

doc/manage-duniverse.mld Outdated Show resolved Hide resolved
doc/manage-duniverse.mld Outdated Show resolved Hide resolved

{ul
{- The project repository only grows by one file, thus easy to adopt}
{- The packages to be installed are reproducible between different machines
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This items and the next one are advantages tied to the use of opam-monorepo itself and are common to the two described workflows.

We can probably remove them from here, eventually moving them elsewhere in the manual.

doc/manage-duniverse.mld Show resolved Hide resolved
doc/manage-duniverse.mld Outdated Show resolved Hide resolved
doc/manage-duniverse.mld Outdated Show resolved Hide resolved
@NathanReb
Copy link
Contributor

At the moment I would advise that users modify the content of the duniverse to experiment quickly and once they're happy with the result, extract a patch, either to upstream the changes or to a fork of theirs.
At that point they can use pin-depends fields to let opam-monorepo know to use this instead of upstream. It makes it easier to deal with updates.

We will need to better support this in the future of course but it might be worth suggesting this workflow here as well.

It also closes the gap between the two proposed approaches as you don't necessarily have to version the duniverse/ to achieve this.

@Leonidas-from-XIV Leonidas-from-XIV added the no changelog Add this label to PRs without user facing changes to disable CI changelog checks label Mar 30, 2022
@Leonidas-from-XIV Leonidas-from-XIV merged commit 64c48f0 into tarides:main Jan 11, 2023
@Leonidas-from-XIV Leonidas-from-XIV deleted the manage-duniverse-manual branch January 11, 2023 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog Add this label to PRs without user facing changes to disable CI changelog checks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants