net: net.sh - Enable deploying testnets on debug binaries (#5627)

automerge
This commit is contained in:
Trent Nelson 2019-08-23 19:31:18 -06:00 committed by Grimes
parent 881a6dc0f7
commit 6bb22902cc
2 changed files with 23 additions and 4 deletions

View File

@ -39,6 +39,7 @@ Operate a configured testnet
(ignored if -s or -S is specified)
-r - Reuse existing node/ledger configuration from a
previous |start| (ie, don't run ./multinode-demo/setup.sh).
-d / --debug - Build/deploy the testnet with debug binaries
-D /path/to/programs - Deploy custom programs from this location
-c clientType=numClients=extraArgs - Number of clientTypes to start. This options can be specified
more than once. Defaults to bench-tps for all clients if not
@ -122,6 +123,8 @@ internalNodesLamports=
maybeNoSnapshot=""
maybeSkipLedgerVerify=""
maybeDisableAirdrops=""
buildProfile="--release"
debugBuild=false
command=$1
[[ -n $command ]] || usage
@ -164,6 +167,9 @@ while [[ -n $1 ]]; do
elif [[ $1 = --no-airdrop ]]; then
maybeDisableAirdrops="$1"
shift 1
elif [[ $1 = --debug ]]; then
debugBuild=true
shift 1
else
usage "Unknown long option: $1"
fi
@ -173,7 +179,7 @@ while [[ -n $1 ]]; do
fi
done
while getopts "h?T:t:o:f:rD:c:Fn:i:" opt "${shortArgs[@]}"; do
while getopts "h?T:t:o:f:rD:c:Fn:i:d" opt "${shortArgs[@]}"; do
case $opt in
h | \?)
usage
@ -255,12 +261,17 @@ while getopts "h?T:t:o:f:rD:c:Fn:i:" opt "${shortArgs[@]}"; do
i)
nodeAddress=$OPTARG
;;
d)
debugBuild=true
;;
*)
usage "Error: unhandled option: $opt"
;;
esac
done
$debugBuild && buildProfile=""
loadConfigFile
if [[ -n $numFullnodesRequested ]]; then
@ -317,7 +328,7 @@ build() {
fi
$MAYBE_DOCKER bash -c "
set -ex
scripts/cargo-install-all.sh farf \"$cargoFeatures\"
scripts/cargo-install-all.sh farf \"$cargoFeatures\" \"$buildProfile\"
if [[ -n \"$customPrograms\" ]]; then
scripts/cargo-install-custom-programs.sh farf $customPrograms
fi

View File

@ -17,6 +17,14 @@ fi
installDir="$(mkdir -p "$1"; cd "$1"; pwd)"
cargoFeatures="$2"
buildProfile="$3"
if [[ -n "$buildProfile" ]]; then
binTargetDir="release"
else
binTargetDir="debug"
fi
echo "Install location: $installDir"
cd "$(dirname "$0")"/..
@ -26,7 +34,7 @@ SECONDS=0
(
set -x
# shellcheck disable=SC2086 # Don't want to double quote $rust_version
cargo $rust_version build --all --release --features="$cargoFeatures"
cargo $rust_version build --all $buildProfile --features="$cargoFeatures"
)
BIN_CRATES=(
@ -53,7 +61,7 @@ for crate in "${BIN_CRATES[@]}"; do
done
for dir in programs/*; do
for program in echo target/release/deps/libsolana_"$(basename "$dir")".{so,dylib,dll}; do
for program in echo target/$binTargetDir/deps/libsolana_"$(basename "$dir")".{so,dylib,dll}; do
if [[ -f $program ]]; then
mkdir -p "$installDir/bin/deps"
rm -f "$installDir/bin/deps/$(basename "$program")"