From a6868510edd61c7559cdeccb1f2afd3e7cc0eba9 Mon Sep 17 00:00:00 2001 From: chriseth Date: Fri, 4 May 2018 16:35:24 +0200 Subject: [PATCH 1/4] Initial changelog for version 0.5.0. --- Changelog.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Changelog.md b/Changelog.md index 7c4ac9252..03c4e55bb 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,11 @@ +### 0.5.0 (unreleased) + +Features: + + +Bugfixes: + + ### 0.4.24 (unreleased) Features: From ebe8968fae9c06795db060892e57cf639952a90a Mon Sep 17 00:00:00 2001 From: chriseth Date: Fri, 4 May 2018 16:41:48 +0200 Subject: [PATCH 2/4] Add merge blocker. --- circle.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/circle.yml b/circle.yml index e29f3e4ad..057c43af5 100644 --- a/circle.yml +++ b/circle.yml @@ -201,10 +201,19 @@ jobs: path: docs/_build/html/ destination: docs-html + merge_blocker: + docker: + - image: buildpack-deps:artful + steps: + - run: + name: This blocks the merge. Remove when 0.5.0 is to be released. + command: false + workflows: version: 2 build_all: jobs: + - merge_blocker: - build_emscripten: *build_on_tags - test_emscripten_solcjs: <<: *build_on_tags From dc857feb4f1c50516e5a27bff464d0452a2ad1a1 Mon Sep 17 00:00:00 2001 From: chriseth Date: Fri, 4 May 2018 17:07:37 +0200 Subject: [PATCH 3/4] Update circle.yml --- circle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index 057c43af5..93638494d 100644 --- a/circle.yml +++ b/circle.yml @@ -213,7 +213,7 @@ workflows: version: 2 build_all: jobs: - - merge_blocker: + - merge_blocker - build_emscripten: *build_on_tags - test_emscripten_solcjs: <<: *build_on_tags From db5ea8ec0325512af3238918ca0ea297488a5c5d Mon Sep 17 00:00:00 2001 From: Leonardo Alt Date: Tue, 24 Apr 2018 15:18:12 +0200 Subject: [PATCH 4/4] Read from stdin only if - is explicitly given --- solc/CommandLineInterface.cpp | 9 ++++--- test/cmdlineTests.sh | 44 +++++++++++++++++++++++++++++------ 2 files changed, 43 insertions(+), 10 deletions(-) diff --git a/solc/CommandLineInterface.cpp b/solc/CommandLineInterface.cpp index 1f04c68a1..89ac88063 100644 --- a/solc/CommandLineInterface.cpp +++ b/solc/CommandLineInterface.cpp @@ -404,9 +404,7 @@ bool CommandLineInterface::readInputFilesAndConfigureRemappings() { bool ignoreMissing = m_args.count(g_argIgnoreMissingFiles); bool addStdin = false; - if (!m_args.count(g_argInputFile)) - addStdin = true; - else + if (m_args.count(g_argInputFile)) for (string path: m_args[g_argInputFile].as>()) { auto eq = find(path.begin(), path.end(), '='); @@ -450,6 +448,11 @@ bool CommandLineInterface::readInputFilesAndConfigureRemappings() } if (addStdin) m_sourceCodes[g_stdinFileName] = dev::readStandardInput(); + if (m_sourceCodes.size() == 0) + { + cerr << "No input files given. If you wish to use the standard input please specify \"-\" explicity." << endl; + return false; + } return true; } diff --git a/test/cmdlineTests.sh b/test/cmdlineTests.sh index 1137c7b05..74b6a5a7c 100755 --- a/test/cmdlineTests.sh +++ b/test/cmdlineTests.sh @@ -139,25 +139,55 @@ rm -rf "$TMPDIR" echo "Done." printTask "Testing library checksum..." -echo '' | "$SOLC" --link --libraries a:0x90f20564390eAe531E810af625A22f51385Cd222 -! echo '' | "$SOLC" --link --libraries a:0x80f20564390eAe531E810af625A22f51385Cd222 2>/dev/null +echo '' | "$SOLC" - --link --libraries a:0x90f20564390eAe531E810af625A22f51385Cd222 >/dev/null +! echo '' | "$SOLC" - --link --libraries a:0x80f20564390eAe531E810af625A22f51385Cd222 &>/dev/null printTask "Testing long library names..." -echo '' | "$SOLC" --link --libraries aveeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeerylonglibraryname:0x90f20564390eAe531E810af625A22f51385Cd222 +echo '' | "$SOLC" - --link --libraries aveeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeerylonglibraryname:0x90f20564390eAe531E810af625A22f51385Cd222 >/dev/null -printTask "Testing overwriting files" +printTask "Testing overwriting files..." TMPDIR=$(mktemp -d) ( set -e # First time it works - echo 'contract C {} ' | "$SOLC" --bin -o "$TMPDIR/non-existing-stuff-to-create" 2>/dev/null + echo 'contract C {} ' | "$SOLC" - --bin -o "$TMPDIR/non-existing-stuff-to-create" 2>/dev/null # Second time it fails - ! echo 'contract C {} ' | "$SOLC" --bin -o "$TMPDIR/non-existing-stuff-to-create" 2>/dev/null + ! echo 'contract C {} ' | "$SOLC" - --bin -o "$TMPDIR/non-existing-stuff-to-create" 2>/dev/null # Unless we force - echo 'contract C {} ' | "$SOLC" --overwrite --bin -o "$TMPDIR/non-existing-stuff-to-create" 2>/dev/null + echo 'contract C {} ' | "$SOLC" - --overwrite --bin -o "$TMPDIR/non-existing-stuff-to-create" 2>/dev/null ) rm -rf "$TMPDIR" +printTask "Testing assemble, yul, strict-assembly..." +echo '{}' | "$SOLC" - --assemble &>/dev/null +echo '{}' | "$SOLC" - --julia &>/dev/null +echo '{}' | "$SOLC" - --strict-assembly &>/dev/null + +printTask "Testing standard input..." +TMPDIR=$(mktemp -d) +( + set +e + output=$("$SOLC" --bin 2>&1) + result=$? + set -e + + # This should fail + if [[ !("$output" =~ "No input files given") || ($result == 0) ]] ; then + printError "Incorrect response to empty input arg list: $STDERR" + exit 1 + fi + + set +e + output=$(echo 'contract C {} ' | "$SOLC" - --bin 2>/dev/null | grep -q ":C") + result=$? + set -e + + # The contract should be compiled + if [[ "$result" != 0 ]] ; then + exit 1 + fi +) + printTask "Testing soljson via the fuzzer..." TMPDIR=$(mktemp -d) (