Skip to content

Commit

Permalink
Fix build from 1.40.0 beakage (#227)
Browse files Browse the repository at this point in the history
* Use Rust version in cache key

* Pin Rust version to 1.40.0

* Move benches into simulator

Simulator depends on std which makes life easier for target builds

* Sidestep --features in workspace root error
  • Loading branch information
jamwaffles committed Dec 26, 2019
1 parent da46762 commit 1b1f343
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 19 deletions.
14 changes: 7 additions & 7 deletions .circleci/config.yml
@@ -1,32 +1,32 @@
# Check that everything (tests, benches, etc) builds in std environments
precheck_steps: &precheck_steps
docker:
- image: circleci/rust:latest
- image: circleci/rust:1.40.0
steps:
- checkout
- restore_cache:
key: v1-embedded-graphics-{{ .Environment.CIRCLE_JOB }}-{{ checksum "embedded-graphics/Cargo.toml" }}-{{ checksum "tinybmp/Cargo.toml" }}-{{ checksum "tinytga/Cargo.toml" }}-{{ checksum "simulator/Cargo.toml" }}
key: v1-embedded-graphics-{{ .Environment.RUST_VERSION }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "embedded-graphics/Cargo.toml" }}-{{ checksum "tinybmp/Cargo.toml" }}-{{ checksum "tinytga/Cargo.toml" }}-{{ checksum "simulator/Cargo.toml" }}
- run: sudo apt install -qq libsdl2-dev python-pip
- run: sudo pip install linkchecker
- run: rustup default ${RUST_VERSION:-stable}
- run: rustup component add rustfmt
- run: ./build.sh
- save_cache:
key: v1-embedded-graphics-{{ .Environment.CIRCLE_JOB }}-{{ checksum "embedded-graphics/Cargo.toml" }}-{{ checksum "tinybmp/Cargo.toml" }}-{{ checksum "tinytga/Cargo.toml" }}-{{ checksum "simulator/Cargo.toml" }}
key: v1-embedded-graphics-{{ .Environment.RUST_VERSION }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "embedded-graphics/Cargo.toml" }}-{{ checksum "tinybmp/Cargo.toml" }}-{{ checksum "tinytga/Cargo.toml" }}-{{ checksum "simulator/Cargo.toml" }}
paths:
- ./target
- /home/ubuntu/.cargo

# Build crates for embedded target
target_steps: &target_steps
docker:
- image: circleci/rust:latest
- image: circleci/rust:1.40.0
steps:
- checkout
- restore_cache:
keys:
- v1-embedded-graphics-{{ .Environment.CIRCLE_JOB }}-{{ checksum "embedded-graphics/Cargo.toml" }}-{{ checksum "tinybmp/Cargo.toml" }}-{{ checksum "tinytga/Cargo.toml" }}-{{ checksum "simulator/Cargo.toml" }}
- v1-embedded-graphics-{{ .Environment.CIRCLE_JOB }}-{{ checksum "embedded-graphics/Cargo.toml" }}-{{ checksum "tinybmp/Cargo.toml" }}-{{ checksum "tinytga/Cargo.toml" }}-{{ checksum "simulator/Cargo.toml" }}-{{ .Environment.TARGET }}
- v1-embedded-graphics-{{ .Environment.RUST_VERSION }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "embedded-graphics/Cargo.toml" }}-{{ checksum "tinybmp/Cargo.toml" }}-{{ checksum "tinytga/Cargo.toml" }}-{{ checksum "simulator/Cargo.toml" }}
- v1-embedded-graphics-{{ .Environment.RUST_VERSION }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "embedded-graphics/Cargo.toml" }}-{{ checksum "tinybmp/Cargo.toml" }}-{{ checksum "tinytga/Cargo.toml" }}-{{ checksum "simulator/Cargo.toml" }}-{{ .Environment.TARGET }}
- run: |
SYSROOT=$(rustc --print sysroot)
Expand All @@ -38,7 +38,7 @@ target_steps: &target_steps
- run: ./build_target.sh
- run: ./build_target.sh --release
- save_cache:
key: v1-embedded-graphics-{{ .Environment.CIRCLE_JOB }}-{{ checksum "embedded-graphics/Cargo.toml" }}-{{ checksum "tinybmp/Cargo.toml" }}-{{ checksum "tinytga/Cargo.toml" }}-{{ checksum "simulator/Cargo.toml" }}-{{ .Environment.TARGET }}
key: v1-embedded-graphics-{{ .Environment.RUST_VERSION }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "embedded-graphics/Cargo.toml" }}-{{ checksum "tinybmp/Cargo.toml" }}-{{ checksum "tinytga/Cargo.toml" }}-{{ checksum "simulator/Cargo.toml" }}-{{ .Environment.TARGET }}
paths:
- ./target
- /home/ubuntu/.cargo
Expand Down
3 changes: 3 additions & 0 deletions build_target.sh
Expand Up @@ -5,7 +5,10 @@
set -e

cargo build -p embedded-graphics --target $TARGET "$@"

pushd embedded-graphics
cargo build -p embedded-graphics --target $TARGET --features 'bmp tga nalgebra' "$@"
popd

cargo build -p tinytga --target $TARGET "$@"
cargo build -p tinybmp --target $TARGET "$@"
12 changes: 0 additions & 12 deletions embedded-graphics/Cargo.toml
Expand Up @@ -20,17 +20,6 @@ edition = "2018"
[package.metadata.docs.rs]
all-features = true

[[bench]]
harness = false
name = "primitives"
[[bench]]
harness = false
name = "fonts"
[[bench]]
harness = false
name = "image"
required-features = ["bmp"]

[badges]
circle-ci = { repository = "jamwaffles/embedded-graphics", branch = "master" }

Expand All @@ -47,5 +36,4 @@ bmp = [ "tinybmp" ]
tga = [ "tinytga" ]

[dev-dependencies]
criterion = { version = "0.2.11", default-features = false }
arrayvec = "0.4.11"
12 changes: 12 additions & 0 deletions simulator/Cargo.toml
Expand Up @@ -20,6 +20,17 @@ exclude = [
[badges]
circle-ci = { repository = "jamwaffles/embedded-graphics", branch = "master" }

[[bench]]
harness = false
name = "primitives"
[[bench]]
harness = false
name = "fonts"
[[bench]]
harness = false
name = "image"
required-features = ["bmp"]

[dependencies]
sdl2 = "0.32.2"

Expand All @@ -29,3 +40,4 @@ features = [ "bmp", "tga" ]

[dev-dependencies]
chrono = "0.4.9"
criterion = { version = "0.2.11", default-features = false }
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 1b1f343

Please sign in to comment.