Skip to content

Fix the import of tmp in smtsolver.ts #592

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 25, 2022
Merged

Conversation

cameel
Copy link
Member

@cameel cameel commented Jan 25, 2022

Looks like tmp is not being imported correctly. Not sure how that passed tests in #566 but tests are failing due to this in the main repo (ethereum/solidity#12583).

TypeError: Cannot read property 'fileSync' of undefined

In addition to merging this, we should really investigate why it passed our CI.

Steps to reproduce

git clone https://github.com/ethereum/solc-js/
cd solc-js/
npm install
npm run updateBinary
npm run test
# SMTCheckerWithSolver
# Simple test with axuiliaryInputRequested
ok 1108 should be truthy
/tmp/v0.1.1+commit.6ff4cd6.js:84
      throw ex;
      ^

TypeError: Cannot read property 'fileSync' of undefined
    at solve (/tmp/d/solc-js/dist/smtsolver.js:36:35)
    at Object.handleSMTQueries (/tmp/d/solc-js/dist/smtchecker.js:19:28)
    at Test.<anonymous> (/tmp/d/solc-js/dist/test/smtchecker.js:78:47)
    at Test.bound [as _cb] (/tmp/d/solc-js/node_modules/tape/lib/test.js:88:32)
    at Test.run (/tmp/d/solc-js/node_modules/tape/lib/test.js:105:10)
    at Test.bound [as run] (/tmp/d/solc-js/node_modules/tape/lib/test.js:88:32)
    at Test._end (/tmp/d/solc-js/node_modules/tape/lib/test.js:181:11)
    at Test.bound [as _end] (/tmp/d/solc-js/node_modules/tape/lib/test.js:88:32)
    at Immediate.<anonymous> (/tmp/d/solc-js/node_modules/tape/lib/test.js:127:18)
    at processImmediate (internal/timers.js:461:21)

@cameel cameel requested a review from axic January 25, 2022 16:46
@cameel cameel self-assigned this Jan 25, 2022
@cameel
Copy link
Member Author

cameel commented Jan 25, 2022

/cc @stephensli

@cameel
Copy link
Member Author

cameel commented Jan 25, 2022

Haha, looks like we were bitten by #565 (comment) :P

# SMTCheckerWithSolver
# Simple test with axuiliaryInputRequested
ok 1105 Test requires z3. # SKIP

CI skips the test because of the missing Z3.

Copy link
Contributor

@stephen-slm stephen-slm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - Good catch, being bitten by these tests are annoying. I would recommend if possible including z3 in the circleci installation. Allowing for these tests to be included.

@cameel
Copy link
Member Author

cameel commented Jan 25, 2022

Z3 is actually built into the binary and I was assuming CI uses that, which is why I let it through in the PR. Looks like I was wrong. We need to fix that. I'm going to create an issue so that we don't forget.

@cameel cameel merged commit 46c59df into master Jan 25, 2022
@cameel cameel deleted the fix-tmp-import-in-smtsolver branch January 25, 2022 17:27
@@ -1,7 +1,7 @@
import { sync as commandExistsSync } from 'command-exists';
import { execSync } from 'child_process';
import * as fs from 'fs';
import tmp from 'tmp';
import * as tmp from 'tmp';

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants