Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document and enforce minimum rustc requirement of 1.49.0 #266

Merged
merged 1 commit into from
May 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- update `nng` dependency for optional `gaggle` feature
- simplify `examples/umami` regex when parsing form
- allow configuration of algorithm for allocating `GooseTask`s the same as `GooseTaskSet`s; `GooseTaskSetScheduler` becomes more generically `GooseScheduler`
- specify (and detect) minimum `rustc` requirement of `1.49.0`, due to `flume` dependency which in turn depends on `spinning_top` which uses `hint::spin_loop` which stabilized in `rustc` version `1.49.0

## 0.11.0 April 9, 2021
- capture errors and count frequency for each, including summary in metrics report; optionally disable with `--no-error-summary`
Expand Down
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ default = ["reqwest/default-tls"]
gaggle = ["nng"]
rustls = ["reqwest/rustls-tls"]

[build-dependencies]
rustc_version = "0.3"

[dev-dependencies]
httpmock = "0.5"
serial_test = "0.5"
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ Goose is a Rust load testing tool inspired by [Locust](https://locust.io/). User
- [Gaggle: a distributed load test](https://www.tag1consulting.com/blog/show-me-how-flock-flies-working-gaggle-goose)
- [Optimizing Goose performance](https://www.tag1consulting.com/blog/golden-goose-egg-compile-time-adventure)

### Requirements

- Minimum required `rustc` version is `1.49.0`: `goose` depends on [`flume`](https://docs.rs/flume) for communication between threads, which in turn depends on [`spinning_top`](https://docs.rs/spinning_top) which uses `hint::spin_loop` which stabilized in `rustc` version `1.49.0`. More detail in https://github.com/rust-lang/rust/issues/55002.

## Getting Started

The [in-line documentation](https://docs.rs/goose/*/goose/#creating-a-simple-goose-load-test) offers much more detail about Goose specifics. For a general background to help you get started with Rust and Goose, read on.
Expand Down
22 changes: 22 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
use rustc_version::{version, Version};
use std::io::{self, Write};
use std::process::exit;

fn main() {
// Goose can only be compiled with rustc version 1.49.0 or greater.
if version().expect("failed to determine rustc version")
< Version::parse("1.49.0").expect("failed to parse minimum required version")
{
writeln!(&mut io::stderr(), "goose dependency `flume` depends on `spinning_top` crate which requires rustc >= 1.49.0.").expect("failed to write to stderr");
writeln!(
&mut io::stderr(),
"detected rustc version: {}",
version().expect("failed to determine rustc version")
)
.expect("failed to write to stderr");
writeln!(&mut io::stderr(), "note: see issue #55002 <https://github.com/rust-lang/rust/issues/55002> for more information").expect("failed to write to stderr");
// Exit to avoid a more confusing error message and simplify debugging if
// trying to build Goose with an unsupported version of rustc.
exit(1);
}
}