Skip to content

Fix support for duniverse projects#81

Merged
craigfe merged 4 commits intoocurrent:masterfrom
avsm:work-with-duniverse
Dec 9, 2019
Merged

Fix support for duniverse projects#81
craigfe merged 4 commits intoocurrent:masterfrom
avsm:work-with-duniverse

Conversation

@avsm
Copy link
Copy Markdown
Member

@avsm avsm commented Dec 4, 2019

This enables duniverse projects (such as https://github.com/ocamllabs/duniverse, and soon https://github.com/realworldocaml/book) to work with ocaml-ci with zero configuration. See the commits for an explanation of individual changes.

avsm added 4 commits December 4, 2019 15:21
Instead, look only in the root directory of the project, and also
in the `duniverse/` directory.  The former strategy is what opam
does, and the latter is a convention.

This prevents failures with projects that have example or broken
opam files (for example, dune-configurator has tests that are
pinned and broken).
The .dev version is unfortunately less than the `v0.13.0` method
used by the JS packages, and so we need to go higher.

The duniverse tool now stores the version of the dependency in
the directory name of the `duniverse/` vendor area, and so opam
picks up the original version. This also respects constraints
better than forcing everything to `.dev`.

Fixes the CI with ppx_sexp_conv and other JS libraries.
This has the convenient effect of testing the latest compiler first
in a local CI setup, which is usually what is desired.
For duniverses, the state of the opam files in the local duniverse
may not be entirely consistent, and pinning them beyond the needs
of depext is unnecessary. The user will be running `dune build`
and so the test does just this, and runs the tests and doc build.

The `opam pin` is also reverted before the main build, since it
leads to hard to track down errors. The initial depext pin will
result in an _empty_ build directory since only the opam files are
copied over in the first stage.  If an opam update is not done
subsequently to trying to opam install the dependencies, then the
package installations fail. Opam seems to not always do an rsync
update upon install, so I ran into this several times.

The new strategy should leave normal opam projects unaffected,
beyond just unpinning and pinning one extra time for the root
package.
Copy link
Copy Markdown
Member

@craigfe craigfe left a comment

Choose a reason for hiding this comment

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

LGTM. I want to set up test scaffolding for the analysis phase so that we can ensure the correct things are being done in all cases. This will do for now 🙂

@craigfe craigfe merged commit 1207c84 into ocurrent:master Dec 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants