Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Various improvements from pull/7458 #7476

Merged
merged 12 commits into from
Jun 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 2 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ project( EOSIO )
include(CTest) # suppresses DartConfiguration.tcl error
enable_testing()

if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
elseif ("${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr/local")
message(WARNING "CMAKE_INSTALL_PREFIX is explicitly set to /usr/local. This is not recommended.")
if ("${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr/local")
message(WARNING "CMAKE_INSTALL_PREFIX is set to /usr/local. This is not recommended.")
endif()

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules")
Expand Down
20 changes: 10 additions & 10 deletions pipeline.jsonc
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"eosio-base-images":
{
"pipeline-branch": "develop"
},
"eosio-lrt":
{
"environment":
{
"BUILD_FLAGS": "-y -P -m",
"IMAGE_TAG": "_1-8-0-rc2"
"eosio": {
"environment": {
"IMAGE_TAG": "1.9.0-develop",
"HELPER_ENABLED": true
}
},
"eosio-build-unpinned": {
"pipeline-branch": "protocol-features-sync-nodes"
},
"eosio-lrt": {
"pipeline-branch": "protocol-features-sync-nodes"
},
"eos-multiversion-tests":
{
"environment":
Expand Down
15 changes: 10 additions & 5 deletions scripts/.environment
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@ export SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export REPO_ROOT="${SCRIPT_DIR}/.."
export BUILD_DIR="${REPO_ROOT}/build"

export EOSIO_VERSION_MAJOR=$(cat $REPO_ROOT/CMakeLists.txt | grep -E "set\([ +]?VERSION_MAJOR" | sed 's/set(.*VERSION_MAJOR //g' | sed 's/ //g' | cut -d\) -f1)
export EOSIO_VERSION_MINOR=$(cat $REPO_ROOT/CMakeLists.txt | grep -E "set\([ +]?VERSION_MINOR" | sed 's/set(.*VERSION_MINOR //g' | sed 's/ //g' | cut -d\) -f1)
export EOSIO_VERSION_PATCH=$(cat $REPO_ROOT/CMakeLists.txt | grep -E "set\([ +]?VERSION_PATCH" | sed 's/set(.*VERSION_PATCH //g' | sed 's/ //g' | cut -d\) -f1)
export EOSIO_VERSION_SUFFIX=$(cat $REPO_ROOT/CMakeLists.txt | grep -E "set\([ +]?VERSION_SUFFIX" | sed 's/set(.*VERSION_SUFFIX //g' | sed 's/ //g' | cut -d\) -f1)
export EOSIO_VERSION="${EOSIO_VERSION_MAJOR}.${EOSIO_VERSION_MINOR}.${EOSIO_VERSION_PATCH}-${EOSIO_VERSION_SUFFIX}"
export EOSIO_VERSION_MAJOR=$(cat $REPO_ROOT/CMakeLists.txt | grep -E "^[[:blank:]]*set[[:blank:]]*\([[:blank:]]*VERSION_MAJOR" | tail -1 | sed 's/.*VERSION_MAJOR //g' | sed 's/ //g' | cut -d\) -f1)
export EOSIO_VERSION_MINOR=$(cat $REPO_ROOT/CMakeLists.txt | grep -E "^[[:blank:]]*set[[:blank:]]*\([[:blank:]]*VERSION_MINOR" | tail -1 | sed 's/.*VERSION_MINOR //g' | sed 's/ //g' | cut -d\) -f1)
export EOSIO_VERSION_PATCH=$(cat $REPO_ROOT/CMakeLists.txt | grep -E "^[[:blank:]]*set[[:blank:]]*\([[:blank:]]*VERSION_PATCH" | tail -1 | sed 's/.*VERSION_PATCH //g' | sed 's/ //g' | cut -d\) -f1)
export EOSIO_VERSION_SUFFIX=$(cat $REPO_ROOT/CMakeLists.txt | grep -E "^[[:blank:]]*set[[:blank:]]*\([[:blank:]]*VERSION_SUFFIX" | tail -1 | sed 's/.*VERSION_SUFFIX //g' | sed 's/ //g' | cut -d\) -f1)
export EOSIO_VERSION="${EOSIO_VERSION_MAJOR}.${EOSIO_VERSION_MINOR}"
if [[ -z $EOSIO_VERSION_SUFFIX ]]; then
export EOSIO_VERSION_FULL="${EOSIO_VERSION_MAJOR}.${EOSIO_VERSION_MINOR}.${EOSIO_VERSION_PATCH}"
else
export EOSIO_VERSION_FULL="${EOSIO_VERSION_MAJOR}.${EOSIO_VERSION_MINOR}.${EOSIO_VERSION_PATCH}-${EOSIO_VERSION_SUFFIX}"
fi

