From ca8e370658272a665195be68289a625e931805c0 Mon Sep 17 00:00:00 2001 From: Gabriel Scherer Date: Thu, 28 Sep 2017 15:54:17 +0200 Subject: [PATCH 1/3] install-builder.sh: refresh index before building a switch --- scripts/install-builder.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/install-builder.sh b/scripts/install-builder.sh index f33de4f..d33da6e 100644 --- a/scripts/install-builder.sh +++ b/scripts/install-builder.sh @@ -90,10 +90,17 @@ cd ${ROOTDIR} # all instances share a download-cache mkdir opam-download-cache -# Now, here is how to create a switch for 3.12.1: +# Now, here is how to create a switch for 4.02.1: PATH=${OPAMPATH} ${OPAMBUILDER} create 4.02.1 cd ${ROOTDIR}/4.02.1 + +# update the switch index +cd 2.0 +PATH=${OPAMPATH} ${OPAM} admin index +cd .. + +# watch the 4.02.1 switch PATH=${OPAMPATH} nohup ${OPAMBUILDER} switch & # Now, here is how to create a switch for 4.03.0: @@ -101,6 +108,9 @@ PATH=${OPAMPATH} nohup ${OPAMBUILDER} switch & # You can use `scripts/restart-switch.sh` for that PATH=${OPAMPATH} ${OPAMBUILDER} create 4.03.0 cd ${ROOTDIR}/4.03.0 +cd 2.0 +PATH=${OPAMPATH} ${OPAM} admin index +cd .. PATH=${OPAMPATH} nohup ${OPAMBUILDER} switch & # The JSON watcher From 79e89365ae1ce63aada447679e05a09a5004f74e Mon Sep 17 00:00:00 2001 From: Gabriel Scherer Date: Thu, 28 Sep 2017 15:58:18 +0200 Subject: [PATCH 2/3] install-builder.sh: use https://github URLs instead of git@github This lets you run the script from a machine that does not have SSH keys to access a github account. --- scripts/install-builder.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/install-builder.sh b/scripts/install-builder.sh index d33da6e..7c68f95 100644 --- a/scripts/install-builder.sh +++ b/scripts/install-builder.sh @@ -46,9 +46,9 @@ make install # Download and extract OPAM cd ${ROOTDIR} -git clone git@github.com:ocaml/opam +git clone https://github.com/ocaml/opam.git cd ${ROOTDIR}/opam -git remote add ${OPAM_DEV} git@github.com:${OPAM_DEV}/opam +git remote add ${OPAM_DEV} https://github.com/${OPAM_DEV}/opam git fetch ${OPAM_DEV} git checkout -b ${OPAM_BRANCH} --track ${OPAM_DEV}/${OPAM_BRANCH} cd .. @@ -64,20 +64,20 @@ cp -f src/opam ${OPAM} # Download and extract opam-repository cd ${ROOTDIR} -git clone git@github.com:ocaml/opam-repository +git clone https://github.com/ocaml/opam-repository cd ${ROOTDIR}/opam-repository -git remote add ocaml git@github.com:ocaml/opam-repository +git remote add ocaml https://github.com/ocaml/opam-repository git fetch ocaml # Create a local OPAM switch for opam-builder, with its dependencies -OPAMROOT=${LOCALROOT} ${OPAM} init -q +OPAMROOT=${LOCALROOT} ${OPAM} init --comp=4.05.0 -q OPAMROOT=${LOCALROOT} ${OPAM} install dose3 OPAMROOT=${LOCALROOT} ${OPAM} install ocp-build OPAMROOT=${LOCALROOT} ${OPAM} install jsonm # Download and extract opam-builder cd ${ROOTDIR} -git clone git@github.com:OCamlPro/opam-builder +git clone https://github.com/OCamlPro/opam-builder # Build opam-builder cd ${ROOTDIR}/opam-builder From f8c89657cfe299618e4d7229a199dfcb2783ad6d Mon Sep 17 00:00:00 2001 From: Gabriel Scherer Date: Thu, 5 Oct 2017 17:11:53 +0200 Subject: [PATCH 3/3] scripts: copy the environment-declaration logic in a self-contained script This is helpful when replaying scripts/install-opam-builder.sh command manually. However, it introduces a duplication that hurts maintenance. I'm not sure how to invoke env.sh from install-opam-builder.sh correctly. --- scripts/env.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 scripts/env.sh diff --git a/scripts/env.sh b/scripts/env.sh new file mode 100644 index 0000000..8e2a3ea --- /dev/null +++ b/scripts/env.sh @@ -0,0 +1,17 @@ +ROOTDIR=`pwd` + +# Version of OCaml used to bootstrap +OCAML=4.04 +OCAMLMINOR=0 +OCAMLPATH=${ROOTDIR}/ocaml-${OCAML}.0/local/bin:$PATH + +# Location of OPAM branch to use for opam-builder +OPAM_BRANCH=2017-04-13-opam-builder +OPAM_DEV=lefessan + + +BINDIR=${ROOTDIR}/bin +OPAMPATH=${BINDIR}:${PATH} +LOCALROOT=${ROOTDIR}/opamroot +OPAM=${BINDIR}/opam.dev +OPAMBUILDER=${BINDIR}/opam-builder