Bump rocket to 0.3.6 (#34)

* Bump rocket to 0.3.6

- Remove `build.rs` - the minimum nightly version is enforced by Rocket
- Remove the pinning to a specific Nightly version. The latest nightly
should work.
- Added a minimum nightly matrix

* Fix Rocket's minimum

* Fix travis build script
This commit is contained in:
Yong Wen Chua 2018-02-14 13:20:31 +08:00 committed by GitHub
parent 34e3af4869
commit 456248eabf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 11 additions and 99 deletions

View File

@ -1,7 +1,9 @@
sudo: false
language: rust
rust:
- nightly-2017-12-18
- nightly
# Minimum Rust set by Rocket
- nightly-2018-01-13
env:
global:
- TRAVIS_CARGO_NIGHTLY_FEATURE=""
@ -19,10 +21,12 @@ before_script:
- |
pip install 'travis-cargo<0.2' --user &&
export PATH=$HOME/.local/bin:$PATH
# Remove rust-toolchain override for tests
- rm rust-toolchain
script:
- |
travis-cargo build -- "${CARGO_FLAGS}" &&
travis-cargo test -- "${CARGO_FLAGS}" &&
travis-cargo --only nightly-2017-12-18 doc -- --no-deps "${CARGO_FLAGS}"
travis-cargo --only nightly doc -- --no-deps "${CARGO_FLAGS}"
after_success:
- test $CARGO_FLAGS = "--all-features" && travis-cargo --only nightly-2017-12-18 doc-upload
- test $CARGO_FLAGS = "--all-features" && travis-cargo --only nightly doc-upload

View File

@ -3,7 +3,6 @@ name = "rocket_cors"
version = "0.2.1"
license = "Apache-2.0"
authors = ["Yong Wen Chua <me@yongwen.xyz>"]
build = "build.rs"
description = "Cross-origin resource sharing (CORS) for Rocket.rs applications"
homepage = "https://github.com/lawliet89/rocket_cors"
repository = "https://github.com/lawliet89/rocket_cors"
@ -22,7 +21,7 @@ serialization = ["serde", "serde_derive", "unicase_serde", "url_serde"]
[dependencies]
log = "0.3"
rocket = "0.3"
rocket = "0.3.6"
unicase = "2.0"
url = "1.5.1"
@ -32,10 +31,6 @@ serde_derive = { version = "1.0", optional = true }
unicase_serde = { version = "0.1.0", optional = true }
url_serde = { version = "0.2.0", optional = true }
[build-dependencies]
ansi_term = "0.9"
version_check = "0.1"
[dev-dependencies]
hyper = "0.10"
rocket_codegen = "0.3"

View File

@ -21,8 +21,8 @@ Rocket requires nightly Rust. You should probably install Rust with
See
[installation instructions](https://rocket.rs/guide/getting-started/#installing-rust).
In particular, `rocket_cors` is currently targetted for `nightly-2017-12-18`. Newer nightlies
might work, but it's not guaranteed.
In particular, `rocket_cors` is currently targetted for the latest `nightly`. Older nightlies might
work, but they are subject to the minimum that Rocket sets.
## Installation

View File

@ -1,86 +0,0 @@
//! This tiny build script ensures that the crate is not compiled with an
//! incompatible version of rust.
//! This scipt was stolen from `rocket_codegen`.
extern crate ansi_term;
extern crate version_check;
use ansi_term::Color::{Red, Yellow, Blue, White};
use version_check::{is_nightly, is_min_version, is_min_date};
// Specifies the minimum nightly version that is targetted
// Note that sometimes the `rustc` date might be older than the nightly version,
// usually one day older
const MIN_DATE: &'static str = "2017-12-17";
const MIN_VERSION: &'static str = "1.24.0-nightly";
// Convenience macro for writing to stderr.
macro_rules! printerr {
($($arg:tt)*) => ({
use std::io::prelude::*;
write!(&mut ::std::io::stderr(), "{}\n", format_args!($($arg)*))
.expect("Failed to write to stderr.")
})
}
fn main() {
let ok_nightly = is_nightly();
let ok_version = is_min_version(MIN_VERSION);
let ok_date = is_min_date(MIN_DATE);
let print_version_err = |version: &str, date: &str| {
printerr!(
"{} {}. {} {}.",
White.paint("Installed version is:"),
Yellow.paint(format!("{} ({})", version, date)),
White.paint("Minimum required:"),
Yellow.paint(format!("{} ({})", MIN_VERSION, MIN_DATE))
);
};
match (ok_nightly, ok_version, ok_date) {
(Some(is_nightly), Some((ok_version, version)), Some((ok_date, date))) => {
if !is_nightly {
printerr!(
"{} {}",
Red.bold().paint("Error:"),
White.paint("rocket_cors requires a nightly version of Rust.")
);
print_version_err(&*version, &*date);
printerr!(
"{}{}{}",
Blue.paint("See the README ("),
White.paint("https://github.com/lawliet89/rocket_cors"),
Blue.paint(") for more information.")
);
panic!("Aborting compilation due to incompatible compiler.")
}
if !ok_version || !ok_date {
printerr!(
"{} {}",
Red.bold().paint("Error:"),
White.paint("rocket_cors requires a more recent version of rustc.")
);
printerr!(
"{}{}{}",
Blue.paint("Use `"),
White.paint("rustup update"),
Blue.paint("` or your preferred method to update Rust.")
);
print_version_err(&*version, &*date);
panic!("Aborting compilation due to incompatible compiler.")
}
}
_ => {
println!(
"cargo:warning={}",
"rocket_cors was unable to check rustc compatibility."
);
println!(
"cargo:warning={}",
"Build may fail due to incompatible rustc version."
);
}
}
}

View File

@ -1 +1 @@
nightly-2017-12-18
nightly

View File

@ -485,7 +485,6 @@
dead_code,
deprecated,
exceeding_bitshifts,
fat_ptr_transmutes,
improper_ctypes,
missing_docs,
mutable_transmutes,