Final fixups for updater

- Wire up platforms to match those of CI.
- Introduce "final" feature to tag version with "nightly".
This commit is contained in:
Gav Wood 2016-12-17 14:36:30 +01:00
parent f00eb060c1
commit b2b3a0eb34
No known key found for this signature in database
GPG Key ID: C49C1ACA1CC9B252
8 changed files with 40 additions and 16 deletions

View File

@ -21,7 +21,7 @@ linux-stable:
- triggers - triggers
script: script:
- curl --data "secret=$RELEASES_SECRET" http://icarus.parity.io/push-release/$CI_BUILD_REF_NAME/$CI_BUILD_REF - curl --data "secret=$RELEASES_SECRET" http://icarus.parity.io/push-release/$CI_BUILD_REF_NAME/$CI_BUILD_REF
- cargo build -j $(nproc) --release $CARGOFLAGS - cargo build -j $(nproc) --release --features final $CARGOFLAGS
- strip target/release/parity - strip target/release/parity
- export SHA3=$(target/release/parity tools hash target/release/parity) - export SHA3=$(target/release/parity tools hash target/release/parity)
- md5sum target/release/parity > parity.md5 - md5sum target/release/parity > parity.md5
@ -96,7 +96,7 @@ linux-centos:
- export CXX="g++" - export CXX="g++"
- export CC="gcc" - export CC="gcc"
- export PLATFORM=x86_64-unknown-centos-gnu - export PLATFORM=x86_64-unknown-centos-gnu
- cargo build -j $(nproc) --release $CARGOFLAGS - cargo build -j $(nproc) --release --features final $CARGOFLAGS
- strip target/release/parity - strip target/release/parity
- md5sum target/release/parity > parity.md5 - md5sum target/release/parity > parity.md5
- export SHA3=$(target/release/parity tools hash target/release/parity) - export SHA3=$(target/release/parity tools hash target/release/parity)
@ -127,7 +127,7 @@ linux-i686:
- export HOST_CXX=g++ - export HOST_CXX=g++
- export COMMIT=$(git rev-parse HEAD) - export COMMIT=$(git rev-parse HEAD)
- export PLATFORM=i686-unknown-linux-gnu - export PLATFORM=i686-unknown-linux-gnu
- cargo build -j $(nproc) --target i686-unknown-linux-gnu --release $CARGOFLAGS - cargo build -j $(nproc) --target i686-unknown-linux-gnu --features final --release $CARGOFLAGS
- strip target/$PLATFORM/release/parity - strip target/$PLATFORM/release/parity
- md5sum target/$PLATFORM/release/parity > parity.md5 - md5sum target/$PLATFORM/release/parity > parity.md5
- export SHA3=$(target/$PLATFORM/release/parity tools hash target/$PLATFORM/release/parity) - export SHA3=$(target/$PLATFORM/release/parity tools hash target/$PLATFORM/release/parity)
@ -171,7 +171,7 @@ linux-armv7:
- echo "[target.armv7-unknown-linux-gnueabihf]" >> .cargo/config - echo "[target.armv7-unknown-linux-gnueabihf]" >> .cargo/config
- echo "linker= \"arm-linux-gnueabihf-gcc\"" >> .cargo/config - echo "linker= \"arm-linux-gnueabihf-gcc\"" >> .cargo/config
- cat .cargo/config - cat .cargo/config
- cargo build -j $(nproc) --target armv7-unknown-linux-gnueabihf --release $CARGOFLAGS - cargo build -j $(nproc) --target armv7-unknown-linux-gnueabihf --features final --release $CARGOFLAGS
- arm-linux-gnueabihf-strip target/armv7-unknown-linux-gnueabihf/release/parity - arm-linux-gnueabihf-strip target/armv7-unknown-linux-gnueabihf/release/parity
- md5sum target/armv7-unknown-linux-gnueabihf/release/parity > parity.md5 - md5sum target/armv7-unknown-linux-gnueabihf/release/parity > parity.md5
- sh scripts/deb-build.sh armhf - sh scripts/deb-build.sh armhf
@ -213,7 +213,7 @@ linux-arm:
- echo "[target.arm-unknown-linux-gnueabihf]" >> .cargo/config - echo "[target.arm-unknown-linux-gnueabihf]" >> .cargo/config
- echo "linker= \"arm-linux-gnueabihf-gcc\"" >> .cargo/config - echo "linker= \"arm-linux-gnueabihf-gcc\"" >> .cargo/config
- cat .cargo/config - cat .cargo/config
- cargo build -j $(nproc) --target arm-unknown-linux-gnueabihf --release $CARGOFLAGS - cargo build -j $(nproc) --target arm-unknown-linux-gnueabihf --features final --release $CARGOFLAGS
- arm-linux-gnueabihf-strip target/arm-unknown-linux-gnueabihf/release/parity - arm-linux-gnueabihf-strip target/arm-unknown-linux-gnueabihf/release/parity
- md5sum target/arm-unknown-linux-gnueabihf/release/parity > parity.md5 - md5sum target/arm-unknown-linux-gnueabihf/release/parity > parity.md5
- sh scripts/deb-build.sh armhf - sh scripts/deb-build.sh armhf
@ -255,7 +255,7 @@ linux-armv6:
- echo "[target.arm-unknown-linux-gnueabi]" >> .cargo/config - echo "[target.arm-unknown-linux-gnueabi]" >> .cargo/config
- echo "linker= \"arm-linux-gnueabi-gcc\"" >> .cargo/config - echo "linker= \"arm-linux-gnueabi-gcc\"" >> .cargo/config
- cat .cargo/config - cat .cargo/config
- cargo build -j $(nproc) --target arm-unknown-linux-gnueabi --release $CARGOFLAGS - cargo build -j $(nproc) --target arm-unknown-linux-gnueabi --features final --release $CARGOFLAGS
- arm-linux-gnueabi-strip target/arm-unknown-linux-gnueabi/release/parity - arm-linux-gnueabi-strip target/arm-unknown-linux-gnueabi/release/parity
- md5sum target/arm-unknown-linux-gnueabi/release/parity > parity.md5 - md5sum target/arm-unknown-linux-gnueabi/release/parity > parity.md5
- aws configure set aws_access_key_id $s3_key - aws configure set aws_access_key_id $s3_key
@ -290,7 +290,7 @@ linux-aarch64:
- echo "[target.aarch64-unknown-linux-gnu]" >> .cargo/config - echo "[target.aarch64-unknown-linux-gnu]" >> .cargo/config
- echo "linker= \"aarch64-linux-gnu-gcc\"" >> .cargo/config - echo "linker= \"aarch64-linux-gnu-gcc\"" >> .cargo/config
- cat .cargo/config - cat .cargo/config
- cargo build -j $(nproc) --target aarch64-unknown-linux-gnu --release $CARGOFLAGS - cargo build -j $(nproc) --target aarch64-unknown-linux-gnu --features final --release $CARGOFLAGS
- aarch64-linux-gnu-strip target/aarch64-unknown-linux-gnu/release/parity - aarch64-linux-gnu-strip target/aarch64-unknown-linux-gnu/release/parity
- md5sum target/aarch64-unknown-linux-gnu/release/parity > parity.md5 - md5sum target/aarch64-unknown-linux-gnu/release/parity > parity.md5
- sh scripts/deb-build.sh arm64 - sh scripts/deb-build.sh arm64
@ -323,8 +323,8 @@ darwin:
script: script:
- export COMMIT=$(git rev-parse HEAD) - export COMMIT=$(git rev-parse HEAD)
- export PLATFORM=x86_64-apple-darwin - export PLATFORM=x86_64-apple-darwin
- cargo build -j 8 --release #$CARGOFLAGS - cargo build -j 8 --features final --release #$CARGOFLAGS
- cargo build -j 8 --release -p ethstore #$CARGOFLAGS - cargo build -j 8 --features final --release -p ethstore #$CARGOFLAGS
- rm -rf parity.md5 - rm -rf parity.md5
- md5sum target/release/parity > parity.md5 - md5sum target/release/parity > parity.md5
- export SHA3=$(target/release/parity tools hash target/release/parity) - export SHA3=$(target/release/parity tools hash target/release/parity)
@ -364,7 +364,7 @@ windows:
- set RUST_BACKTRACE=1 - set RUST_BACKTRACE=1
- set RUSTFLAGS=%RUSTFLAGS% - set RUSTFLAGS=%RUSTFLAGS%
- rustup default stable-x86_64-pc-windows-msvc - rustup default stable-x86_64-pc-windows-msvc
- cargo build --release #%CARGOFLAGS% - cargo build --features final --release #%CARGOFLAGS%
- signtool sign /f %keyfile% /p %certpass% target\release\parity.exe - signtool sign /f %keyfile% /p %certpass% target\release\parity.exe
- target\release\parity.exe tools hash target\release\parity.exe > parity.sha3 - target\release\parity.exe tools hash target\release\parity.exe > parity.sha3
- set /P SHA3=<parity.sha3 - set /P SHA3=<parity.sha3

