Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Error when compiling if contracts folder does not exist #1068

Closed
spalladino opened this issue Jul 2, 2019 · 0 comments · Fixed by #1107
Closed

Error when compiling if contracts folder does not exist #1068

spalladino opened this issue Jul 2, 2019 · 0 comments · Fixed by #1107
Assignees
Labels
kind:bug topic:compiler Solidity compiler in CLI

Comments

@spalladino
Copy link
Contributor

When attempting to zos compile, if the contracts folder does not exist, the CLI throws the following error:

[2019-07-02T21:54:[email protected]#call] <started> Error: ENOENT: no such file or directory, scandir '/home/jota/work/zeppelin/samples/zos-sample/contracts'
    at Object.fs.readdirSync (fs.js:904:18)
    at SolidityProjectCompiler._loadSoliditySourcesFromDir (/home/jota/work/zeppelin/samples/zos-sample/node_modules/zos/lib/models/compiler/solidity/SolidityProjectCompiler.js:71:14)
    at SolidityProjectCompiler.<anonymous> (/home/jota/work/zeppelin/samples/zos-sample/node_modules/zos/lib/models/compiler/solidity/SolidityProjectCompiler.js:52:24)
    at Generator.next (<anonymous>)
    at /home/jota/work/zeppelin/samples/zos-sample/node_modules/zos/lib/models/compiler/solidity/SolidityProjectCompiler.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (/home/jota/work/zeppelin/samples/zos-sample/node_modules/zos/lib/models/compiler/solidity/SolidityProjectCompiler.js:3:12)
    at SolidityProjectCompiler.call (/home/jota/work/zeppelin/samples/zos-sample/node_modules/zos/lib/models/compiler/solidity/SolidityProjectCompiler.js:51:16)
    at Object.<anonymous> (/home/jota/work/zeppelin/samples/zos-sample/node_modules/zos/lib/models/compiler/solidity/SolidityProjectCompiler.js:33:31)
    at Generator.next (<anonymous>)
    at /home/jota/work/zeppelin/samples/zos-sample/node_modules/zos/lib/models/compiler/solidity/SolidityProjectCompiler.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (/home/jota/work/zeppelin/samples/zos-sample/node_modules/zos/lib/models/compiler/solidity/SolidityProjectCompiler.js:3:12)
    at Object.compileProject (/home/jota/work/zeppelin/samples/zos-sample/node_modules/zos/lib/models/compiler/solidity/SolidityProjectCompiler.js:29:12)
    at /home/jota/work/zeppelin/samples/zos-sample/node_modules/zos/lib/models/compiler/Compiler.js:60:42
    at Generator.next (<anonymous>)
    at /home/jota/work/zeppelin/samples/zos-sample/node_modules/zos/lib/models/compiler/Compiler.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (/home/jota/work/zeppelin/samples/zos-sample/node_modules/zos/lib/models/compiler/Compiler.js:3:12)
    at compileWithSolc (/home/jota/work/zeppelin/samples/zos-sample/node_modules/zos/lib/models/compiler/Compiler.js:59:12)
    at Object.<anonymous> (/home/jota/work/zeppelin/samples/zos-sample/node_modules/zos/lib/models/compiler/Compiler.js:42:15)
    at Generator.next (<anonymous>)
@spalladino spalladino added kind:bug topic:compiler Solidity compiler in CLI labels Jul 2, 2019
@spalladino spalladino self-assigned this Jul 16, 2019
spalladino added a commit that referenced this issue Jul 16, 2019
jbcarpanelli pushed a commit that referenced this issue Jul 18, 2019
* Do not fail if contracts folder is missing (#1107)

Fixes #1068

* Handle incorrect keys to loggy (#1112)

* Handle incorrect keys to loggy

When calling Loggy.success with a non-existing key, the reference would not be found, and the call to path.basename in Loggy._log would fail (since its parameter was null). This commit:

- Catches any exceptions in _log, and displays an error (allowing to continue)
- Adds a testing mode to the logger, which is silent but executes logic, and throws an exception upon issues (only to be used in the CLI and lib tests)
- Fixes incorrect or missing keys in calls to the logger

* Remove failing test

* Use require.resolve to lookup contracts in deps (#1110)

* Use chai expect throw syntax in Dependency tests

* Use require.resolve to lookup contracts in deps

Change lookup in both Dependency and Contracts classes. Instead of looking for just node_modules in the current folder, it uses require.resolve (relative to the current workdir) to look for the dependency.

Fixes #1076

* Fix tests

* Add changelogs

* Reset circle cache
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind:bug topic:compiler Solidity compiler in CLI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant