Skip to content
Permalink
Browse files
Enable compilation with stable Rust.
To the Rust teams, Rust's contributors, Rocket's contributors, the
entire Rust and Rocket communities, my colleagues at Stanford and
beyond, and Jeb: thank you all. Sincerely.

To the next ~4 years of Rocket!

Closes #19.
  • Loading branch information
SergioBenitez committed Jul 21, 2020
1 parent b47d1b8 commit 56a617262525de758cb47a0d71049db948f24bbd
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 127 deletions.
@@ -1,4 +1,4 @@
name: Test
name: CI

on: [push, pull_request]

@@ -7,28 +7,39 @@ env:

jobs:
test:
name: "${{ matrix.os.name }} ${{ matrix.test.name }}"
name: "${{ matrix.os.name }} ${{ matrix.test.name }} (${{ matrix.toolchain }})"

strategy:
fail-fast: false
matrix:
os:
- name: Linux
distro: ubuntu-latest
- name: Windows
distro: windows-latest
- name: macOS
distro: macOS-latest
toolchain:
- nightly
- { name: Linux, distro: ubuntu-latest }
- { name: Windows, distro: windows-latest }
- { name: macOS, distro: macOS-latest }
test:
- name: Debug
flag:
- name: Release
flag: "--release"
- name: Core
flag: "--core"
- name: Contrib
flag: "--contrib"
- { name: Debug, flag: }
- { name: Contrib, flag: "--contrib" }
toolchain: [stable]
allow-failures: [false]
include:
- toolchain: stable
os: { name: Linux, distro: ubuntu-latest }
test: { name: Core, flag: "--core" }
allow-failures: false
- toolchain: stable
os: { name: Linux, distro: ubuntu-latest }
test: { name: Release, flag: "--release" }
allow-failures: false
- toolchain: nightly
os: { name: Linux, distro: ubuntu-latest }
test: { name: Debug, flag: }
allow-failures: true
- toolchain: nightly
os: { name: Linux, distro: ubuntu-latest }
test: { name: Contrib, flag: "--contrib" }
allow-failures: true

continue-on-error: ${{ matrix.allow-failures }}

runs-on: ${{ matrix.os.distro }}

@@ -1,6 +1,6 @@
# Rocket

[![Build Status](https://github.com/SergioBenitez/Rocket/workflows/Test/badge.svg)](https://github.com/SergioBenitez/Rocket/actions)
[![Build Status](https://github.com/SergioBenitez/Rocket/workflows/CI/badge.svg)](https://github.com/SergioBenitez/Rocket/actions)
[![Rocket Homepage](https://img.shields.io/badge/web-rocket.rs-red.svg?style=flat&label=https&colorB=d33847)](https://rocket.rs)
[![Current Crates.io Version](https://img.shields.io/crates/v/rocket.svg)](https://crates.io/crates/rocket)
[![Matrix: #rocket:mozilla.org](https://img.shields.io/badge/style-%23rocket:mozilla.org-blue.svg?style=flat&label=[m])](https://chat.mozilla.org/#/room/#rocket:mozilla.org)
@@ -9,7 +9,6 @@ repository = "https://github.com/SergioBenitez/Rocket"
readme = "../../README.md"
keywords = ["rocket", "contrib", "code", "generation", "proc-macro"]
license = "MIT OR Apache-2.0"
build = "build.rs"
edition = "2018"

[features]
@@ -22,10 +21,6 @@ proc-macro = true
quote = "1.0"
devise = { git = "https://github.com/SergioBenitez/Devise.git", rev = "1e42a2691" }

[build-dependencies]
yansi = "0.5"
version_check = "0.9.1"

[dev-dependencies]
rocket = { version = "0.5.0-dev", path = "../../core/lib" }
rocket_contrib = { version = "0.5.0-dev", path = "../lib", features = ["diesel_sqlite_pool"] }

This file was deleted.

@@ -9,7 +9,6 @@ repository = "https://github.com/SergioBenitez/Rocket"
readme = "../../README.md"
keywords = ["rocket", "web", "framework", "code", "generation"]
license = "MIT OR Apache-2.0"
build = "build.rs"
edition = "2018"

[lib]
@@ -22,10 +21,6 @@ rocket_http = { version = "0.5.0-dev", path = "../http/" }
devise = { git = "https://github.com/SergioBenitez/Devise.git", rev = "1e42a2691" }
glob = "0.3"

[build-dependencies]
yansi = "0.5"
version_check = "0.9.1"

[dev-dependencies]
rocket = { version = "0.5.0-dev", path = "../lib" }
version_check = "0.9"

This file was deleted.

@@ -1,34 +1,21 @@
//! Ensures Rocket isn't compiled with an incompatible version of Rust.

use yansi::{Paint, Color::{Red, Yellow, Blue}};
use yansi::{Paint, Color::{Red, Yellow}};

// Specifies the minimum nightly version needed to compile Rocket.

const MIN_DATE: &'static str = "2020-05-20";
const MIN_VERSION: &'static str = "1.45.0-nightly";
const MIN_VERSION: &'static str = "1.45.0";

macro_rules! err {
($version:expr, $date:expr, $msg:expr) => (
($version:expr, $msg:expr) => (
eprintln!("{} {}", Red.paint("Error:").bold(), Paint::new($msg).bold());
eprintln!("Installed version: {}", Yellow.paint(format!("{} ({})", $version, $date)));
eprintln!("Minimum required: {}", Yellow.paint(format!("{} ({})", MIN_VERSION, MIN_DATE)));
eprintln!("Installed version: {}", Yellow.paint(format!("{}", $version)));
eprintln!("Minimum required: {}", Yellow.paint(format!("{}", MIN_VERSION)));
)
}

fn main() {
if let Some((version, channel, date)) = version_check::triple() {
if !channel.supports_features() {
err!(version, date, "Rocket (core) requires a 'dev' or 'nightly' version of rustc.");

eprint!("{}", Blue.paint("See the getting started guide ("));
eprint!("https://rocket.rs/v0.5/guide/getting-started/");
eprintln!("{}", Blue.paint(") for more information."));

panic!("Aborting compilation due to incompatible compiler.")
}

if !version.at_least(MIN_VERSION) || !date.at_least(MIN_DATE) {
err!(version, date, "Rocket (core) requires a more recent version of rustc.");
if let Some(version) = version_check::Version::read() {
if !version.at_least(MIN_VERSION) {
err!(version, "Rocket requires a more recent version of rustc.");
panic!("Aborting compilation due to incompatible compiler.")
}
} else {

7 comments on commit 56a6172

@patchin
Copy link

@patchin patchin commented on 56a6172 Jul 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woot!

@macpp
Copy link

@macpp macpp commented on 56a6172 Jul 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@EstebanBorai
Copy link

@EstebanBorai EstebanBorai commented on 56a6172 Jul 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉🎉🎉🎉🎉
I will update right now!
thanks!

@nicolaiunrein
Copy link

@nicolaiunrein nicolaiunrein commented on 56a6172 Jul 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome!

@admwrd
Copy link

@admwrd admwrd commented on 56a6172 Jul 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, Sergio, Jeb, and all of the other people who have contributed to Rocket being the awesome and fun framework that it is!

@hi-rustin
Copy link

@hi-rustin hi-rustin commented on 56a6172 Jul 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

@kiyoakii
Copy link

@kiyoakii kiyoakii commented on 56a6172 Jul 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! 🎉🎉

Please sign in to comment.