Opam: remove tezos-deps.opam

All dependencies are now inlined in the various opam packages.
This commit is contained in:
Grégoire Henry 2017-12-06 19:52:00 +01:00 committed by Grégoire
parent d8d54ce321
commit de5935228f
10 changed files with 61 additions and 73 deletions

View File

@ -12,7 +12,7 @@ Build instructions
------------------ ------------------
To compile Tezos, you need an OCaml compiler (version 4.04.2) and all the To compile Tezos, you need an OCaml compiler (version 4.04.2) and all the
libraries listed in `src/tezos-deps.opam`. libraries listed in the various `tezos-*.opam` files.
The best way to install all dependencies is by first installing The best way to install all dependencies is by first installing
[OPAM](https://opam.ocaml.org/), the OCaml package manager. [OPAM](https://opam.ocaml.org/), the OCaml package manager.

View File

@ -6,8 +6,7 @@ FROM $base_image
## /!\ 'COPY'edfiles. ## /!\ 'COPY'edfiles.
## /!\ /!\ /!\ /!\/!\ /!\ /!\ ## /!\ /!\ /!\ /!\/!\ /!\ /!\
COPY scripts/install_build_deps.sh scripts/version.sh tezos/scripts/ $copy_files
COPY tezos-deps.opam tezos/
RUN sudo apk update && \ RUN sudo apk update && \
opam config exec -- ./tezos/scripts/install_build_deps.sh && \ opam config exec -- ./tezos/scripts/install_build_deps.sh && \

View File

@ -23,12 +23,20 @@ cleanup () {
} }
trap cleanup EXIT INT trap cleanup EXIT INT
opam_files=$(find -name \*.opam | sort)
dependencies="$opam_files scripts/install_build_deps.sh scripts/version.sh scripts/opam-pin.sh scripts/opam-unpin.sh scripts/opam-remove.sh Dockerfile"
for file in $dependencies; do
if [ "$file" = Dockerfile ]; then continue; fi
copy_files="$copy_files\nCOPY $file ./tezos/$file"
done
sed -e 's|$base_image|'"$base_image"'|g' \ sed -e 's|$base_image|'"$base_image"'|g' \
-e 's|$ocaml_version|'"$ocaml_version"'|g' \ -e 's|$ocaml_version|'"$ocaml_version"'|g' \
-e 's|$copy_files|'"$copy_files"'|g' \
scripts/Dockerfile.build_deps.in > Dockerfile scripts/Dockerfile.build_deps.in > Dockerfile
## Lookup for for prebuilt dependencies... ## Lookup for for prebuilt dependencies...
dependencies="scripts/install_build_deps.sh scripts/version.sh tezos-deps.opam Dockerfile"
dependencies_sha1=$(docker inspect --format="{{ .RootFS.Layers }}" --type=image $base_image | sha1sum - $dependencies | sha1sum | tr -d ' -') dependencies_sha1=$(docker inspect --format="{{ .RootFS.Layers }}" --type=image $base_image | sha1sum - $dependencies | sha1sum | tr -d ' -')
if [ ! -z "$cached_image" ]; then if [ ! -z "$cached_image" ]; then
echo echo

View File

@ -3,7 +3,7 @@
script_dir="$(cd "$(dirname "$0")" && echo "$(pwd -P)/")" script_dir="$(cd "$(dirname "$0")" && echo "$(pwd -P)/")"
src_dir="$(dirname "$script_dir")" src_dir="$(dirname "$script_dir")"
. "$script_dir/version.sh" . "$script_dir"/version.sh
if [ "$(ocaml -vnum)" != "$ocaml_version" ]; then if [ "$(ocaml -vnum)" != "$ocaml_version" ]; then
echo ; echo ;
@ -13,23 +13,10 @@ if [ "$(ocaml -vnum)" != "$ocaml_version" ]; then
exit 1; exit 1;
fi fi
set -e "$script_dir"/opam-unpin.sh
set -x . "$script_dir"/opam-pin.sh
### Temporary HACK
## Should be in sync with `opam-pin.sh` and `opam-unpin.sh`
opam pin --yes add --no-action --dev-repo sodium
opam pin --yes add --no-action --dev-repo ocp-ocamlres
opam pin --yes add --no-action --dev-repo ocplib-json-typed
### End of temporary HACK
## Force opam to take account of the new `tezos-deps.opam`
opam pin --yes remove tezos-deps
opam pin --yes add --no-action tezos-deps $src_dir
opam list --installed depext || opam install depext opam list --installed depext || opam install depext
opam depext tezos-deps opam depext $packages
opam install tezos-deps --deps-only opam install $packages --deps-only

View File

@ -5,7 +5,7 @@ set -e
script_dir="$(cd "$(dirname "$0")" && echo "$(pwd -P)/")" script_dir="$(cd "$(dirname "$0")" && echo "$(pwd -P)/")"
src_dir="$(dirname "$script_dir")" src_dir="$(dirname "$script_dir")"
opams=$(find "$src_dir" -name tezos-deps.opam -prune -or -name \*.opam -print) opams=$(find "$src_dir" -name \*.opam -print)
export OPAMYES=yes export OPAMYES=yes
@ -22,11 +22,14 @@ packages=$(opam list --short --all --sort $packages)
### Temporary HACK ### Temporary HACK
## Should be in sync with `install-build-deps.sh` and `opam-unpin.sh` ## Should be in sync with `opam-unpin.sh`
opam pin add --no-action --dev-repo sodium opam pin add --no-action --dev-repo sodium
opam pin add --no-action --dev-repo ocp-ocamlres opam pin add --no-action --dev-repo ocp-ocamlres
opam pin add --no-action --dev-repo ocplib-json-typed opam pin add --no-action --dev-repo ocplib-json-typed
opam remove tezos-deps || true
### End of temporary HACK ### End of temporary HACK
echo
echo "Pinned packages:"
echo "$packages" | sed 's/^/ /'
echo