1
Cargo.lock generated
View File

@ -1397,6 +1397,7 @@ dependencies = [
"ipc-common-types 1.5.0", "ipc-common-types 1.5.0",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"parity-hash-fetch 1.5.0", "parity-hash-fetch 1.5.0",
"target_info 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]

View File

@ -61,7 +61,6 @@ daemonize = "0.2"
[features] [features]
default = ["ui-precompiled"] default = ["ui-precompiled"]
ui = [ ui = [
"dapps", "dapps",
"ethcore-dapps/ui", "ethcore-dapps/ui",
@ -72,7 +71,6 @@ ui-precompiled = [
"ethcore-signer/ui-precompiled", "ethcore-signer/ui-precompiled",
"ethcore-dapps/ui-precompiled", "ethcore-dapps/ui-precompiled",
] ]
dapps = ["ethcore-dapps"] dapps = ["ethcore-dapps"]
ipc = ["ethcore/ipc", "ethsync/ipc"] ipc = ["ethcore/ipc", "ethsync/ipc"]
jit = ["ethcore/jit"] jit = ["ethcore/jit"]
@ -85,6 +83,7 @@ ethstore-cli = ["ethcore/ethstore-cli"]
evm-debug = ["ethcore/evm-debug"] evm-debug = ["ethcore/evm-debug"]
evm-debug-tests = ["ethcore/evm-debug-tests"] evm-debug-tests = ["ethcore/evm-debug-tests"]
slow-blocks = ["ethcore/slow-blocks"] slow-blocks = ["ethcore/slow-blocks"]
final = ["ethcore-util/final"]
[[bin]] [[bin]]
path = "parity/main.rs" path = "parity/main.rs"

View File

@ -18,6 +18,7 @@ ethcore-util = { path = "../util" }
parity-hash-fetch = { path = "../hash-fetch" } parity-hash-fetch = { path = "../hash-fetch" }
ipc-common-types = { path = "../ipc-common-types" } ipc-common-types = { path = "../ipc-common-types" }
ethcore-ipc = { path = "../ipc/rpc" } ethcore-ipc = { path = "../ipc/rpc" }
target_info = "0.1"
[profile.release] [profile.release]
debug = true debug = true

View File

@ -24,6 +24,7 @@ extern crate ethcore;
extern crate ethabi; extern crate ethabi;
extern crate ethsync; extern crate ethsync;
extern crate ethcore_ipc as ipc; extern crate ethcore_ipc as ipc;
extern crate target_info;
mod updater; mod updater;
mod operations; mod operations;

View File

@ -18,7 +18,8 @@ use std::sync::{Arc, Weak};
use std::fs; use std::fs;
use std::io::Write; use std::io::Write;
use std::path::{PathBuf}; use std::path::{PathBuf};
use util::misc::platform; use target_info::Target;
use util::misc;
use ipc_common_types::{VersionInfo, ReleaseTrack}; use ipc_common_types::{VersionInfo, ReleaseTrack};
use util::{Address, H160, H256, FixedHash, Mutex, Bytes}; use util::{Address, H160, H256, FixedHash, Mutex, Bytes};
use ethsync::{SyncProvider}; use ethsync::{SyncProvider};
@ -97,6 +98,18 @@ pub struct Updater {
const CLIENT_ID: &'static str = "parity"; const CLIENT_ID: &'static str = "parity";
fn platform() -> String {
if cfg!(target_os = "macos") {
"x86_64-apple-darwin".into()
} else if cfg!(windows) {
"x86_64-pc-windows-msvc".into()
} else if cfg!(target_os = "linux") {
format!("{}-unknown-linux-gnu", Target::arch())
} else {
misc::platform()
}
}
impl Updater { impl Updater {
pub fn new(client: Weak<BlockChainClient>, sync: Weak<SyncProvider>, update_policy: UpdatePolicy) -> Arc<Self> { pub fn new(client: Weak<BlockChainClient>, sync: Weak<SyncProvider>, update_policy: UpdatePolicy) -> Arc<Self> {
let r = Arc::new(Updater { let r = Arc::new(Updater {
@ -241,7 +254,7 @@ impl Updater {
trace!(target: "updater", "Latest release in our track is v{} it is {}critical ({} binary is {})", trace!(target: "updater", "Latest release in our track is v{} it is {}critical ({} binary is {})",
latest.track.version, latest.track.version,
if latest.track.is_critical {""} else {"non-"}, if latest.track.is_critical {""} else {"non-"},
platform(), &platform(),
if let Some(ref b) = latest.track.binary { if let Some(ref b) = latest.track.binary {
format!("{}", b) format!("{}", b)
} else { } else {

View File

@ -41,6 +41,7 @@ lru-cache = "0.1.0"
[features] [features]
default = [] default = []
dev = ["clippy"] dev = ["clippy"]
final = []
[build-dependencies] [build-dependencies]
vergen = "*" vergen = "*"

View File

@ -23,6 +23,14 @@ use target_info::Target;
include!(concat!(env!("OUT_DIR"), "/version.rs")); include!(concat!(env!("OUT_DIR"), "/version.rs"));
include!(concat!(env!("OUT_DIR"), "/rustc_version.rs")); include!(concat!(env!("OUT_DIR"), "/rustc_version.rs"));
#[cfg(feature = "final")]
const THIS_TRACK: &'static str = "nightly";
// ^^^ should be reset to "stable" or "beta" according to the release branch.
#[cfg(not(feature = "final"))]
const THIS_TRACK: &'static str = "unstable";
// ^^^ This gets used when we're not building a final release; should stay as "unstable".
/// Boolean type for clean/dirty status. /// Boolean type for clean/dirty status.
#[derive(PartialEq, Eq, Clone, Copy, Debug)] #[derive(PartialEq, Eq, Clone, Copy, Debug)]
pub enum Filth { pub enum Filth {
@ -45,7 +53,7 @@ pub fn version() -> String {
let sha3_dash = if sha3.is_empty() { "" } else { "-" }; let sha3_dash = if sha3.is_empty() { "" } else { "-" };
let commit_date = commit_date().replace("-", ""); let commit_date = commit_date().replace("-", "");
let date_dash = if commit_date.is_empty() { "" } else { "-" }; let date_dash = if commit_date.is_empty() { "" } else { "-" };
format!("Parity/v{}-unstable{}{}{}{}/{}/rustc{}", env!("CARGO_PKG_VERSION"), sha3_dash, sha3, date_dash, commit_date, platform(), rustc_version()) format!("Parity/v{}-{}{}{}{}{}/{}/rustc{}", env!("CARGO_PKG_VERSION"), THIS_TRACK, sha3_dash, sha3, date_dash, commit_date, platform(), rustc_version())
} }
/// Get the standard version data for this software. /// Get the standard version data for this software.
@ -64,5 +72,5 @@ pub fn version_data() -> Bytes {
/// Provide raw information on the package. /// Provide raw information on the package.
pub fn raw_package_info() -> (&'static str, &'static str, &'static str) { pub fn raw_package_info() -> (&'static str, &'static str, &'static str) {
(env!["CARGO_PKG_VERSION_PRE"], env!["CARGO_PKG_VERSION"], sha()) (THIS_TRACK, env!["CARGO_PKG_VERSION"], sha())
} }