diff --git a/Makefile b/Makefile index aac3b2f19a29e318d5c1ba39e502ffda8dee80c9..f5177be77b9d2e69eb9e4bc30d6b6f3f0234b758 100644 --- a/Makefile +++ b/Makefile @@ -90,7 +90,7 @@ endif # Targets 'all', 'release', 'experimental-release' and 'static' define different # default lists of executables to build but they all can be overridden from the command-line. .PHONY: all -all: +all: kernels @$(MAKE) build OCTEZ_EXECUTABLES?="$(ALL_EXECUTABLES)" .PHONY: release @@ -473,4 +473,24 @@ clean: coverage-clean clean-old-names .PHONY: build-kernels build-kernels: - make -f kernels.mk build-kernels + ${MAKE} -f kernels.mk build-kernels + + +define KERNELS_WARNING_MESSAGE + +Failed to build smart rollup kernels. This is allowed as it is not strictly +required to run the octez suite. However, you will not be able to use some +smart rollup related features and the associated integration tests. + +If you wish to change that, you can use the script `scripts/install_build_deps.kernels.sh` +to install missing dependencies and re-run `make kernels`. + +endef +export KERNELS_WARNING_MESSAGE + +# This is allowed to fail because it is used in `all`. +.PHONY: kernels +kernels: + @${MAKE} -f kernels.mk build-deps && ${MAKE} -f kernels.mk build-kernels || \ + echo "$$KERNELS_WARNING_MESSAGE" + diff --git a/scripts/install_build_deps.kernels.sh b/scripts/install_build_deps.kernels.sh new file mode 100755 index 0000000000000000000000000000000000000000..8a0818d5bbd660aea3de80f47ef4728e5b0a8a43 --- /dev/null +++ b/scripts/install_build_deps.kernels.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash + +set -e + +# This script assumes that [./install_build_deps.rust.sh] was called and +# rustup is available. + +echo -e "<><> \033[1mInstall kernels dependencies\033[0m ><><><><><><><><><><><><><><><><><><><><><><>" + +success=0 + +if [ ! -x "$(command -v clang)" ]; then + echo "Clang is not installed. Please install at least Clang >= 11." + echo "See instructions at: https://clang.llvm.org/" + success=1 +fi + +if [ ! -x "$(command -v wasm-strip)" ]; then + echo "WABT is not installed." + echo "See instructions at: https://github.com/WebAssembly/wabt" + success=1 +fi + +if [ ! -x "$(command -v eth)" ]; then + if [ ! -x "$(command -v npm)" ]; then + echo "npm is required to install eth." + echo "See instructions at: https://docs.npmjs.com/downloading-and-installing-node-js-and-npm" + success=1 + else + npm install eth-cli@2.0.2 --no-save + fi +fi + +echo "Done installing kernels dependencies." +exit $success diff --git a/scripts/install_build_deps.sh b/scripts/install_build_deps.sh index 9de6275ffc25e975eb166910309e85570ab75026..4ea2d898229ed93388c5f0f52de3bb1e0fa2e3a0 100755 --- a/scripts/install_build_deps.sh +++ b/scripts/install_build_deps.sh @@ -107,3 +107,13 @@ fi "$script_dir"/install_sapling_parameters.sh + +# install kernels dependencies if asked +if [ -n "$dev" ]; then + "$script_dir"/install_build_deps.kernels.sh || + echo "\ + +It is recommended to act on the missing dependencies and call ${script_dir}install_build_deps.kernels.sh again. +Note that this is not strictly required to use the octez suite." +fi + diff --git a/tezt/lib_ethereum/eth_cli.ml b/tezt/lib_ethereum/eth_cli.ml index b34ea637b535bc86d9130356497189735dec10de..3f53feaa3f4510fd1b38b12841dd7345a813550a 100644 --- a/tezt/lib_ethereum/eth_cli.ml +++ b/tezt/lib_ethereum/eth_cli.ml @@ -26,7 +26,7 @@ let path = "eth" let spawn_command command decode = - let process = Process.spawn path command in + let process = Process.spawn "npm" (["exec"; "--"; path] @ command) in let* output = Process.check_and_read_stdout process in return (JSON.parse ~origin:"eth_spawn_command" output |> decode)