diff --git a/Cargo.lock b/Cargo.lock index ef424bae4..80a7ef297 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1984,7 +1984,7 @@ dependencies = [ "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "mime_guess 2.0.0-alpha.2 (registry+https://github.com/rust-lang/crates.io-index)", "node-health 0.1.0", - "parity-dapps-glue 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-dapps-glue 1.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-hash-fetch 1.9.0", "parity-reactor 0.1.0", "parity-ui 1.9.0", @@ -2000,7 +2000,7 @@ dependencies = [ [[package]] name = "parity-dapps-glue" -version = "1.9.0" +version = "1.9.1" dependencies = [ "aster 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", "clippy 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2015,7 +2015,7 @@ dependencies = [ [[package]] name = "parity-dapps-glue" -version = "1.9.0" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "aster 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2205,14 +2205,14 @@ dependencies = [ name = "parity-ui-dev" version = "1.9.0" dependencies = [ - "parity-dapps-glue 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-dapps-glue 1.9.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "parity-ui-old-dev" version = "1.9.0" dependencies = [ - "parity-dapps-glue 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-dapps-glue 1.9.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2220,7 +2220,7 @@ name = "parity-ui-old-precompiled" version = "1.8.0" source = "git+https://github.com/paritytech/js-precompiled.git?branch=v1#94b0a89aac7eb5ddfdb53cd9bb039da6fdbf7583" dependencies = [ - "parity-dapps-glue 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-dapps-glue 1.9.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2228,7 +2228,7 @@ name = "parity-ui-precompiled" version = "1.9.0" source = "git+https://github.com/paritytech/js-precompiled.git#1626d64235241e75c531eece004a4923d9d4fcc6" dependencies = [ - "parity-dapps-glue 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-dapps-glue 1.9.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3643,7 +3643,7 @@ dependencies = [ "checksum order-stat 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "efa535d5117d3661134dbf1719b6f0ffe06f2375843b13935db186cd094105eb" "checksum ordered-float 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "58d25b6c0e47b20d05226d288ff434940296e7e2f8b877975da32f862152241f" "checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37" -"checksum parity-dapps-glue 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9df5504a83dbbbd25ddb0645372bd09dff5a7716e18690a21211873b81606fe9" +"checksum parity-dapps-glue 1.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "261c025c67ba416e9fe63aa9b3236520ce3c74cfbe43590c9cdcec4ccc8180e4" "checksum parity-tokio-ipc 0.1.5 (git+https://github.com/nikvolf/parity-tokio-ipc)" = "" "checksum parity-ui-old-precompiled 1.8.0 (git+https://github.com/paritytech/js-precompiled.git?branch=v1)" = "" "checksum parity-ui-precompiled 1.9.0 (git+https://github.com/paritytech/js-precompiled.git)" = "" diff --git a/dapps/js-glue/Cargo.toml b/dapps/js-glue/Cargo.toml index 76c5457d7..4cad9cdab 100644 --- a/dapps/js-glue/Cargo.toml +++ b/dapps/js-glue/Cargo.toml @@ -1,7 +1,7 @@ [package] description = "Base Package for all Parity built-in dapps" name = "parity-dapps-glue" -version = "1.9.0" +version = "1.9.1" license = "GPL-3.0" authors = ["Parity Technologies "] build = "build.rs" diff --git a/dapps/js-glue/src/js.rs b/dapps/js-glue/src/js.rs index 49ccdd26f..d1d1cdda9 100644 --- a/dapps/js-glue/src/js.rs +++ b/dapps/js-glue/src/js.rs @@ -25,7 +25,7 @@ mod platform { use std::process::Command; pub static NPM_CMD: &'static str = "npm"; - pub fn handle_fd(cmd: &mut Command) -> &mut Command { + pub fn handle_cmd(cmd: &mut Command) -> &mut Command { cmd } } @@ -34,14 +34,14 @@ mod platform { mod platform { use std::process::{Command, Stdio}; - pub static NPM_CMD: &'static str = "npm.cmd"; + pub static NPM_CMD: &'static str = "cmd.exe"; // NOTE [ToDr] For some reason on windows - // We cannot have any file descriptors open when running a child process - // during build phase. - pub fn handle_fd(cmd: &mut Command) -> &mut Command { + // The command doesn't have %~dp0 set properly + // and it cannot load globally installed node.exe + pub fn handle_cmd(cmd: &mut Command) -> &mut Command { cmd.stdin(Stdio::null()) - .stdout(Stdio::null()) - .stderr(Stdio::null()) + .arg("/c") + .arg("npm.cmd") } } @@ -58,7 +58,7 @@ pub fn build(_path: &str, _dest: &str) { #[cfg(not(feature = "use-precompiled-js"))] pub fn build(path: &str, dest: &str) { - let child = platform::handle_fd(&mut Command::new(platform::NPM_CMD)) + let child = platform::handle_cmd(&mut Command::new(platform::NPM_CMD)) .arg("install") .arg("--no-progress") .current_dir(path) @@ -66,7 +66,7 @@ pub fn build(path: &str, dest: &str) { .unwrap_or_else(|e| die("Installing node.js dependencies with npm", e)); assert!(child.success(), "There was an error installing dependencies."); - let child = platform::handle_fd(&mut Command::new(platform::NPM_CMD)) + let child = platform::handle_cmd(&mut Command::new(platform::NPM_CMD)) .arg("run") .arg("build") .env("NODE_ENV", "production") diff --git a/js/package.json b/js/package.json index ba4193bf2..3ff5a08ca 100644 --- a/js/package.json +++ b/js/package.json @@ -27,7 +27,7 @@ "build:embed": "cross-env EMBED=1 node webpack/embed", "build:i18n": "npm run clean && npm run build && babel-node ./scripts/build-i18n.js", "ci:build": "cross-env NODE_ENV=production npm run build", - "clean": "rm -rf ./.build ./.coverage ./.happypack ./build ./node_modules/.cache", + "clean": "rimraf ./.build ./.coverage ./.happypack ./build ./node_modules/.cache", "coveralls": "npm run testCoverage && coveralls < coverage/lcov.info", "lint": "npm run lint:css && npm run lint:js", "lint:cached": "npm run lint:css && npm run lint:js:cached", @@ -43,7 +43,7 @@ "test": "cross-env NODE_ENV=test mocha --compilers ejs:ejsify 'src/**/*.spec.js'", "test:coverage": "cross-env NODE_ENV=test istanbul cover _mocha -- --compilers ejs:ejsify 'src/**/*.spec.js'", "test:e2e": "cross-env NODE_ENV=test mocha 'src/**/*.e2e.js'", - "test:npm": "(cd .npmjs && npm i) && node test/npmParity && node test/npmJsonRpc && (rm -rf .npmjs/node_modules)", + "test:npm": "(cd .npmjs && npm i) && node test/npmParity && node test/npmJsonRpc && (rimraf .npmjs/node_modules)", "prepush": "npm run lint:cached" }, "devDependencies": { @@ -115,6 +115,7 @@ "react-addons-test-utils": "15.4.2", "react-hot-loader": "3.0.0-beta.6", "react-intl-aggregate-webpack-plugin": "0.0.1", + "rimraf": "2.6.2", "sinon": "1.17.7", "sinon-as-promised": "4.0.2", "sinon-chai": "2.8.0",