Finally fixed the solc loading issue.

Moved the instantiation of the live-plugin-manager in to the child solc process. This allowed us to use the live-plugin-manager to require the installed solc file.

If the module is the same version as used by embark, the module is still loading using the normal require (from node_modules), as before.
This commit is contained in:
emizzle 2018-06-13 23:16:54 +10:00 committed by Iuri Matias
parent 4c16d7dd08
commit b96df79c59
4 changed files with 11 additions and 20 deletions

View File

@ -68,7 +68,7 @@ let solcProcess;
process.on('message', (msg) => {
if (msg.action === "init") {
solcProcess = new SolcProcess(msg.options);
return process.send({result: "initiated"});
return this.send({result: "initiated"});
}
else if (msg.action === 'loadCompiler') {

View File

@ -62,6 +62,8 @@ class SolcW {
});
this.solcProcess.send({action: "init", options: {logger: self.logger}});
this.solcProcess.send({action: "init", options: {}});
if (this.ipc.isServer()) {
this.ipc.on('compile', self.compile.bind(this));
}

View File

@ -64,8 +64,8 @@ class LibraryManager {
}
listenToCommandsToGetLibrary() {
let npm = new Npm({logger: this.embark.logger});
this.embark.events.setCommandHandler('version:getPackageLocation', (libName, version, cb) => {
let npm = new Npm({logger: this.embark.logger, packageName: libName, version:version});
npm.getPackageVersion(libName, version, cb);
});
this.embark.events.setCommandHandler('version:getPackagePath', (libName, version, cb) => {

25
package-lock.json generated
View File

@ -40,6 +40,7 @@
"samsam": "1.3.0"
}
},
<<<<<<< develop
"@types/debug": {
"version": "0.0.30",
"resolved": "https://registry.npmjs.org/@types/debug/-/debug-0.0.30.tgz",
@ -107,6 +108,8 @@
"resolved": "https://registry.npmjs.org/@types/url-join/-/url-join-0.8.2.tgz",
"integrity": "sha1-EYHsvh2XtwNODqHjXmLobMJrQi0="
},
=======
>>>>>>> Finally fixed the solc loading issue.
"abbrev": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
@ -4609,6 +4612,7 @@
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.5.tgz",
"integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==",
"optional": true,
"requires": {
"minipass": "2.3.3"
}
@ -7483,6 +7487,7 @@
}
}
},
<<<<<<< develop
"live-plugin-manager-git-fix": {
<<<<<<< refs/remotes/origin/bug_fix/solc-loading-issue
<<<<<<< refs/remotes/origin/bug_fix/solc-loading-issue
@ -7563,6 +7568,8 @@
}
}
},
=======
>>>>>>> Finally fixed the solc loading issue.
"load-json-file": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz",
@ -7605,14 +7612,6 @@
"path-exists": "3.0.0"
}
},
"lockfile": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/lockfile/-/lockfile-1.0.4.tgz",
"integrity": "sha512-cvbTwETRfsFh4nHsL1eGWapU1XFi5Ot9E85sWAwia7Y7EgB7vfqcZhTKZ+l7hCGxSPoushMv5GKhT5PdLv03WA==",
"requires": {
"signal-exit": "3.0.2"
}
},
"lodash": {
"version": "4.17.10",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz",
@ -12640,11 +12639,6 @@
"resolved": "https://registry.npmjs.org/uniqs/-/uniqs-2.0.0.tgz",
"integrity": "sha1-/+3ks2slKQaW5uFl1KWe25mOawI="
},
"universalify": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.1.tgz",
"integrity": "sha1-+nG63UQ3r0wUiEHjs7Fl+enlkLc="
},
"unorm": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/unorm/-/unorm-1.4.1.tgz",
@ -12736,11 +12730,6 @@
}
}
},
"url-join": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/url-join/-/url-join-4.0.0.tgz",
"integrity": "sha1-TTNA6AfTdzvamZH4MFrNzCpmXSo="
},
"url-loader": {
"version": "0.6.2",
"resolved": "https://registry.npmjs.org/url-loader/-/url-loader-0.6.2.tgz",