Skip to content

Commit

Permalink
Merge pull request #266 from jeremyandrews/minrust
Browse files Browse the repository at this point in the history
document and enforce minimum `rustc` requirement of `1.49.0`
  • Loading branch information
jeremyandrews authored May 15, 2021
2 parents 0e043d3 + 83d2e3c commit a9f3df9
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
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);
}
}

0 comments on commit a9f3df9

Please sign in to comment.