Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(@embark/solidity): ensure SolidityProcess receives proper Logger …
…instance Prior to this commit Embark had a bug where, when running `$ embark run` inside an Embark project that was freshly cloned or reset, it'd get stuck at loading the Solidity compiler. However, this only seemed to happen when Embark was used with its dashboard. When running ``` $ embark run --nodashboard ``` instead, Embark loaded Solidity successfully and moved on with compilation. This bug pretty much boiled down to `SolidityProcess` not receiving a valid `Logger` dependency when instantiated via `SolcW`. The reason this was happening is that we were sending the needed dependencies via `ProcessLauncher.send()`, which serializes/deserializes its sent data. ``` solidityProcessLauncher.send({action: 'init', options: { logger: this.logger }}); ``` And inside `SolidityProcess` ``` process.on('message', (msg) => { if (msg.action === "init") { solcProcess = new SolcProcess(msg.options); } ... } ``` `SolcProcess` passes its `logger` instance down to `longRunningProcessTimer` which uses methods on `Logger`. However, since the data had been serialized, all prototype methods on the data is gone, resulting in an error, which made Embark stop. **Why was this only a problem when using the dashboard?** Turns out we've only relied on `Logger.info()` in case the dashboard is used.
- Loading branch information