export INSTALL_LOCATION=${INSTALL_LOCATION:-$HOME}
export EOSIO_INSTALL_DIR="${INSTALL_LOCATION}/eosio/${EOSIO_VERSION}"
Expand Down
21 changes: 12 additions & 9 deletions scripts/eosio_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ function usage() {
-y Noninteractive mode (answers yes to every prompt)
-c Enable Code Coverage
-d Generate Doxygen
-m Build MongoDB dependencies
\\n" "$0" 1>&2
exit 1
}
Expand Down Expand Up @@ -110,14 +111,14 @@ fi
# Load eosio specific helper functions
. ./scripts/helpers/eosio.sh

echo "Beginning build version: ${SCRIPT_VERSION}"
echo "EOSIO version to install: ${EOSIO_VERSION}"
$VERBOSE && echo "Build Script Version: ${SCRIPT_VERSION}"
echo "EOSIO Version: ${EOSIO_VERSION_FULL}"
echo "$( date -u )"
echo "User: ${CURRENT_USER}"
# echo "git head id: %s" "$( cat .git/refs/heads/master )"
echo "Current branch: $( execute git rev-parse --abbrev-ref HEAD 2>/dev/null )"

[[ ! $NAME == "Ubuntu" ]] && set -i # Ubuntu doesn't support interactive mode since it uses dash
( [[ ! $NAME == "Ubuntu" ]] && [[ ! $ARCH == "Darwin" ]] ) && set -i # Ubuntu doesn't support interactive mode since it uses dash + Some folks are having this issue on Darwin; colors aren't supported yet anyway

# Ensure sudo is available (only if not using the root user)
ensure-sudo
Expand All @@ -137,6 +138,9 @@ execute cd $REPO_ROOT
# Submodules need to be up to date
ensure-submodules-up-to-date

# Check if cmake already exists
( [[ -z "${CMAKE}" ]] && [[ ! -z $(command -v cmake 2>/dev/null) ]] ) && export CMAKE=$(command -v cmake 2>/dev/null)

# Use existing cmake on system (either global or specific to eosio)
# Setup based on architecture
if [[ $ARCH == "Linux" ]]; then
Expand All @@ -156,20 +160,18 @@ if [[ $ARCH == "Linux" ]]; then
;;
*) print_supported_linux_distros_and_exit;;
esac
LOCAL_CMAKE_FLAGS="-DCMAKE_PREFIX_PATH='$EOSIO_INSTALL_DIR' ${LOCAL_CMAKE_FLAGS}"
CMAKE_PREFIX_PATHS="${EOSIO_INSTALL_DIR}"
fi

if [ "$ARCH" == "Darwin" ]; then
# opt/gettext: cleos requires Intl, which requires gettext; it's keg only though and we don't want to force linking: https://github.com/EOSIO/eos/issues/2240#issuecomment-396309884
# EOSIO_INSTALL_DIR/lib/cmake: mongo_db_plugin.cpp:25:10: fatal error: 'bsoncxx/builder/basic/kvp.hpp' file not found
LOCAL_CMAKE_FLAGS="-DCMAKE_PREFIX_PATH='/usr/local/opt/gettext;$EOSIO_INSTALL_DIR' ${LOCAL_CMAKE_FLAGS}"
CMAKE_PREFIX_PATHS="/usr/local/opt/gettext;${EOSIO_INSTALL_DIR}"
FILE="${SCRIPT_DIR}/eosio_build_darwin.sh"
OPENSSL_ROOT_DIR=/usr/local/opt/openssl
export CMAKE=${CMAKE}
fi

