diff --git a/.gitignore b/.gitignore index d4c0e9e1f..247dff122 100644 --- a/.gitignore +++ b/.gitignore @@ -59,5 +59,6 @@ src/stdlib/*.json .DS_Store # external dependencies -_deps/* +deps/libff/build/ +deps/libff/install/ diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..6c67d8736 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "deps/libff/src"] + path = deps/libff/src + url = https://github.com/scipr-lab/libff diff --git a/Makefile b/Makefile index 273f667d3..9b2fc8c21 100644 --- a/Makefile +++ b/Makefile @@ -75,7 +75,7 @@ clean: dune clean # Remove remaining files/folders ignored by git as defined in .gitignore (-X) # but keeping a local opam switch and other dependencies built. - git clean -dfXq --exclude=\!_deps/** --exclude=\!_opam/** + git clean -dfXq --exclude=\!_opam/** # Build a standalone scilla docker docker: diff --git a/README.md b/README.md index 5bb1dcb99..a152b6e05 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,11 @@ A comprehensive documentation on Scilla, its features and constructs can be foun We suggest users to use the latest release of Scilla available [here](https://github.com/Zilliqa/scilla/releases). +If you'd like to hack on Scilla, clone it with all of its submodules: +```shell +git clone --jobs 4 --recurse-submodules https://github.com/Zilliqa/scilla/ +``` + ### Build requirements Platform specific instructions for setting up your system for building Scilla can be diff --git a/deps/libff/src b/deps/libff/src new file mode 160000 index 000000000..f20671625 --- /dev/null +++ b/deps/libff/src @@ -0,0 +1 @@ +Subproject commit f2067162520f91438b44e71a2cab2362f1c3cab4 diff --git a/scilla.opam b/scilla.opam index 059dbb5b4..5beea6b4c 100644 --- a/scilla.opam +++ b/scilla.opam @@ -30,8 +30,8 @@ depends: [ "patdiff" {with-test & (>= "v0.12.1" & < "v0.13~")} ] build: [ - [ "dune" "build" "-j" jobs "@install" ] - [ "dune" "runtest" "-p" name "-j" jobs ] {with-test} + [ "./scripts/libff.sh" ] + [ "dune" "build" "-p" name "-j" jobs ] ] synopsis: "Scilla: Safe-By-Design Smart Contract Language" description: """ diff --git a/scripts/libff.sh b/scripts/libff.sh index 02ef03498..cdef6af0b 100755 --- a/scripts/libff.sh +++ b/scripts/libff.sh @@ -1,11 +1,13 @@ #!/usr/bin/env bash + +set -ev + # This script is expected to be executed from Scilla root # $./scripts/libff.sh -# The script fetches, builds and installs libff in the +# The script builds and installs libff in the # _build directory of Scilla root. -libffurl="https://github.com/scipr-lab/libff.git" -libffdir="_deps/libff" +libffdir="deps/libff" # Check if CWD has `scilla.opam`, assuring us that it's the root. if [[ ! -f scilla.opam ]] @@ -21,15 +23,9 @@ then exit 0 fi -mkdir -p $libffdir cd $libffdir mkdir -p build install -echo "Cloning libff into ${libffdir}/src" -git clone $libffurl src cd src -echo "Fetching submodules for libff" -git submodule init && git submodule update -git checkout f2067162520f91438b44e71a2cab2362f1c3cab4 echo "Installing libff into ${libffdir}/install" cd ../build cmake ../src -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_POSITION_INDEPENDENT_CODE=1 -DWITH_PROCPS=OFF diff --git a/src/base/cpp/config/discover.ml b/src/base/cpp/config/discover.ml index 0bbe4ffa2..94cff30da 100644 --- a/src/base/cpp/config/discover.ml +++ b/src/base/cpp/config/discover.ml @@ -29,8 +29,8 @@ let () = in (* This file runs in _build/default/src/base/cpp. - * libff is installed in _deps/libff/install. *) - let libff_dir = Sys.getcwd() ^ "/../../../../../_deps/libff/install" in + * libff is installed in deps/libff/install. *) + let libff_dir = Sys.getcwd() ^ "/../../../../../deps/libff/install" in let libff_include_dir = libff_dir ^ "/include" in let libff_lib_dir = libff_dir ^ "/lib" in if not (Sys.file_exists libff_include_dir) || not (Sys.file_exists libff_lib_dir)