View File

@ -11,7 +11,7 @@ opam pin remove $packages
### Temporary HACK ### Temporary HACK
## Should be in sync with `install-build-deps.sh` and `opam-pin.sh` ## Should be in sync with `opam-pin.sh`
opam pin remove --no-action sodium opam pin remove --no-action sodium
opam pin remove --no-action ocp-ocamlres opam pin remove --no-action ocp-ocamlres
opam pin remove --no-action ocplib-json-typed opam pin remove --no-action ocplib-json-typed

View File

@ -38,7 +38,14 @@ let fork_node ?(timeout = 4) ?(port = 18732) ?sandbox () =
let null_fd = Unix.(openfile "/dev/null" [O_RDONLY] 0o644) in let null_fd = Unix.(openfile "/dev/null" [O_RDONLY] 0o644) in
let exe = let exe =
let (//) = Filename.concat in let (//) = Filename.concat in
Sys.getcwd () // ".." // "bin_node" // "main.exe" in try
let path = Sys.argv.(1) in
if Filename.is_relative path then
Sys.getcwd () // ".." // path
else
path
with _ -> Sys.getcwd () // ".." // "bin_node" // "main.exe" in
Format.eprintf "EXE %s@." exe ;
let pid = let pid =
Unix.create_process exe Unix.create_process exe
[| "tezos-node" ; [| "tezos-node" ;

View File

@ -30,31 +30,27 @@
(alias (alias
((name runtest_endorsement) ((name runtest_endorsement)
(deps (../../bin_node/main.exe (deps (sandbox.json))
sandbox.json))
(locks (/tcp-port/18100)) (locks (/tcp-port/18100))
(action (run ${exe:test_endorsement.exe})))) (action (chdir ${ROOT} (run ${exe:test_endorsement.exe} ${bin:tezos-node})))))
(alias (alias
((name runtest_origination) ((name runtest_origination)
(deps (../../bin_node/main.exe (deps (sandbox.json))
sandbox.json))
(locks (/tcp-port/18200)) (locks (/tcp-port/18200))
(action (run ${exe:test_origination.exe})))) (action (chdir ${ROOT} (run ${exe:test_origination.exe} ${bin:tezos-node})))))
(alias (alias
((name runtest_transaction) ((name runtest_transaction)
(deps (../../bin_node/main.exe (deps (sandbox.json))
sandbox.json))
(locks (/tcp-port/18300)) (locks (/tcp-port/18300))
(action (run ${exe:test_transaction.exe})))) (action (chdir ${ROOT} (run ${exe:test_transaction.exe} ${bin:tezos-node})))))
(alias (alias
((name runtest_vote) ((name runtest_vote)
(deps (../../bin_node/main.exe (deps (sandbox-vote.json))
sandbox-vote.json))
(locks (/tcp-port/18400)) (locks (/tcp-port/18400))
(action (run ${exe:test_vote.exe})))) (action (chdir ${ROOT} (run ${exe:test_vote.exe} ${bin:tezos-node})))))
(alias (alias
((name runtest) ((name runtest)

21
test/tezos-test.opam Normal file
View File

@ -0,0 +1,21 @@
opam-version: "1.2"
version: "dev"
maintainer: "contact@tezos.com"
authors: [ "Tezos devteam" ]
homepage: "https://www.tezos.com/"
bug-reports: "https://gitlab.com/tezos/tezos/issues"
dev-repo: "https://gitlab.com/tezos/tezos.git"
license: "unreleased"
depends: [
"ocamlfind" { build }
"jbuilder" { build & >= "1.0+beta15" }
"tezos-node"
"tezos-client"
"kaputt"
]
build: [
[ "jbuilder" "build" "-p" name "-j" jobs "@buildtest" ]
]
build-test: [
[ "jbuilder" "runtest" "-p" name "-j" jobs ]
]

View File

@ -1,33 +0,0 @@
opam-version: "1.2"
version: "dev"
maintainer: "contact@tezos.com"
authors: [ "Tezos devteam" ]
homepage: "https://www.tezos.com/"
bug-reports: "https://gitlab.com/tezos/tezos/issues"
dev-repo: "https://gitlab.com/tezos/tezos.git"
license: "unreleased"
depends: [
"ocamlfind" { build }
"jbuilder" { build & >= "1.0+beta15" }
"base-bigarray"
"base-threads"
"conf-libev"
"calendar"
"cohttp" { >= "1.0.0" }
"conduit"
"ezjsonm" { >= "0.5.0" }
"irmin" { >= "1.3" }
"lwt" { >= "3.0.0" }
"lwt_ssl"
"menhir"
"mtime" { >= "1.0.0" }
"ocp-ocamlres" { >= "dev" }
"ocplib-endian"
"ocplib-json-typed"
"reactiveData"
"sodium" { >= "0.3.0" }
"magic-mime"
"leveldb" { >= "1.1.2" }
"kaputt" # { test }
"bisect_ppx" # { test }
]