Merge pull request #10361 from ethereum/bytecode-comparison-build-dir-outside-repo-root

Allow BUILD_DIR outside of REPO_ROOT in storebytecode.sh
This commit is contained in:
chriseth 2020-11-24 14:48:22 +01:00 committed by GitHub
commit 36f9392154
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,18 +28,14 @@
set -e
REPO_ROOT="$(dirname "$0")"/../..
cd "$REPO_ROOT"
REPO_ROOT=$(pwd) # make it absolute
if test -z "$1"; then
BUILD_DIR="build"
else
BUILD_DIR="$1"
fi
BUILD_DIR="${1:-${REPO_ROOT}/build}"
echo "Compiling all test contracts into bytecode..."
TMPDIR=$(mktemp -d)
(
cd "$REPO_ROOT"
REPO_ROOT=$(pwd) # make it absolute
cd "$TMPDIR"
"$REPO_ROOT"/scripts/isolate_tests.py "$REPO_ROOT"/test/
@ -108,10 +104,10 @@ EOF
./solc *.sol > report.txt
echo "Finished running the compiler."
else
$REPO_ROOT/scripts/bytecodecompare/prepare_report.py $REPO_ROOT/$BUILD_DIR/solc/solc
"$REPO_ROOT/scripts/bytecodecompare/prepare_report.py" "$BUILD_DIR/solc/solc"
fi
cp report.txt $REPO_ROOT
cp report.txt "$REPO_ROOT"
)
rm -rf "$TMPDIR"
echo "Storebytecode finished."