This is the mail archive of the
mailing list for the Cygwin project.
how to use opam for package builds?
- From: Andrew Schulman <schulman dot andrew at epa dot gov>
- To: cygwin-apps at cygwin dot com
- Date: Wed, 29 Aug 2018 11:47:02 -0400
- Subject: how to use opam for package builds?
orpie recently changed to an opam-based build system. So I want to use opam
to update it for Cygwin, but I've never used opam before and I have some
questions about how to use it.
The orpie build instructions say just to run "opam install orpie". When I
do that, opam complains that I haven't set it up yet:
$ opam install orpie
[ERROR] No OPAM root found at /home/andrew/.opam.
Please run 'opam init' to initialize the state of OPAM, or
See 'opam init --help' for details.
Now for packaging, what's the right thing to do here? For example I could
create the following install function for Cygport:
opam install orpie
But this has two problems:
(1) I can't get "opam init" to complete. It hangs after "synchronized from
https://opam.ocaml.org", until I interrupt it:
$ opam init
Checking for available remotes: rsync and local, git, mercurial.
- you won't be able to use darcs repositories unless you install the
darcs command on your system.
[WARNING] Recommended external solver aspcud not found.
=-=- Fetching repository information
[default] synchronized from https://opam.ocaml.org
### hangs here until I hit ctrl-C: ###
[ERROR] Initialisation failed
# opam-version 1.2.2
# os cygwin
Cannot remove /home/andrew/.opam (error 255).
(2) Even if I get this to work, I don't think it's the right thing to do
because it's setting up persistent opam configuration in my home directory,
which I don't think is the right place for packaging. Should there be some
global opam configuration, that all packaging scripts that rely on opam
would use? If so, where should that go?