Merge pull request #6082 from ethereum/emscripten_build_dir

Change emscripten default build dir to "emscriptenBuild"
This commit is contained in:
chriseth 2019-02-27 15:49:35 +01:00 committed by GitHub
commit 4c1b0fbafa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 36 additions and 11 deletions

View File

@ -56,10 +56,10 @@ jobs:
paths:
- boost_1_68_0
- store_artifacts:
path: build/libsolc/soljson.js
path: emscripten_build/libsolc/soljson.js
destination: soljson.js
- run: mkdir -p workspace
- run: cp build/libsolc/soljson.js workspace/soljson.js
- run: cp emscripten_build/libsolc/soljson.js workspace/soljson.js
- run: scripts/get_version.sh > workspace/version.txt
- persist_to_workspace:
root: workspace

1
.gitignore vendored
View File

@ -32,6 +32,7 @@ prerelease.txt
# Build directory
build/
emscripten_build/
docs/_build
docs/utils/__pycache__
docs/utils/*.pyc

View File

@ -28,7 +28,13 @@
set -e
if test -z "$1"; then
BUILD_DIR="emscripten_build"
else
BUILD_DIR="$1"
fi
docker run -v $(pwd):/root/project -w /root/project trzeci/emscripten:sdk-tag-1.38.22-64bit \
./scripts/travis-emscripten/install_deps.sh
docker run -v $(pwd):/root/project -w /root/project trzeci/emscripten:sdk-tag-1.38.22-64bit \
./scripts/travis-emscripten/build_emscripten.sh
./scripts/travis-emscripten/build_emscripten.sh $BUILD_DIR

View File

@ -29,6 +29,12 @@ set -e
REPO_ROOT="$(dirname "$0")"/../..
if test -z "$1"; then
BUILD_DIR="build"
else
BUILD_DIR="$1"
fi
echo "Compiling all test contracts into bytecode..."
TMPDIR=$(mktemp -d)
(
@ -43,7 +49,7 @@ TMPDIR=$(mktemp -d)
# npm install solc
git clone --depth 1 https://github.com/ethereum/solc-js.git solc-js
( cd solc-js; npm install )
cp "$REPO_ROOT/build/libsolc/soljson.js" solc-js/
cp "$REPO_ROOT/emscripten_build/libsolc/soljson.js" solc-js/
cat > solc <<EOF
#!/usr/bin/env node
var process = require('process')
@ -93,7 +99,7 @@ EOF
chmod +x solc
./solc *.sol > report.txt
else
$REPO_ROOT/scripts/bytecodecompare/prepare_report.py $REPO_ROOT/build/solc/solc
$REPO_ROOT/scripts/bytecodecompare/prepare_report.py $REPO_ROOT/$BUILD_DIR/solc/solc
fi
if [ "$TRAVIS_SECURE_ENV_VARS" = "true" ]

View File

@ -28,8 +28,14 @@
set -e
if test -z "$1"; then
BUILD_DIR="emscripten_build"
else
BUILD_DIR="$1"
fi
REPO_ROOT=$(cd $(dirname "$0")/.. && pwd)
SOLJSON="$REPO_ROOT/build/libsolc/soljson.js"
SOLJSON="$REPO_ROOT/$BUILD_DIR/libsolc/soljson.js"
VERSION=$("$REPO_ROOT"/scripts/get_version.sh)
echo "Running solcjs tests...."

View File

@ -34,6 +34,12 @@
set -ev
if test -z "$1"; then
BUILD_DIR="emscripten_build"
else
BUILD_DIR="$1"
fi
if ! type git &>/dev/null; then
# We need git for extracting the commit hash
apt-get update
@ -76,8 +82,8 @@ echo -en 'travis_fold:end:install_cmake.sh\\r'
# Build dependent components and solidity itself
echo -en 'travis_fold:start:compiling_solidity\\r'
cd $WORKSPACE
mkdir -p build
cd build
mkdir -p $BUILD_DIR
cd $BUILD_DIR
cmake \
-DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/emscripten.cmake \
-DCMAKE_BUILD_TYPE=Release \
@ -97,9 +103,9 @@ make -j 4
cd ..
mkdir -p upload
# Patch soljson.js to provide backwards-compatibility with older emscripten versions
echo ";/* backwards compatibility */ Module['Runtime'] = Module;" >> build/libsolc/soljson.js
cp build/libsolc/soljson.js upload/
cp build/libsolc/soljson.js ./
echo ";/* backwards compatibility */ Module['Runtime'] = Module;" >> $BUILD_DIR/libsolc/soljson.js
cp $BUILD_DIR/libsolc/soljson.js upload/
cp $BUILD_DIR/libsolc/soljson.js ./
OUTPUT_SIZE=`ls -la soljson.js`