Skip to content

Commit

Permalink
Merge pull request #1 from holochain/2019-06-27-bump-nightly
Browse files Browse the repository at this point in the history
wip on nix + circle
  • Loading branch information
thedavidmeister authored Jul 7, 2019
2 parents 431b467 + 1737b03 commit 792b603
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 73 deletions.
9 changes: 9 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 2

jobs:
build:
docker:
- image: holochain/holochain-rust:circle.01.warm.nix
steps:
- checkout
- run: nix-shell --run hcs-test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Cargo.lock
target
.cargo
**/*.rs.bk

# Environment Cruft
Expand Down
71 changes: 6 additions & 65 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,71 +1,12 @@
.PHONY: all test fmt clean tools tool_rust tool_fmt

RUSTFLAGS += -D warnings

SHELL = /usr/bin/env sh
RUST_VER_WANT = "rustc 1.33.0-nightly (19f8958f8 2019-01-23)"
RUST_TAG_WANT = "nightly-2019-01-24"
FMT_VER_WANT = "rustfmt 1.0.1-nightly (be13559 2018-12-10)"
CLP_VER_WANT = "clippy 0.0.212 (280069d 2019-01-22)"
.PHONY: all test fmt clean

all: test

test: tools
RUSTFLAGS='$(RUSTFLAGS)' cargo fmt -- --check
RUSTFLAGS='$(RUSTFLAGS)' cargo clippy -- \
-A clippy::nursery -A clippy::style -A clippy::cargo \
-A clippy::pedantic -A clippy::restriction \
-D clippy::complexity -D clippy::perf -D clippy::correctness
RUSTFLAGS='$(RUSTFLAGS)' RUST_BACKTRACE=1 cargo test
test:
nix-shell --run hcs-test

fmt: tools
cargo fmt
fmt:
nix-shell --run hn-rust-fmt

clean:
rm -rf target

tools: tool_rust tool_fmt tool_clippy

tool_rust:
@if [ "$$(rustc --version 2>/dev/null || true)" != ${RUST_VER_WANT} ]; \
then \
echo "# Makefile # incorrect rust toolchain version"; \
echo "# Makefile # want:" ${RUST_VER_WANT}; \
if rustup --version >/dev/null 2>&1; then \
echo "# Makefile # found rustup, setting override"; \
rustup override set ${RUST_TAG_WANT}; \
else \
echo "# Makefile # rustup not found, cannot install toolchain"; \
exit 1; \
fi \
else \
echo "# Makefile # rust toolchain ok:" ${RUST_VER_WANT}; \
fi;

tool_fmt: tool_rust
@if [ "$$(cargo fmt --version 2>/dev/null || true)" != ${FMT_VER_WANT} ]; \
then \
if rustup --version >/dev/null 2>&1; then \
echo "# Makefile # installing rustfmt with rustup"; \
rustup component add rustfmt-preview; \
else \
echo "# Makefile # rustup not found, cannot install rustfmt"; \
exit 1; \
fi; \
else \
echo "# Makefile # rustfmt ok:" ${FMT_VER_WANT}; \
fi;

tool_clippy: tool_rust
@if [ "$$(cargo clippy --version 2>/dev/null || true)" != ${CLP_VER_WANT} ]; \
then \
if rustup --version >/dev/null 2>&1; then \
echo "# Makefile # installing clippy with rustup"; \
rustup component add clippy-preview; \
else \
echo "# Makefile # rustup not found, cannot install rustfmt"; \
exit 1; \
fi; \
else \
echo "# Makefile # clippy ok:" ${CLP_VER_WANT}; \
fi;
nix-shell --run hn-flush
14 changes: 7 additions & 7 deletions crates/holochain_json_api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ serde = "=1.0.89"
serde_derive = "=1.0.89"
serde_json = { version = "=1.0.39", features = ["preserve_order"] }
multihash = "=0.8.0"
futures-preview = "=0.3.0-alpha.12"
futures-core-preview = "=0.3.0-alpha.12"
futures-channel-preview = "=0.3.0-alpha.12"
futures-executor-preview = "=0.3.0-alpha.12"
futures-io-preview = "=0.3.0-alpha.12"
futures-sink-preview = "=0.3.0-alpha.12"
futures-util-preview = "=0.3.0-alpha.12"
futures-preview = "=0.3.0-alpha.16"
futures-core-preview = "=0.3.0-alpha.16"
futures-channel-preview = "=0.3.0-alpha.16"
futures-executor-preview = "=0.3.0-alpha.16"
futures-io-preview = "=0.3.0-alpha.16"
futures-sink-preview = "=0.3.0-alpha.16"
futures-util-preview = "=0.3.0-alpha.16"
hcid = "=0.0.6"
shrinkwraprs = "=0.2.1"
rust-base58 = "=0.0.4"
Expand Down
1 change: 0 additions & 1 deletion crates/holochain_json_api/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! Holochain Json Api
//! This crate defines apis for extended json serde features, including
//! basic support for a `DefaultJson` deriving macro
#![feature(try_from)]
#![feature(try_trait)]
#![feature(never_type)]
#![warn(unused_extern_crates)]
Expand Down
24 changes: 24 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
let
holonix-release-tag = "0.0.4";
holonix-release-sha256 = "04xbhr0w0fc911vjd4f42shmy3vlnvwpicjnsk0q8gr4prkpz74h";

holonix = import (fetchTarball {
url = "https://github.com/holochain/holonix/tarball/${holonix-release-tag}";
sha256 = "${holonix-release-sha256}";
});
# uncomment to work locally
# holonix = import ../holonix;
in
with holonix.pkgs;
{
core-shell = stdenv.mkDerivation (holonix.shell // {
name = "holochain-serialization-shell";

buildInputs = []
++ holonix.shell.buildInputs
++ (holonix.pkgs.callPackage ./test {
pkgs = holonix.pkgs;
}).buildInputs
;
});
}
15 changes: 15 additions & 0 deletions test/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{ pkgs }:
let
name = "hcs-test";

script = pkgs.writeShellScriptBin name
''
RUST_BACKTRACE=1 \
hn-rust-fmt-check \
&& hn-rust-clippy \
&& cargo test
'';
in
{
buildInputs = [ script ];
}

0 comments on commit 792b603

Please sign in to comment.