( [[ -z "${CMAKE}" ]] && [[ ! -z $(command -v cmake 2>/dev/null) ]] ) && export CMAKE=$(command -v cmake 2>/dev/null)

# Find and replace OPT_DIR in pinned_toolchain.cmake, then move it into build dir
execute bash -c "sed -e 's~@~$OPT_DIR~g' $SCRIPT_DIR/pinned_toolchain.cmake &> $BUILD_DIR/pinned_toolchain.cmake"

Expand All @@ -192,9 +194,10 @@ execute cd $BUILD_DIR
# LOCAL_CMAKE_FLAGS
$ENABLE_MONGO && LOCAL_CMAKE_FLAGS="-DBUILD_MONGO_DB_PLUGIN=true ${LOCAL_CMAKE_FLAGS}" # Enable Mongo DB Plugin if user has enabled -m
if $PIN_COMPILER; then
LOCAL_CMAKE_FLAGS="${PINNED_TOOLCHAIN} -DCMAKE_PREFIX_PATH='${LLVM_ROOT}' ${LOCAL_CMAKE_FLAGS}"
CMAKE_PREFIX_PATHS="${CMAKE_PREFIX_PATHS};${LLVM_ROOT}"
LOCAL_CMAKE_FLAGS="${PINNED_TOOLCHAIN} -DCMAKE_PREFIX_PATH='${CMAKE_PREFIX_PATHS}' ${LOCAL_CMAKE_FLAGS}"
else
LOCAL_CMAKE_FLAGS="-DCMAKE_CXX_COMPILER='${CXX}' -DCMAKE_C_COMPILER='${CC}' ${LOCAL_CMAKE_FLAGS}"
LOCAL_CMAKE_FLAGS="-DCMAKE_CXX_COMPILER='${CXX}' -DCMAKE_C_COMPILER='${CC}' -DCMAKE_PREFIX_PATH='${CMAKE_PREFIX_PATHS}' ${LOCAL_CMAKE_FLAGS}"
fi
$ENABLE_DOXYGEN && LOCAL_CMAKE_FLAGS="-DBUILD_DOXYGEN='${DOXYGEN}' ${LOCAL_CMAKE_FLAGS}"
$ENABLE_COVERAGE_TESTING && LOCAL_CMAKE_FLAGS="-DENABLE_COVERAGE_TESTING='${ENABLE_COVERAGE_TESTING}' ${LOCAL_CMAKE_FLAGS}"
Expand Down
1 change: 0 additions & 1 deletion scripts/eosio_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ VERSION=2.0
echo "${COLOR_CYAN}====================================================================================="
echo "========================== ${COLOR_WHITE}Starting EOSIO Installation${COLOR_CYAN} ==============================${COLOR_NC}"
execute cd $BUILD_DIR
CMAKE_INSTALL_PREFIX=$(grep ^CMAKE_INSTALL_PREFIX: CMakeCache.txt | sed 's/.*=//')
execute make install
execute cd ..

Expand Down
50 changes: 4 additions & 46 deletions scripts/eosio_uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,7 @@ usage() {
\\n" "$0"
}

