ocaml / oloop

Evaluate code through the OCaml toploop for inclusion in educational material.
ISC License
12 stars 5 forks source link

handle .install file correctly #35

Closed agarwal closed 9 years ago

agarwal commented 9 years ago

In our opam file, I've now added "cp" "opam/files/oloop.install" "./" to the install step. But is it necessary, or does the command "ocaml" "setup.ml" "-install" already do that anyway? Or is there some other better solution?

More generally, we used oasis2opam to generate the opam/ directory, but then modified it manually. That seems wrong. If the opam/ directory is auto-generated, maybe we shouldn't include it in the repo. But that wouldn't allow us to do an opam pin, so that also seems wrong. Should we just document that the opam/ directory is auto-generated and should not be manually modified? Is that correct?

Chris00 commented 9 years ago

See https://github.com/ocaml/opam-repository/pull/4343 or the discussion.

Chris00 commented 9 years ago

I do not remember whether "ocaml" "setup.ml" "-install" install the binaries (it may well) but "ocamlfind" "remove" will not remove them (oasis could but it would need the data of the previous compilation). This is why oasis2opam genrates this .install file.

Note that since https://github.com/ocaml/oasis2opam/commit/99bee4f8e0d52d1e5091991bea623fc64c36d937 oasis2opam generates the install file at the root of the directory.

Chris00 commented 9 years ago

More generally, we used oasis2opam to generate the opam/ directory, but then modified it manually. That seems wrong.

This is no longer required with the latest oasis2opam.

Chris00 commented 9 years ago

But that wouldn't allow us to do an opam pin, so that also seems wrong.

Indeed. If you want to be able to "Git pin", then this is needed.

Should we just document that the opam/ directory is auto-generated and should not be manually modified? Is that correct?

Maybe it is enough to add a make target that updates OPAM metadata when _oasis changes?

agarwal commented 9 years ago

Maybe it is enough to add a make target that updates OPAM metadata when _oasis changes?

That sounds right. When auto-generated files do need to be checked in for some reason, I usually do: