Skip to content

Commit

Permalink
Workaround dev-dependencies leaking into normal build
Browse files Browse the repository at this point in the history
  • Loading branch information
Nemo157 committed Feb 19, 2019
1 parent 92d2c70 commit cbc286b
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 7 deletions.
19 changes: 12 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,26 @@ matrix:
script:
- cargo build --manifest-path futures/Cargo.toml --features io-compat

# Allow build fail until #1396 is fixed.
- name: cargo build --target=thumbv6m-none-eabi
rust: nightly
env: ALLOW_FAILURES=true
install:
- rustup target add thumbv6m-none-eabi
script:
- cargo run --manifest-path ci/remove-dev-dependencies/Cargo.toml */Cargo.toml
- cargo build --manifest-path futures/Cargo.toml
--target thumbv6m-none-eabi
--no-default-features
--features nightly
--features nightly,cfg-target-has-atomic

- name: cargo build --target=thumbv7m-none-eabi
rust: nightly
install:
- rustup target add thumbv7m-none-eabi
script:
- cargo run --manifest-path ci/remove-dev-dependencies/Cargo.toml */Cargo.toml
- cargo build --manifest-path futures/Cargo.toml
--target thumbv7m-none-eabi
--no-default-features

- name: cargo doc
rust: nightly
Expand Down Expand Up @@ -102,10 +111,6 @@ matrix:
- git commit -m "Add API docs for $TRAVIS_TAG"
- git push origin master

allow_failures:
- rust: nightly
env: ALLOW_FAILURES=true

script:
- cargo test --all --all-features
- cargo test --all --all-features --release
Expand Down
11 changes: 11 additions & 0 deletions ci/remove-dev-dependencies/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "remove-dev-dependencies"
version = "0.1.0"
authors = ["Wim Looman <wim@nemo157.com>"]
edition = "2018"
publish = false

[workspace]

[dependencies]
toml_edit = "0.1.3"
12 changes: 12 additions & 0 deletions ci/remove-dev-dependencies/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
use std::{env, error::Error, fs};

fn main() -> Result<(), Box<dyn Error>> {
for file in env::args().skip(1) {
let content = fs::read_to_string(&file)?;
let mut doc: toml_edit::Document = content.parse()?;
doc.as_table_mut().remove("dev-dependencies");
fs::write(file, doc.to_string())?;
}

Ok(())
}

0 comments on commit cbc286b

Please sign in to comment.