From 0ed68f51a5cc99866e0ea647a560fefee4385f87 Mon Sep 17 00:00:00 2001 From: Romain Bardou Date: Thu, 15 Feb 2024 15:35:17 +0100 Subject: [PATCH 1/2] Scripts: add update_opam_lock.sh --- scripts/update_opam_lock.sh | 105 ++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100755 scripts/update_opam_lock.sh diff --git a/scripts/update_opam_lock.sh b/scripts/update_opam_lock.sh new file mode 100755 index 000000000000..064c6f78e109 --- /dev/null +++ b/scripts/update_opam_lock.sh @@ -0,0 +1,105 @@ +#!/bin/sh + +set -eu + +help() { + cat << EOT +This script updates opam/virtual/octez-deps.opam.locked. +This lock file contains the version number for all of Octez dependencies, +both direct and indirect. It does not include dev-only dependencies. + +To produce this lock file, this scripts asks opam to use the commit: + + full_opam_repository_tag = $full_opam_repository_tag + +from the public opam repository, to find a solution that is compatible +with opam/virtual/octez-deps.opam and opam/virtual/octez-dev-deps.opam. +Those two files are generated by the manifest +(see the documentation on profiles in manifest/manifest.mli). +Variable full_opam_repository_tag is defined in version.sh. +EOT + exit 0 +} + +script_dir="$(cd "$(dirname "$0")" && echo "$(pwd -P)/")" +src_dir="$(dirname "$script_dir")" + +# Needed for $full_opam_repository_tag +. scripts/version.sh + +if [ "${1:-}" = "--help" ]; then + help +fi + +tmp_dir="$(mktemp -dt update_opam_lock.XXXXXXXX)" +tmp_opam_repo="$tmp_dir/repo" +tmp_opam_repo_name="update_opam_lock_tmp" +tmp_opam_switch="$tmp_dir/switch" + +already_cleaned_up=no +clean_up() { + if [ "$already_cleaned_up" = "no" ]; then + already_cleaned_up=yes + echo "---- Clean up." + opam switch remove "$tmp_opam_switch" --yes || echo "Failed to remove switch." + opam repository remove "$tmp_opam_repo_name" --all || echo "Failed to remove repository." + rm -rf "$tmp_dir" + fi +} + +trap clean_up EXIT INT + +# Ideally we would just set the opam repository URL to +# https://github.com/ocaml/opam-repository.git#$full_opam_repository_tag, but: +# - cloning the repo ourselves is actually significantly faster +# (maybe opam does not know how to do a shallow clone); +# - this allows us to remove ocaml-system +# (but we could also create the switch with --packages=ocaml-base-compiler.$ocaml_version); +# - this will allow us to remove other packages more easily in the future should we want to; +# - the --repositories argument of 'opam switch create' does not seem to understand +# "url#tag", contrary to 'repository add'. +echo "---- Fetch opam repository commit: $full_opam_repository_tag" +git init "$tmp_opam_repo" +cd "$tmp_opam_repo" +git config --local protocol.version 2 +git remote add origin https://github.com/ocaml/opam-repository +git fetch --depth 1 origin "$full_opam_repository_tag" +git checkout "$full_opam_repository_tag" +# Prevent opam from choosing the system-wide installed OCaml compiler. +rm -rf packages/ocaml-system +# Remove .git to be extra sure that opam will not use a different commit hash. +rm -rf .git +cd "$src_dir" + +# We use --fake to tell opam not to actually compile the OCaml compiler. +# This breaks the switch but we will delete it afterwards anyway. +echo "---- Create a temporary fresh switch that uses our trimmed down repository." +unset OPAMSWITCH +opam switch create "$tmp_opam_switch" "$ocaml_version" \ + --repositories="$tmp_opam_repo_name"="$tmp_opam_repo" --no-install --fake +export OPAMSWITCH="$tmp_opam_switch" + +# The default timeout (60 seconds) is often not enough. +export OPAMSOLVERTIMEOUT="${OPAMSOLVERTIMEOUT:-600}" + +# Ask opam to find a solution that covers both: +# - 'octez-deps', so that we can compile Octez; +# - 'octez-dev-deps', so that the solution is compatible with tools that devs +# may want to install. +# We use --fake to tell opam not to actually compile the packages. +echo "---- Run: 'opam install'" +opam install --yes --deps-only --fake opam/virtual/octez-deps.opam opam/virtual/octez-dev-deps.opam + +# The utop package is a special case. +# The pyml package, which is an actual dependency, optionally depends on utop. +# So if utop is installed, it is added in the lock file because of pyml. +# But utop is only a dev dependency, and as such does not need to appear in the lock file. +# So we remove it before generating the lock file. +echo "---- Run: 'opam remove utop'" +opam remove --yes --fake utop + +echo "---- Run: 'opam lock'" +opam lock opam/virtual/octez-deps.opam + +mv octez-deps.opam.locked opam/virtual +echo "---- Updated: opam/virtual/octez-deps.opam.locked" -- GitLab From 186dae422187d5580b72619dfe8ca80cdea50f43 Mon Sep 17 00:00:00 2001 From: Romain Bardou Date: Thu, 15 Feb 2024 15:35:28 +0100 Subject: [PATCH 2/2] Opam: add lock file --- opam/virtual/octez-deps.opam.locked | 245 ++++++++++++++++++++++++++++ 1 file changed, 245 insertions(+) create mode 100644 opam/virtual/octez-deps.opam.locked diff --git a/opam/virtual/octez-deps.opam.locked b/opam/virtual/octez-deps.opam.locked new file mode 100644 index 000000000000..465d84451c68 --- /dev/null +++ b/opam/virtual/octez-deps.opam.locked @@ -0,0 +1,245 @@ +opam-version: "2.0" +name: "octez-deps" +version: "~dev" +synopsis: + "Virtual package depending on Octez dependencies (profile: octez-deps)" +description: + "Install this package to install all dependencies needed to build the subset of Octez denoted by profile octez-deps." +maintainer: "contact@tezos.com" +authors: "Tezos devteam" +license: "MIT" +homepage: "https://www.tezos.com/" +bug-reports: "https://gitlab.com/tezos/tezos/issues" +depends: [ + "aches" {= "1.0.0"} + "aches-lwt" {= "1.0.0"} + "alcotest" {= "1.7.0"} + "angstrom" {= "0.16.0"} + "asetmap" {= "0.8.1"} + "asn1-combinators" {= "0.2.6"} + "astring" {= "0.8.5"} + "base" {= "v0.16.3"} + "base-bigarray" {= "base"} + "base-bytes" {= "base"} + "base-threads" {= "base"} + "base-unix" {= "base"} + "base64" {= "3.5.1"} + "bheap" {= "2.0.0"} + "bigarray-compat" {= "1.1.0"} + "bigstring" {= "0.3"} + "bigstringaf" {= "0.9.1"} + "bisect_ppx" {= "2.8.3"} + "bos" {= "0.2.1"} + "ca-certs" {= "0.2.3"} + "camlp-streams" {= "5.0.1"} + "camlzip" {= "1.11"} + "caqti" {= "2.0.1"} + "caqti-driver-sqlite3" {= "2.0.1"} + "caqti-dynload" {= "2.0.1"} + "caqti-lwt" {= "2.0.1"} + "checkseum" {= "0.5.2"} + "clap" {= "0.3.0"} + "class_group_vdf" {= "0.0.4"} + "cmdliner" {= "1.2.0"} + "cohttp" {= "5.3.1"} + "cohttp-lwt" {= "5.3.0"} + "cohttp-lwt-unix" {= "5.3.0"} + "conduit" {= "6.2.1"} + "conduit-lwt" {= "6.2.1"} + "conduit-lwt-unix" {= "6.2.1"} + "conf-autoconf" {= "0.1"} + "conf-cmake" {= "1"} + "conf-g++" {= "1.0"} + "conf-gmp" {= "4"} + "conf-gmp-powm-sec" {= "3"} + "conf-hidapi" {= "0"} + "conf-libev" {= "4-12"} + "conf-libffi" {= "2.0.0"} + "conf-pkg-config" {= "3"} + "conf-protoc" {= "4.4.0"} + "conf-rust" {= "0.1"} + "conf-rust-2021" {= "1"} + "conf-sqlite3" {= "1"} + "conf-which" {= "1"} + "conf-zlib" {= "1"} + "cppo" {= "1.6.9"} + "csexp" {= "1.5.2"} + "cstruct" {= "6.2.0"} + "cstruct-lwt" {= "6.2.0"} + "ctypes" {= "0.20.2"} + "ctypes-foreign" {= "0.18.0"} + "ctypes_stubs_js" {= "0.1"} + "data-encoding" {= "0.7.1"} + "decompress" {= "1.5.3"} + "digestif" {= "1.1.4"} + "dmap" {= "0.5"} + "domain-name" {= "0.4.0"} + "dune" {= "3.12.2"} + "dune-build-info" {= "3.12.2"} + "dune-configurator" {= "3.12.2"} + "duration" {= "0.2.1"} + "either" {= "1.0.0"} + "eqaf" {= "0.9"} + "ezjsonm" {= "1.3.0"} + "fix" {= "20230505"} + "fmt" {= "0.9.0"} + "fpath" {= "0.7.3"} + "gen" {= "1.1"} + "gmap" {= "0.3.0"} + "hacl-star" {= "0.7.1"} + "hacl-star-raw" {= "0.7.1"} + "hashcons" {= "1.3"} + "hex" {= "1.5.0"} + "hidapi" {= "1.2.1"} + "hidapi-lwt" {= "1.2.1"} + "hkdf" {= "1.0.4"} + "index" {= "1.6.2"} + "integers" {= "0.7.0"} + "integers_stubs_js" {= "1.0"} + "ipaddr" {= "5.5.0"} + "ipaddr-sexp" {= "5.5.0"} + "jane-street-headers" {= "v0.16.0"} + "jingoo" {= "1.5.0"} + "js_of_ocaml" {= "5.6.0"} + "js_of_ocaml-compiler" {= "5.6.0"} + "js_of_ocaml-lwt" {= "5.6.0"} + "js_of_ocaml-ppx" {= "5.6.0"} + "json-data-encoding" {= "0.12.1"} + "json-data-encoding-bson" {= "0.12.1"} + "jsonm" {= "1.0.2"} + "jst-config" {= "v0.16.0"} + "lambda-term" {= "3.3.2"} + "ledgerwallet" {= "0.4.0"} + "ledgerwallet-tezos" {= "0.4.0"} + "logs" {= "0.7.0"} + "lru" {= "0.3.1"} + "lwt" {= "5.7.0"} + "lwt-canceler" {= "0.3"} + "lwt-dllist" {= "1.0.1"} + "lwt-exit" {= "1.0"} + "lwt-watcher" {= "0.2"} + "lwt_react" {= "1.2.0"} + "macaddr" {= "5.5.0"} + "magic-mime" {= "1.3.1"} + "menhir" {= "20231231"} + "menhirCST" {= "20231231"} + "menhirLib" {= "20231231"} + "menhirSdk" {= "20231231"} + "mew" {= "0.1.0"} + "mew_vi" {= "0.5.0"} + "mirage-crypto" {= "0.11.2"} + "mirage-crypto-ec" {= "0.11.2"} + "mirage-crypto-pk" {= "0.11.2"} + "mirage-crypto-rng" {= "0.11.2"} + "mirage-crypto-rng-lwt" {= "0.11.2"} + "mtime" {= "2.0.0"} + "num" {= "1.5"} + "ocaml" {= "4.14.1"} + "ocaml-base-compiler" {= "4.14.1"} + "ocaml-compiler-libs" {= "v0.12.4"} + "ocaml-config" {= "2"} + "ocaml-migrate-parsetree" {= "2.4.0"} + "ocaml-options-vanilla" {= "1"} + "ocaml-protoc-plugin" {= "4.5.0"} + "ocaml-syntax-shims" {= "1.0.0"} + "ocaml-version" {= "3.5.0"} + "ocamlbuild" {= "0.14.3"} + "ocamlfind" {= "1.9.6"} + "ocamlformat" {= "0.24.1"} + "ocamlgraph" {= "2.1.0"} + "ocp-indent" {= "1.8.1"} + "ocp-ocamlres" {= "0.4"} + "ocplib-endian" {= "1.2"} + "odoc-parser" {= "2.0.0"} + "optint" {= "0.3.0"} + "parsexp" {= "v0.16.0"} + "pbkdf" {= "1.2.0"} + "pprint" {= "20230830"} + "ppx_assert" {= "v0.16.0"} + "ppx_base" {= "v0.16.0"} + "ppx_cold" {= "v0.16.0"} + "ppx_compare" {= "v0.16.0"} + "ppx_derivers" {= "1.2.1"} + "ppx_deriving" {= "5.2.1"} + "ppx_enumerate" {= "v0.16.0"} + "ppx_expect" {= "v0.16.0"} + "ppx_globalize" {= "v0.16.0"} + "ppx_hash" {= "v0.16.0"} + "ppx_here" {= "v0.16.0"} + "ppx_import" {= "1.10.0"} + "ppx_inline_test" {= "v0.16.1"} + "ppx_optcomp" {= "v0.16.0"} + "ppx_repr" {= "0.7.0"} + "ppx_sexp_conv" {= "v0.16.0"} + "ppxlib" {= "0.31.0"} + "prbnmcn-basic-structures" {= "0.0.1"} + "prbnmcn-linalg" {= "0.0.1"} + "prbnmcn-stats" {= "0.0.6"} + "pringo" {= "1.3"} + "progress" {= "0.2.2"} + "prometheus" {= "1.2"} + "prometheus-app" {= "1.2"} + "psq" {= "0.2.1"} + "ptime" {= "1.1.0"} + "pure-splitmix" {= "0.3"} + "pyml" {= "20231101"} + "qcheck-alcotest" {= "0.21.3"} + "qcheck-core" {= "0.21.3"} + "re" {= "1.11.0"} + "react" {= "1.2.2"} + "repr" {= "0.7.0"} + "resto" {= "1.2"} + "resto-acl" {= "1.2"} + "resto-cohttp" {= "1.2"} + "resto-cohttp-client" {= "1.2"} + "resto-cohttp-self-serving-client" {= "1.2"} + "resto-cohttp-server" {= "1.2"} + "resto-directory" {= "1.2"} + "result" {= "1.5"} + "ringo" {= "1.0.0"} + "rresult" {= "0.7.0"} + "rusage" {= "1.0.0"} + "secp256k1-internal" {= "0.4.0"} + "sedlex" {= "3.2"} + "semaphore-compat" {= "1.0.1"} + "seq" {= "base"} + "seqes" {= "0.2"} + "sexplib" {= "v0.16.0"} + "sexplib0" {= "v0.16.0"} + "sqlite3" {= "5.1.0"} + "stdcompat" {= "19"} + "stdint" {= "0.7.2"} + "stdio" {= "v0.16.0"} + "stdlib-shims" {= "0.3.0"} + "stringext" {= "1.6.0"} + "tar" {= "2.6.0"} + "tar-unix" {= "2.6.0"} + "terminal" {= "0.2.2"} + "tezos-rust-libs" {= "1.6"} + "tezos-sapling-parameters" {= "1.1.0"} + "tezt" {= "4.0.0"} + "time_now" {= "v0.16.0"} + "tls" {= "0.17.3"} + "tls-lwt" {= "0.17.3"} + "topkg" {= "1.0.7"} + "trie" {= "1.0.0"} + "uchar" {= "0.0.2"} + "uri" {= "4.4.0"} + "uri-sexp" {= "4.4.0"} + "uucp" {= "15.1.0"} + "uuseg" {= "15.1.0"} + "uutf" {= "1.0.3"} + "vector" {= "1.0.0"} + "x509" {= "0.16.5"} + "yaml" {= "3.2.0"} + "yojson" {= "2.1.2"} + "zarith" {= "1.13"} + "zarith_stubs_js" {= "v0.16.1"} + "zed" {= "3.2.3"} +] +conflicts: [ + "checkseum" {= "0.5.0"} + "hacl_x25519" + "result" {< "1.5"} +] +dev-repo: "git+https://gitlab.com/tezos/tezos.git" \ No newline at end of file -- GitLab