INSTALL_PATHS=(
$HOME/bin/eosio-launcher
$HOME/lib/cmake/eosios
$HOME/opt/llvm*
$HOME/opt/boost
$HOME/src/boost_*
$HOME/src/cmake-*
$HOME/share/cmake-*
$HOME/share/aclocal/cmake*
$HOME/doc/cmake*
$HOME/bin/nodeos
$HOME/bin/keosd
$HOME/bin/cleos
$HOME/bin/ctest
$HOME/bin/*cmake*
$HOME/bin/cpack
$HOME/src/mongo*
$HOME/opt/mongo*
$HOME/bin/mongo*
$HOME/lib/cmake
$HOME/lib/libbson*
$HOME/lib/libmongo*
$HOME/lib/pkgconfig
$HOME/include/bsoncxx*
$HOME/include/libbson*
$HOME/include/libmongo*
$HOME/include/mongocxx*
$HOME/share/mongo*
)
INSTALL_PATHS=()

# User input handling
PROCEED=false
Expand Down Expand Up @@ -72,13 +44,10 @@ if [[ $@ =~ [[:space:]]?--full[[:space:]]? ]]; then
fi
if [[ ! -z $@ ]] && [[ ! $@ =~ [[:space:]]?--force[[:space:]]? ]] && [[ ! $@ =~ [[:space:]]?--full[[:space:]]? ]]; then usage && exit; fi

# If eosio folder exist, add it to the INSTALL_PATHS for deletion
[[ -d "${HOME}/opt/eosio" ]] && INSTALL_PATHS+=("$HOME/opt/eosio")
# As of 1.8.0, we're using a versioned directories under home: https://github.com/EOSIO/eos/issues/6940
[[ -d "${EOSIO_INSTALL_DIR}" ]] && INSTALL_PATHS+=("${EOSIO_INSTALL_DIR}") # EOSIO_INSTALL_DIR set in .environment
[[ -d "${EOSIO_INSTALL_DIR}" ]] && echo "[EOSIO Installation Found: ${EOSIO_INSTALL_DIR}]" && INSTALL_PATHS+=("${EOSIO_INSTALL_DIR}") # EOSIO_INSTALL_DIR set in .environment

# Removal
[[ ! -z "${EOSIO_LOCATION}" ]] && printf "[EOSIO Installation Found: ${EOSIO_LOCATION}]\n"
while true; do
[[ $FORCED == false ]] && read -p "Do you wish to remove the installation? (y/n) " PROCEED
case $PROCEED in
Expand All @@ -104,25 +73,14 @@ while true; do
# Handle cleanup of data directory
if $FULL; then
## Add both just to be safe
INSTALL_PATHS+=("${HOME}/Library/Application\ Support/eosio")
INSTALL_PATHS+=("${HOME}/.local/share/eosio")
[[ $ARCH == "Darwin" ]] && INSTALL_PATHS+=("${HOME}/Library/Application\ Support/eosio")
[[ $ARCH != "Darwin" ]] && INSTALL_PATHS+=("${HOME}/.local/share/eosio")
fi
# Version < 1.8.0; Before we started using ~/eosio/1.8.x
# Arrays should return with newlines (IFS=\n;helpers.sh) as Application\ Support will split into two
for INSTALL_PATH in ${INSTALL_PATHS[@]}; do
execute rm -rf $INSTALL_PATH
done
# Cleanup directories if they're empty (else the user had the directory there already for a reason)
execute rmdir $HOME/src 2>/dev/null
execute rmdir $HOME/opt 2>/dev/null
execute rmdir $HOME/var/log/mongodb 2>/dev/null
execute rmdir $HOME/var/log 2>/dev/null
execute rmdir $HOME/var 2>/dev/null
execute rmdir $HOME/bin 2>/dev/null
execute rmdir $HOME/etc 2>/dev/null
execute rmdir $HOME/lib 2>/dev/null
execute rmdir $HOME/data/mongodb 2>/dev/null
execute rmdir $HOME/data 2>/dev/null
echo "[EOSIO Removal Complete]"
break;;
1 | false | [Nn]* ) echo " - Cancelled EOSIO Removal!"; exit 1;;
Expand Down
3 changes: 2 additions & 1 deletion scripts/generate_bottle.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#! /bin/bash
#!/usr/bin/env bash
set -eo pipefail

VERS=`sw_vers -productVersion | awk '/10\.13\..*/{print $0}'`
if [[ -z "$VERS" ]];
Expand Down
3 changes: 2 additions & 1 deletion scripts/generate_deb.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#! /bin/bash
#!/usr/bin/env bash
set -eo pipefail

PREFIX="usr"
SPREFIX=${PREFIX}
Expand Down
3 changes: 2 additions & 1 deletion scripts/generate_package.sh.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#! /bin/bash
#!/usr/bin/env bash
set -eo pipefail

VARIANT=$1

Expand Down
3 changes: 2 additions & 1 deletion scripts/generate_rpm.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#! /bin/bash
#!/usr/bin/env bash
set -eo pipefail

PREFIX="usr"
SPREFIX=${PREFIX}
Expand Down
3 changes: 2 additions & 1 deletion scripts/generate_tarball.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#! /bin/bash
#!/usr/bin/env bash
set -eo pipefail

NAME=$1
EOS_PREFIX=${PREFIX}/${SUBPREFIX}
Expand Down