diff --git a/ci/docker-rust/Dockerfile b/ci/docker-rust/Dockerfile index da3a840c844dce..55465a6dd305e0 100644 --- a/ci/docker-rust/Dockerfile +++ b/ci/docker-rust/Dockerfile @@ -2,6 +2,10 @@ # ci/rust-version.sh to pick up the new image tag FROM rust:1.36.0 +# Add Google Protocol Buffers for Libra's metrics library. +ENV PROTOC_VERSION 3.8.0 +ENV PROTOC_ZIP protoc-$PROTOC_VERSION-linux-x86_64.zip + RUN set -x \ && apt update \ && apt-get install apt-transport-https \ @@ -20,6 +24,8 @@ RUN set -x \ mscgen \ rsync \ sudo \ + golang \ + unzip \ \ && rm -rf /var/lib/apt/lists/* \ && rustup component add rustfmt \ @@ -28,4 +34,8 @@ RUN set -x \ && cargo install svgbob_cli \ && cargo install mdbook \ && rustc --version \ - && cargo --version + && cargo --version \ + && curl -OL https://github.com/google/protobuf/releases/download/v$PROTOC_VERSION/$PROTOC_ZIP \ + && unzip -o $PROTOC_ZIP -d /usr/local bin/protoc \ + && unzip -o $PROTOC_ZIP -d /usr/local include/* \ + && rm -f $PROTOC_ZIP diff --git a/ci/test-bench.sh b/ci/test-bench.sh index 7763c4b7f97145..f292dc149636a0 100755 --- a/ci/test-bench.sh +++ b/ci/test-bench.sh @@ -67,7 +67,6 @@ _ cargo +$rust_nightly bench --manifest-path programs/bpf/Cargo.toml ${V:+--verb -- -Z unstable-options --format=json --nocapture | tee -a "$BENCH_FILE" # Run Move tests -scripts/dev_setup.sh _ cargo +"$rust_nightly" test --manifest-path=programs/move_loader_program/Cargo.toml ${V:+--verbose} # TODO: debug why solana-upload-perf takes over 30 minutes to complete. diff --git a/scripts/dev_setup.sh b/scripts/dev_setup.sh deleted file mode 100755 index 58b10fb6196539..00000000000000 --- a/scripts/dev_setup.sh +++ /dev/null @@ -1,123 +0,0 @@ -#!/bin/bash -# This script sets up the environment for the Libra build by installing necessary dependencies. -# -# Usage ./dev_setup.sh -# v - verbose, print all statements - -SCRIPT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -cd "$SCRIPT_PATH/.." - -set -e -OPTIONS="$1" - -if [[ $OPTIONS == *"v"* ]]; then - set -x -fi - -if [ ! -f Cargo.toml ]; then - echo "Unknown location. Please run this from the libra repository. Abort." - exit 1 -fi - -PACKAGE_MANAGER= -if [[ "$OSTYPE" == "linux-gnu" ]]; then - if command -v yum &>/dev/null; then - PACKAGE_MANAGER="yum" - elif command -v apt-get &>/dev/null; then - PACKAGE_MANAGER="apt-get" - elif command -v pacman &>/dev/null; then - PACKAGE_MANAGER="pacman" - else - echo "Unable to find supported package manager (yum, apt-get, or pacman). Abort" - exit 1 - fi -elif [[ "$OSTYPE" == "darwin"* ]]; then - if command -v brew &>/dev/null; then - PACKAGE_MANAGER="brew" - else - echo "Missing package manager Homebrew (https://brew.sh/). Abort" - exit 1 - fi -else - echo "Unknown OS. Abort." - exit 1 -fi - -cat </dev/null; then - echo "CMake is already installed" -else - if [[ "$PACKAGE_MANAGER" == "yum" ]]; then - sudo yum install cmake -y - elif [[ "$PACKAGE_MANAGER" == "apt-get" ]]; then - sudo apt-get install cmake -y - elif [[ "$PACKAGE_MANAGER" == "pacman" ]]; then - sudo pacman -Syu cmake --noconfirm - elif [[ "$PACKAGE_MANAGER" == "brew" ]]; then - brew install cmake - fi -fi - -echo "Installing Go......" -if command -v go &>/dev/null; then - echo "Go is already installed" -else - if [[ "$PACKAGE_MANAGER" == "yum" ]]; then - sudo yum install golang -y - elif [[ "$PACKAGE_MANAGER" == "apt-get" ]]; then - sudo apt-get install golang -y - elif [[ "$PACKAGE_MANAGER" == "pacman" ]]; then - sudo pacman -Syu go --noconfirm - elif [[ "$PACKAGE_MANAGER" == "brew" ]]; then - brew install go - fi -fi - -echo "Installing Protobuf......" -if command -v protoc &>/dev/null; then - echo "Protobuf is already installed" -else - if [[ "$OSTYPE" == "linux-gnu" ]]; then - if ! command -v unzip &>/dev/null; then - echo "Installing unzip......" - if [[ "$PACKAGE_MANAGER" == "yum" ]]; then - sudo yum install unzip -y - elif [[ "$PACKAGE_MANAGER" == "apt-get" ]]; then - sudo apt-get install unzip -y - elif [[ "$PACKAGE_MANAGER" == "pacman" ]]; then - sudo pacman -Syu unzip --noconfirm - fi - fi - PROTOC_VERSION=3.8.0 - PROTOC_ZIP=protoc-$PROTOC_VERSION-linux-x86_64.zip - curl -OL https://github.com/google/protobuf/releases/download/v$PROTOC_VERSION/$PROTOC_ZIP - sudo unzip -o $PROTOC_ZIP -d /usr/local bin/protoc - sudo unzip -o $PROTOC_ZIP -d /usr/local include/* - rm -f $PROTOC_ZIP - echo "protoc is installed to /usr/local/bin/" - else - brew install protobuf - fi -fi - -cat <