From 11cae70cdd1a0ef8a44f7fa90708e39e9e8384aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Tue, 12 Jul 2016 20:15:36 +0200 Subject: [PATCH 1/5] No-ui compilation feature --- Cargo.toml | 1 + parity/configuration.rs | 2 +- parity/dapps.rs | 8 ++++---- parity/main.rs | 2 +- signer/Cargo.toml | 1 + signer/src/lib.rs | 1 + signer/src/ws_server/session.rs | 21 ++++++++++++++++++++- 7 files changed, 29 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index fe035c348..667335e39 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,6 +49,7 @@ default-features = false [features] default = ["dapps"] +no-ui = ["ethcore-signer/no-ui"] dapps = ["ethcore-dapps"] dev = ["clippy", "ethcore/dev", "ethcore-util/dev", "ethsync/dev", "ethcore-rpc/dev", "ethcore-dapps/dev", "ethcore-signer/dev"] diff --git a/parity/configuration.rs b/parity/configuration.rs index dc00cb237..6644e3437 100644 --- a/parity/configuration.rs +++ b/parity/configuration.rs @@ -561,7 +561,7 @@ impl Configuration { } pub fn dapps_enabled(&self) -> bool { - !self.args.flag_dapps_off && !self.args.flag_no_dapps + !self.args.flag_dapps_off && !self.args.flag_no_dapps && cfg!(not(feature = "no-ui")) } pub fn signer_enabled(&self) -> bool { diff --git a/parity/dapps.rs b/parity/dapps.rs index 917c59fc6..67b6ce280 100644 --- a/parity/dapps.rs +++ b/parity/dapps.rs @@ -21,9 +21,9 @@ use util::panics::PanicHandler; use die::*; use rpc_apis; -#[cfg(feature = "dapps")] +#[cfg(all(feature = "dapps", not(feature = "no-ui")))] pub use ethcore_dapps::Server as WebappServer; -#[cfg(not(feature = "dapps"))] +#[cfg(any(not(feature = "dapps"), feature = "no-ui"))] pub struct WebappServer; pub struct Configuration { @@ -62,7 +62,7 @@ pub fn new(configuration: Configuration, deps: Dependencies) -> Option Option { + signer::handle(req) + } +} +#[cfg(feature = "no-ui")] +mod signer { + pub struct File { + pub content: String, + pub mime: String, + } + + pub fn handle(_req: &str) -> Option { + None + } +} + fn origin_is_allowed(self_origin: &str, header: Option<&[u8]>) -> bool { match header { None => false, From 29076da4b753c1a67c0b1053620f0543c9b61b97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Wed, 13 Jul 2016 11:10:43 +0200 Subject: [PATCH 2/5] UI feature --- Cargo.toml | 5 ++--- parity/configuration.rs | 2 +- parity/dapps.rs | 8 ++++---- parity/main.rs | 2 +- signer/Cargo.toml | 5 +++-- signer/src/lib.rs | 2 +- signer/src/ws_server/session.rs | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 667335e39..281ea6243 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,13 +29,13 @@ ethsync = { path = "sync" } ethcore-devtools = { path = "devtools" } ethcore-rpc = { path = "rpc" } ethcore-signer = { path = "signer" } -ethcore-dapps = { path = "dapps", optional = true } semver = "0.2" ethcore-ipc-nano = { path = "ipc/nano" } ethcore-ipc = { path = "ipc/rpc" } ethcore-ipc-hypervisor = { path = "ipc/hypervisor" } json-ipc-server = { git = "https://github.com/ethcore/json-ipc-server.git" } ansi_term = "0.7" +ethcore-dapps = { path = "dapps", optional = true } [target.'cfg(windows)'.dependencies] winapi = "0.2" @@ -48,8 +48,7 @@ version = "0.8" default-features = false [features] -default = ["dapps"] -no-ui = ["ethcore-signer/no-ui"] +default = ["dapps", "ethcore-signer/ui"] dapps = ["ethcore-dapps"] dev = ["clippy", "ethcore/dev", "ethcore-util/dev", "ethsync/dev", "ethcore-rpc/dev", "ethcore-dapps/dev", "ethcore-signer/dev"] diff --git a/parity/configuration.rs b/parity/configuration.rs index 6644e3437..f41784bc1 100644 --- a/parity/configuration.rs +++ b/parity/configuration.rs @@ -561,7 +561,7 @@ impl Configuration { } pub fn dapps_enabled(&self) -> bool { - !self.args.flag_dapps_off && !self.args.flag_no_dapps && cfg!(not(feature = "no-ui")) + !self.args.flag_dapps_off && !self.args.flag_no_dapps && cfg!(feature = "dapps") } pub fn signer_enabled(&self) -> bool { diff --git a/parity/dapps.rs b/parity/dapps.rs index 67b6ce280..917c59fc6 100644 --- a/parity/dapps.rs +++ b/parity/dapps.rs @@ -21,9 +21,9 @@ use util::panics::PanicHandler; use die::*; use rpc_apis; -#[cfg(all(feature = "dapps", not(feature = "no-ui")))] +#[cfg(feature = "dapps")] pub use ethcore_dapps::Server as WebappServer; -#[cfg(any(not(feature = "dapps"), feature = "no-ui"))] +#[cfg(not(feature = "dapps"))] pub struct WebappServer; pub struct Configuration { @@ -62,7 +62,7 @@ pub fn new(configuration: Configuration, deps: Dependencies) -> Option Date: Wed, 13 Jul 2016 11:58:55 +0200 Subject: [PATCH 3/5] Disabling building UI --- .travis.yml | 6 +++--- appveyor.yml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index b9a530390..82d34c919 100644 --- a/.travis.yml +++ b/.travis.yml @@ -59,9 +59,9 @@ install: - rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION script: - - if [ "$RUN_TESTS" = "true" ]; then cargo test --release --verbose ${FEATURES} ${TARGETS}; fi - - if [ "$RUN_BENCHES" = "true" ]; then cargo bench --no-run ${FEATURES} ${TARGETS}; fi - - if [ "$RUN_BUILD" = "true" ]; then cargo build --release --verbose ${FEATURES}; fi + - if [ "$RUN_TESTS" = "true" ]; then cargo test --release --verbose --no-default-features ${FEATURES} ${TARGETS}; fi + - if [ "$RUN_BENCHES" = "true" ]; then cargo bench --no-run --no-default-features ${FEATURES} ${TARGETS}; fi + - if [ "$RUN_BUILD" = "true" ]; then cargo build --release --verbose --no-default-features ${FEATURES}; fi - if [ "$RUN_BUILD" = "true" ]; then tar cvzf parity${ARCHIVE_SUFFIX}.tar.gz -C target/release parity; fi after_success: | diff --git a/appveyor.yml b/appveyor.yml index b183af550..712445ca6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -31,10 +31,10 @@ install: build: off test_script: - - cargo test --verbose --release + - cargo test --verbose --release --no-default-features after_test: - - cargo build --verbose --release + - cargo build --verbose --release --no-default-features - ps: if($env:cert) { Start-FileDownload $env:cert -FileName $env:keyfile } - ps: if($env:cert) { signtool sign /f $env:keyfile /p $env:certpass target\release\parity.exe } - makensis.exe nsis\installer.nsi From 29a5c1785c8be8b8ac7c88007b2403cb01538514 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Wed, 13 Jul 2016 11:58:55 +0200 Subject: [PATCH 4/5] Disabling building UI --- .travis.yml | 6 +++--- appveyor.yml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index b9a530390..82d34c919 100644 --- a/.travis.yml +++ b/.travis.yml @@ -59,9 +59,9 @@ install: - rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION script: - - if [ "$RUN_TESTS" = "true" ]; then cargo test --release --verbose ${FEATURES} ${TARGETS}; fi - - if [ "$RUN_BENCHES" = "true" ]; then cargo bench --no-run ${FEATURES} ${TARGETS}; fi - - if [ "$RUN_BUILD" = "true" ]; then cargo build --release --verbose ${FEATURES}; fi + - if [ "$RUN_TESTS" = "true" ]; then cargo test --release --verbose --no-default-features ${FEATURES} ${TARGETS}; fi + - if [ "$RUN_BENCHES" = "true" ]; then cargo bench --no-run --no-default-features ${FEATURES} ${TARGETS}; fi + - if [ "$RUN_BUILD" = "true" ]; then cargo build --release --verbose --no-default-features ${FEATURES}; fi - if [ "$RUN_BUILD" = "true" ]; then tar cvzf parity${ARCHIVE_SUFFIX}.tar.gz -C target/release parity; fi after_success: | diff --git a/appveyor.yml b/appveyor.yml index b183af550..712445ca6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -31,10 +31,10 @@ install: build: off test_script: - - cargo test --verbose --release + - cargo test --verbose --release --no-default-features after_test: - - cargo build --verbose --release + - cargo build --verbose --release --no-default-features - ps: if($env:cert) { Start-FileDownload $env:cert -FileName $env:keyfile } - ps: if($env:cert) { signtool sign /f $env:keyfile /p $env:certpass target\release\parity.exe } - makensis.exe nsis\installer.nsi From 507a638762a4a6447cd9be72abdc3a7481bea18d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Wed, 13 Jul 2016 16:39:03 +0200 Subject: [PATCH 5/5] Disabling ethcore-dapps testing (for a while) --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 82d34c919..6adc35074 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,7 +34,7 @@ env: - TRAVIS_NODE_VERSION="6" # GH_TOKEN - secure: bumJASbZSU8bxJ0EyPUJmu16AiV9EXOpyOj86Jlq/Ty9CfwGqsSXt96uDyE+OUJf34RUFQMsw0nk37/zC4lcn6kqk2wpuH3N/o85Zo/cVZY/NusBWLQqtT5VbYWsV+u2Ua4Tmmsw8yVYQhYwU2ZOejNpflL+Cs9XGgORp1L+/gMRMC2y5Se6ZhwnKPQlRJ8LGsG1dzjQULxzADIt3/zuspNBS8a2urJwlHfGMkvHDoUWCviP/GXoSqw3TZR7FmKyxE19I8n9+iSvm9+oZZquvcgfUxMHn8Gq/b44UbPvjtFOg2yam4xdWXF/RyWCHdc/R9EHorSABeCbefIsm+zcUF3/YQxwpSxM4IZEeH2rTiC7dcrsKw3XsO16xFQz5YI5Bay+CT/wTdMmJd7DdYz7Dyf+pOvcM9WOf/zorxYWSBOMYy0uzbusU2iyIghQ82s7E/Ahg+WARtPgkuTLSB5aL1oCTBKHqQscMr7lo5Ti6RpWLxEdTQMBznc+bMr+6dEtkEcG9zqc6cE9XX+ox3wTU6+HVMfQ1ltCntJ4UKcw3A6INEbw9wgocQa812CIASQ2fE+SCAbz6JxBjIAlFUnD1lUB7S8PdMPwn9plfQgKQ2A5YZqg6FnBdf0rQXIJYxQWKHXj/rBHSUCT0tHACDlzTA+EwWggvkP5AGIxRxm8jhw= - - TARGETS="-p ethkey -p ethstore -p ethash -p ethcore-util -p ethcore -p ethsync -p ethcore-rpc -p parity -p ethjson -p ethcore-dapps -p ethcore-signer -p bigint" + - TARGETS="-p ethkey -p ethstore -p ethash -p ethcore-util -p ethcore -p ethsync -p ethcore-rpc -p parity -p ethjson -p ethcore-signer -p bigint" - ARCHIVE_SUFFIX="-${TRAVIS_OS_NAME}-${TRAVIS_TAG}" - KCOV_FEATURES="" - KCOV_CMD="./kcov-master/tmp/usr/local/bin/kcov --exclude-pattern /usr/,/.cargo,/root/.multirust,src/tests,util/json-tests,util/src/network/tests,sync/src/tests,ethcore/src/tests,ethcore/src/evm/tests,ethstore/tests target/kcov" @@ -76,7 +76,6 @@ after_success: | $KCOV_CMD target/debug/deps/ethcore-* && $KCOV_CMD target/debug/deps/ethsync-* && $KCOV_CMD target/debug/deps/ethcore_rpc-* && - $KCOV_CMD target/debug/deps/ethcore_dapps-* && $KCOV_CMD target/debug/deps/ethcore_signer-* && $KCOV_CMD target/debug/deps/ethjson-* && $KCOV_CMD target/debug/parity-* &&