Skip to content

Commit 814fb2b

Browse files
antiguruart049
andauthored
chore: bump dependency versions and move to Rust 1.80 (#47)
* Bump dependency versions, move to Rust 1.80 Update the version of dependencies to current versions, and move to Rust 1.80. Currently, the crate cannot be compiled on anything newer than Rust 1.77 because that's the latest version supported by the previous cargo dependency. Updating it to a more recent version fixes compile problems that appear within gix. Signed-off-by: Moritz Hoffmann <[email protected]> * chore: bump clap to 4.5.17 * chore: allow cfg(codspeed) with the check-cfg lint --------- Signed-off-by: Moritz Hoffmann <[email protected]> Co-authored-by: Arthur Pastel <[email protected]>
1 parent 6b96b80 commit 814fb2b

File tree

10 files changed

+938
-742
lines changed

10 files changed

+938
-742
lines changed

Cargo.lock

+900-710
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/bencher_compat/build.rs

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn main() {
2+
println!("cargo::rustc-check-cfg=cfg(codspeed)");
3+
}

crates/cargo-codspeed/Cargo.toml

+10-10
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ categories = [
1818
keywords = ["codspeed", "benchmark", "cargo"]
1919

2020
[dependencies]
21-
cargo = "0.78.1"
22-
clap = { version = "=4.5.4", features = ["derive"] }
23-
termcolor = "1.0"
24-
anyhow = "1.0.66"
25-
itertools = "0.10.5"
26-
anstyle = "1.0.6"
21+
cargo = "0.81.0"
22+
clap = { version = "=4.5.17", features = ["derive"] }
23+
termcolor = "1.4"
24+
anyhow = "1.0.86"
25+
itertools = "0.13.0"
26+
anstyle = "1.0.8"
2727

2828
[dev-dependencies]
29-
assert_cmd = "2.0.7"
30-
fs_extra = "1.2.0"
31-
predicates = "2.1.4"
32-
uuid = { version = "1.2.2", features = ["v4"] }
29+
assert_cmd = "2.0.15"
30+
fs_extra = "1.3.0"
31+
predicates = "3.1.2"
32+
uuid = { version = "1.10.0", features = ["v4"] }
3333

3434
[features]
3535
vendored-openssl = ["cargo/vendored-openssl"]

crates/cargo-codspeed/src/app.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::{ffi::OsString, process::exit};
33
use crate::helpers::style;
44
use crate::{prelude::*, run::run_benches};
55

6-
use cargo::Config;
6+
use cargo::GlobalContext;
77
use cargo::{ops::Packages, util::important_paths::find_root_manifest_for_wd};
88
use clap::{Args, Parser, Subcommand};
99

@@ -58,11 +58,11 @@ enum Commands {
5858
},
5959
}
6060

61-
pub fn get_cargo_config() -> Result<Config> {
61+
pub fn get_cargo_config() -> Result<GlobalContext> {
6262
let mut rustflags = std::env::var("RUSTFLAGS").unwrap_or_else(|_| "".into());
6363
rustflags.push_str(" -g --cfg codspeed");
6464
std::env::set_var("RUSTFLAGS", &rustflags);
65-
Config::default()
65+
GlobalContext::default()
6666
}
6767

6868
pub fn run(args: impl Iterator<Item = OsString>) -> Result<()> {
@@ -104,7 +104,7 @@ pub fn run(args: impl Iterator<Item = OsString>) -> Result<()> {
104104
};
105105

106106
if let Err(e) = res {
107-
ws.config()
107+
ws.gctx()
108108
.shell()
109109
.status_with_color("Error", e.to_string(), &style::ERROR)?;
110110
exit(1);

crates/cargo-codspeed/src/build.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ use cargo::{
99
core::{FeatureValue, Package, Target, Verbosity, Workspace},
1010
ops::{CompileFilter, CompileOptions, Packages},
1111
util::{command_prelude::CompileMode, interning::InternedString},
12-
Config,
12+
GlobalContext,
1313
};
1414

1515
fn get_compile_options(
16-
config: &Config,
16+
config: &GlobalContext,
1717
features: &Option<Vec<String>>,
1818
profile: &str,
1919
package: &Package,
@@ -90,8 +90,8 @@ pub fn build_benches(
9090

9191
let actual_benches_count = benches_to_build.len();
9292

93-
ws.config().shell().set_verbosity(Verbosity::Normal);
94-
ws.config().shell().status_with_color(
93+
ws.gctx().shell().set_verbosity(Verbosity::Normal);
94+
ws.gctx().shell().status_with_color(
9595
"Collected",
9696
format!(
9797
"{} benchmark suite(s) to build{}",
@@ -108,7 +108,7 @@ pub fn build_benches(
108108
&style::TITLE,
109109
)?;
110110

111-
let config = ws.config();
111+
let context = ws.gctx();
112112
let codspeed_root_target_dir = get_codspeed_target_dir(ws);
113113
// Create and clear packages target directories
114114
for package in packages_to_build.iter() {
@@ -118,15 +118,15 @@ pub fn build_benches(
118118
}
119119
let mut built_benches = 0;
120120
for bench in benches_to_build.iter() {
121-
ws.config().shell().status_with_color(
121+
ws.gctx().shell().status_with_color(
122122
"Building",
123123
format!("{} {}", bench.package.name(), bench.target.name()),
124124
&style::ACTIVE,
125125
)?;
126126
let is_root_package = ws.current_opt().map_or(false, |p| p == bench.package);
127127
let benches_names = vec![bench.target.name()];
128128
let compile_opts = get_compile_options(
129-
config,
129+
context,
130130
&features,
131131
&profile,
132132
bench.package,
@@ -158,7 +158,7 @@ pub fn build_benches(
158158
Please add a benchmark target to your Cargo.toml"
159159
);
160160
}
161-
ws.config().shell().status_with_color(
161+
ws.gctx().shell().status_with_color(
162162
"Finished",
163163
format!("built {} benchmark suite(s)", built_benches),
164164
&style::SUCCESS,

crates/cargo-codspeed/src/run.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ pub fn run_benches(
7676
} else {
7777
to_run = benches.iter().collect();
7878
}
79-
ws.config().shell().status_with_color(
79+
ws.gctx().shell().status_with_color(
8080
"Collected",
8181
format!("{} benchmark suite(s) to run", to_run.len()),
8282
&style::TITLE,
@@ -86,7 +86,7 @@ pub fn run_benches(
8686
// workspace_root is needed since file! returns the path relatively to the workspace root
8787
// while CARGO_MANIFEST_DIR returns the path to the sub package
8888
let workspace_root = ws.root().to_string_lossy();
89-
ws.config().shell().status_with_color(
89+
ws.gctx().shell().status_with_color(
9090
"Running",
9191
format!("{} {}", &bench.package_name, bench_name),
9292
&style::ACTIVE,
@@ -106,13 +106,13 @@ pub fn run_benches(
106106
))
107107
}
108108
})?;
109-
ws.config().shell().status_with_color(
109+
ws.gctx().shell().status_with_color(
110110
"Done",
111111
format!("running {}", bench_name),
112112
&style::SUCCESS,
113113
)?;
114114
}
115-
ws.config().shell().status_with_color(
115+
ws.gctx().shell().status_with_color(
116116
"Finished",
117117
format!("running {} benchmark suite(s)", to_run.len()),
118118
&style::SUCCESS,

crates/codspeed/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ keywords = ["codspeed", "benchmark"]
1919
[dependencies]
2020
colored = "2.0.0"
2121
libc = "^0.2"
22-
serde_json = "1.0.104"
22+
serde_json = "1.0.120"
2323

2424
[[bench]]
2525
name = "native"

crates/criterion_compat/Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ keywords = ["codspeed", "benchmark", "criterion"]
1818
[dependencies]
1919
criterion = { version = "0.5.1", default-features = false }
2020
codspeed = { path = "../codspeed", version = "=2.6.0" }
21-
colored = "2.0.0"
21+
colored = "2.1.0"
2222

2323
futures = { version = "0.3", default_features = false, optional = true }
24-
smol = { version = "1.2", default-features = false, optional = true }
25-
tokio = { version = "1.0", default-features = false, features = [
24+
smol = { version = "2.0", default-features = false, optional = true }
25+
tokio = { version = "1.39", default-features = false, features = [
2626
"rt",
2727
], optional = true }
28-
async-std = { version = "1.9", optional = true }
28+
async-std = { version = "1.12", optional = true }
2929

3030
[features]
3131
default = ["rayon", "plotters", "cargo_bench_support"]

crates/criterion_compat/build.rs

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn main() {
2+
println!("cargo::rustc-check-cfg=cfg(codspeed)");
3+
}

rust-toolchain.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[toolchain]
2-
channel = "1.77.2"
2+
channel = "1.80"

0 commit comments

Comments
 (0)