Discussion:
[ocaml-platform] opam without internet access
Hendrik Tews
2016-03-23 22:21:39 UTC
Permalink
Hi,

I am trying to use opam on a machine without internet access. I
got it working with some glitches, I would like to ask here for
advice.

On a machine with internet access I do

git clone git://github.com/ocaml/opam-repository
cd opam-repository
opam-admin make

The last command downloads the sources of all packages into the
archives subdir. I then physically move the opam-repository
directory to the machine without internet access and there I do

opam init local /path/to/opam-repository

I can now install packages without internet connection because
opam accesses the sources in the archives subdir.

However, when I do opam switch for installing a different
compiler, opam wants to download the OCaml sources from the inria
website.

Is there a way to instruct opam-admin to download and cache the
compiler sources too? I am using now the following workaround: I
modify the URL in the src field of the .comp file of the few
compiler versions that I am interested in and copy the source
file manually into the right location.

I now have 2 questions for opam-admin make. Firstly, is there a
way to restrict to restrict the download of the sources to the
latest two stable versions? I mean, it is great that I can
install every version of utop from 1.2.1 to 1.18.2, but I don't
really need that flexibility.

Secondly, the archives subdir is present already on
http://opam.ocaml.org/ . Is there a way to instruct opam-admin to
download package sources from there without rebuilding them
locally?

Thanks in advance,

Hendrik Tews

This email and any attachments thereto may contain private, confidential, and/or privileged material for the sole use of the intended recipient. Any review, copying, or distribution of this email (or any attachments thereto) by others is strictly prohibited. If you are not the intended recipient, please contact the sender immediately and permanently delete the original and any copies of this email and any attachments thereto.
Louis Gesbert
2016-03-24 02:27:11 UTC
Permalink
Post by Hendrik Tews
However, when I do opam switch for installing a different
compiler, opam wants to download the OCaml sources from the inria
website.
Is there a way to instruct opam-admin to download and cache the
compiler sources too? I am using now the following workaround: I
modify the URL in the src field of the .comp file of the few
compiler versions that I am interested in and copy the source
file manually into the right location.
I don't think there is in the latest stable. The upcoming release removes this
annoying duality between compiler and package definitions (defining everything
as packages), so that will solve this problem. (on the other hand, it allows
packages to define extra-sources, e.g. for compiler patches, and that will need
separate caching)
Post by Hendrik Tews
I now have 2 questions for opam-admin make. Firstly, is there a
way to restrict to restrict the download of the sources to the
latest two stable versions? I mean, it is great that I can
install every version of utop from 1.2.1 to 1.18.2, but I don't
really need that flexibility.
You may see the option `--resolve`. It's a bit clunky but may serve your need.
Post by Hendrik Tews
Secondly, the archives subdir is present already on
http://opam.ocaml.org/ . Is there a way to instruct opam-admin to
download package sources from there without rebuilding them
locally?
Not at the moment. `opam update --sync-archives` kind of does that (towards
the opam cache in ~/.opam), but it was only intended for debug, and you can't
filter the packages you want to download.

Hope this helps. Generating a self-contained local repo is indeed quite
useful. There may be some other tools to help do that around.

Louis Gesbert - OCamlPro
Hendrik Tews
2016-03-24 07:28:49 UTC
Permalink
Thanks for your quick answer!
Post by Louis Gesbert
Post by Hendrik Tews
I now have 2 questions for opam-admin make. Firstly, is there a
way to restrict to restrict the download of the sources to the
latest two stable versions? I mean, it is great that I can
install every version of utop from 1.2.1 to 1.18.2, but I don't
really need that flexibility.
You may see the option `--resolve`. It's a bit clunky but may serve your need.
I cannot find this option. Where should I look for it?

Thanks,

Hendrik
This email and any attachments thereto may contain private, confidential, and/or privileged material for the sole use of the intended recipient. Any review, copying, or distribution of this email (or any attachments thereto) by others is strictly prohibited. If you are not the intended recipient, please contact the sender immediately and permanently delete the original and any copies of this email and any attachments thereto.
Louis Gesbert
2016-03-24 07:34:48 UTC
Permalink
`opam-admin make --resolve` (try `opam-admin make --help` for details)
Post by Hendrik Tews
Thanks for your quick answer!
Post by Louis Gesbert
Post by Hendrik Tews
I now have 2 questions for opam-admin make. Firstly, is there a
way to restrict to restrict the download of the sources to the
latest two stable versions? I mean, it is great that I can
install every version of utop from 1.2.1 to 1.18.2, but I don't
really need that flexibility.
You may see the option `--resolve`. It's a bit clunky but may serve your need.
I cannot find this option. Where should I look for it?
Thanks,
Hendrik
This email and any attachments thereto may contain private, confidential,
and/or privileged material for the sole use of the intended recipient. Any
review, copying, or distribution of this email (or any attachments thereto)
by others is strictly prohibited. If you are not the intended recipient,
please contact the sender immediately and permanently delete the original
and any copies of this email and any attachments thereto.
_______________________________________________
Platform mailing list
http://lists.ocaml.org/listinfo/platform
Loading...