Skip to content

Commit 6f59e22

Browse files
authored
Merge pull request #12583 from ethereum/update-solcjs-commands-for-typescript
Compatibility fixes for solc-js TypeScript migration
2 parents 2725788 + f46e333 commit 6f59e22

File tree

7 files changed

+17
-5
lines changed

7 files changed

+17
-5
lines changed

Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Bugfixes:
2323

2424
Solc-Js:
2525
* The wrapper now requires at least nodejs v10.
26+
* The code has been ported to TypeScript.
2627

2728

2829
### 0.8.11 (2021-12-20)

ReleaseChecklist.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
### Release solc-js
6767
- [ ] Wait until solc-bin was properly deployed. You can test this via remix - a test run through remix is advisable anyway.
6868
- [ ] Increment the version number, create a pull request for that, merge it after tests succeeded.
69-
- [ ] Run ``node verifyVersion.js && npm publish`` in the updated ``solc-js`` repository.
69+
- [ ] Run ``npm run updateBinary && npm publish`` in the updated ``solc-js`` repository.
7070
- [ ] Create a tag using ``git tag --annotate v$VERSION`` and push it with ``git push --tags``.
7171
7272
### Post-release

scripts/bytecodecompare/prepare_report.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
const process = require('process')
33
const fs = require('fs')
44

5-
const compiler = require('./solc-js/wrapper.js')(require('./solc-js/soljson.js'))
5+
const compiler = require('solc')
66

77

88
function loadSource(sourceFileName, stripSMTPragmas)

scripts/bytecodecompare/storebytecode.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,18 @@ TMPDIR=$(mktemp -d)
4242

4343
if [[ "$SOLC_EMSCRIPTEN" = "On" ]]
4444
then
45+
echo "Installing solc-js..."
4546
# npm install solc
4647
git clone --depth 1 https://github.com/ethereum/solc-js.git solc-js
47-
( cd solc-js; npm install )
4848
cp "$REPO_ROOT/emscripten_build/libsolc/soljson.js" solc-js/
49+
pushd solc-js/
50+
npm install
51+
npm run build
52+
popd
53+
4954
cp "$REPO_ROOT/scripts/bytecodecompare/prepare_report.js" .
55+
npm install solc-js/
56+
5057
echo "Running the compiler..."
5158
# shellcheck disable=SC2035
5259
./prepare_report.js *.sol > report.txt

scripts/solc-bin/bytecode_reports_for_modified_binaries.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ cd "$tmp_dir"
109109
git clone https://github.com/ethereum/solc-js.git "$solcjs_dir"
110110
cd "$solcjs_dir"
111111
npm install
112+
npm run build
112113

113114
cd "${solc_bin_dir}/${platform}/"
114115
echo "Commit range: ${base_ref}..${top_ref}"
@@ -147,11 +148,12 @@ for binary_name in $platform_binaries; do
147148

148149
if [[ $platform == emscripten-wasm32 ]] || [[ $platform == emscripten-asmjs ]]; then
149150
ln -sf "${solc_bin_dir}/${platform}/${binary_name}" "${solcjs_dir}/soljson.js"
151+
ln -sf "${solc_bin_dir}/${platform}/${binary_name}" "${solcjs_dir}/dist/soljson.js"
150152
ln -s "${solcjs_dir}" solc-js
151153
cp "${script_dir}/bytecodecompare/prepare_report.js" prepare_report.js
152154

153155
validate_reported_version \
154-
"$(solc-js/solc.js --version)" \
156+
"$(solc-js/dist/solc.js --version)" \
155157
"$solidity_version_and_commit"
156158

157159
# shellcheck disable=SC2035

scripts/wasm-rebuild/docker-scripts/rebuild_tags.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ mkdir -p "${OUTPUTDIR}"/bin
228228
echo "Prepare solc-js."
229229
cd /root/solc-js
230230
npm install >/dev/null 2>&1
231+
npm run build >/dev/null 2>&1
231232

232233
echo "Install semver helper."
233234
npm install -g semver >/dev/null 2>&1

test/externalTests/common.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ function setup_solc
8484
pushd "$install_dir"
8585
npm install
8686
cp "$binary_path" soljson.js
87-
SOLCVERSION=$(./solc.js --version)
87+
npm run build
88+
SOLCVERSION=$(dist/solc.js --version)
8889
popd
8990
else
9091
printLog "Setting up solc..."

0 commit comments

Comments
 (0)