Merge pull request #7917 from ethereum/solc-backwards-compat

Add backwards compatibility to the generated soljson.js for solc-js <0.5.14
This commit is contained in:
chriseth 2019-12-09 14:41:56 +01:00 committed by GitHub
commit e075b10db6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 3 deletions

View File

@ -94,6 +94,9 @@ make -j 4
cd ..
mkdir -p upload
# Patch soljson.js to provide backwards-compatibility with older emscripten versions
# TODO: remove in 0.6.0!
echo -n ";/* backwards compatibility */ Module['Runtime'] = Module; Module['Pointer_stringify'] = Module['UTF8ToString'];" >> $BUILD_DIR/libsolc/soljson.js
cp $BUILD_DIR/libsolc/soljson.js upload/
cp $BUILD_DIR/libsolc/soljson.js ./

View File

@ -37,7 +37,7 @@ function setup_solcjs
cd "$dir"
printLog "Setting up solc-js..."
git clone --depth 1 -b master https://github.com/ethereum/solc-js.git solc
git clone --depth 1 -b v0.5.0 https://github.com/ethereum/solc-js.git solc
cd solc
npm install
@ -107,7 +107,7 @@ function force_solc_truffle_modules
if [ -d "$d" ]; then
cd $d
rm -rf solc
git clone --depth 1 -b master https://github.com/ethereum/solc-js.git solc
git clone --depth 1 -b v0.5.0 https://github.com/ethereum/solc-js.git solc
cp "$1" solc/soljson.js
fi
)

View File

@ -40,7 +40,7 @@ VERSION="$2"
DIR=$(mktemp -d)
(
echo "Preparing solc-js (master)..."
git clone --depth 1 --branch master https://github.com/ethereum/solc-js "$DIR"
git clone --depth 1 --branch v0.5.0 https://github.com/ethereum/solc-js "$DIR"
cd "$DIR"
# disable "prepublish" script which downloads the latest version
# (we will replace it anyway and it is often incorrectly cached