Skip to content

Commit 3b3f734

Browse files
authored
build: bump MSRV from 1.78 to 1.84 (#1068)
* build: bump MSRV from 1.78 to 1.84 * build: upgrade nextest to handle link failure * style: clippy uninlined_format_args, ptr_eq * test: since it's cfg'd, don't use ignore
1 parent 6b73967 commit 3b3f734

File tree

15 files changed

+28
-31
lines changed

15 files changed

+28
-31
lines changed

.github/workflows/coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: Install cargo-llvm-cov
2929
uses: taiki-e/install-action@2c41309d51ede152b6f2ee6bf3b71e6dc9a8b7df # 2.49.27
3030
with:
31-
31+
3232
- name: Generate code coverage (including doc tests)
3333
run: |
3434
cargo llvm-cov --all-features --workspace --no-report nextest

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
strategy:
3131
fail-fast: false
3232
matrix:
33-
rust_version: ["1.78.0", "stable", "nightly-2024-12-16"]
33+
rust_version: ["1.84.1", "stable", "nightly-2024-12-16"]
3434
platform: [windows-latest, ubuntu-latest]
3535
steps:
3636
- name: Checkout sources
@@ -48,7 +48,7 @@ jobs:
4848
export AWS_LC_FIPS_SYS_NO_ASM=1
4949
fi
5050
# shellcheck disable=SC2046
51-
cargo clippy --workspace --all-targets --all-features -- -D warnings $([ ${{ matrix.rust_version }} = 1.78.0 ] || [ ${{ matrix.rust_version }} = stable ] && echo -Aunknown-lints -Ainvalid_reference_casting -Aclippy::redundant-closure-call)
51+
cargo clippy --workspace --all-targets --all-features -- -D warnings
5252
5353
licensecheck:
5454
runs-on: ubuntu-latest

.github/workflows/miri.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
rustup default nightly-2024-12-16
2222
- uses: taiki-e/install-action@2c41309d51ede152b6f2ee6bf3b71e6dc9a8b7df # 2.49.27
2323
with:
24-
24+
2525
- run: MIRIFLAGS="-Zmiri-disable-isolation" cargo miri nextest run --partition count:${{ matrix.partition }}/5
2626
# We need to disable isolation because
2727
# "unsupported operation: `clock_gettime` with `REALTIME` clocks not available when isolation is enabled"

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Test
22
on: [push]
33
env:
44
CARGO_TERM_COLOR: always
5-
RUST_VERSION: 1.78.0
5+
RUST_VERSION: 1.84.1
66

77
jobs:
88
test:
@@ -44,7 +44,7 @@ jobs:
4444
- name: Install cargo nextest
4545
uses: taiki-e/install-action@2c41309d51ede152b6f2ee6bf3b71e6dc9a8b7df # 2.49.27
4646
with:
47-
47+
4848
- name: "Remove nextest CI report"
4949
shell: bash
5050
run: rm -rf target/nextest/ci/junit.xml

.github/workflows/verify-proto-files.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55

66
env:
77
DATADOG_AGENT_TAG: "7.55.0-rc.3"
8-
rust_version: "1.78.0"
8+
rust_version: "1.84.1"
99

1010
jobs:
1111
verify-proto-files:

.gitlab/benchmarks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
variables:
2-
BASE_CI_IMAGE: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/benchmarking-platform:libdatadog-benchmarks
2+
BASE_CI_IMAGE: registry.ddbuild.io/ci/benchmarking-platform:libdatadog-benchmarks
33
# The Dockerfile to this image is located at:
44
# https://github.com/DataDog/benchmarking-platform/tree/libdatadog/benchmarks
55

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ members = [
4545
"datadog-log-ffi"
4646
]
4747

48-
# https://doc.rust-lang.org/cargo/reference/resolver.html#feature-resolver-version-2
48+
# https://doc.rust-lang.org/cargo/reference/resolver.html
4949
resolver = "2"
5050

5151
# These are used by many packages, but not all. For instance, the sidecar and
@@ -59,7 +59,7 @@ resolver = "2"
5959
# The RHEL restrictions are for the dd-trace-php repository. Someone in the
6060
# community, Remi Collet, packages the extension for these systems.
6161
[workspace.package]
62-
rust-version = "1.78.0"
62+
rust-version = "1.84.1"
6363
edition = "2021"
6464
version = "18.1.0"
6565
license = "Apache-2.0"

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ bash build-profiling-ffi.sh /opt/libdatadog
4949

5050
#### Build dependencies
5151

52-
- Rust 1.78.0 or newer with cargo. See the Cargo.toml for information about bumping this version.
52+
- Rust 1.84.1 or newer with cargo. See the Cargo.toml for information about bumping this version.
5353
- `cbindgen` 0.26
5454
- `cmake` and `protoc`
5555

@@ -66,7 +66,7 @@ cargo nextest run
6666
The simplest way to install [cargo-nextest][nt] is to use `cargo install` like this.
6767

6868
```bash
69-
cargo install --locked '[email protected].85'
69+
cargo install --locked '[email protected].96'
7070
```
7171

7272
#### Dev Containers
@@ -110,6 +110,4 @@ Tracing integration tests require docker to be installed and running. If you don
110110
cargo nextest run -E '!test(tracing_integration_tests::)'
111111
```
112112

113-
Please note that the locked version is to make sure that it can be built using rust `1.78.0`, and if you are using a newer rust version, then it's enough to limit the version to `0.9.*`.
114-
115113
[nt]: https://nexte.st/

datadog-alloc/src/virtual_alloc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ pub mod os {
108108
// akin to malloc.
109109
let result = unsafe { libc::mmap(null, len, prot, flags, -1, 0) };
110110

111-
if result == libc::MAP_FAILED {
111+
if ptr::eq(result, libc::MAP_FAILED) {
112112
return Err(AllocError);
113113
}
114114

ddcommon-ffi/src/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ pub trait ToHexStr {
3535

3636
impl ToHexStr for usize {
3737
fn to_hex_str(&self) -> String {
38-
format!("0x{:X}", self)
38+
format!("0x{self:X}")
3939
}
4040
}

ddcommon/src/hyper_migration.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ pub enum Error {
5050
impl fmt::Display for Error {
5151
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5252
match self {
53-
Error::Hyper(e) => write!(f, "hyper error: {}", e),
53+
Error::Hyper(e) => write!(f, "hyper error: {e}"),
5454
Error::Infallible(e) => match *e {},
55-
Error::Other(e) => write!(f, "other error: {}", e),
55+
Error::Other(e) => write!(f, "other error: {e}"),
5656
}
5757
}
5858
}

local-linux.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ WORKDIR /home/user
4747
# Install Rust toolchain for user in the usual ~/.cargo location
4848
# NOTE: Rust stable and nightly versions should be updated here whenever we bump the MSRV for libdatadog
4949
RUN su - user -c "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y"
50-
RUN su - user -c "cargo install --locked '[email protected].67'"
50+
RUN su - user -c "cargo install --locked '[email protected].96'"
5151
RUN su - user -c "rustup install nightly-2024-12-16"
52-
RUN su - user -c "bash -lc 'rustup default 1.78.0'"
52+
RUN su - user -c "bash -lc 'rustup default 1.84.1'"
5353

5454
# Use a different target to not interfere with the host which may be a different arch
5555
RUN echo 'export CARGO_TARGET_DIR=/libdatadog/docker-linux-target' >> /home/user/.bashrc

tests/spawn_from_lib/tests/spawn.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,13 @@ fn rewind_and_read(file: &mut std::fs::File) -> anyhow::Result<String> {
1515
Ok(buf)
1616
}
1717

18-
/// run with: RUSTFLAGS="-C prefer-dynamic" cargo test --package test_spawn_from_lib --features
19-
/// prefer-dynamic -- --ignored
18+
/// run with:
19+
/// ```bash
20+
/// RUSTFLAGS="-C prefer-dynamic" cargo test \
21+
/// --package test_spawn_from_lib \
22+
/// --features prefer-dynamic
23+
/// ```
2024
#[test]
21-
#[ignore = "requires -C prefer-dynamic"]
2225
#[cfg(feature = "prefer-dynamic")]
2326
fn test_spawning_trampoline_worker() {
2427
let mut stdout = tempfile::tempfile().unwrap();

tinybytes/src/lib.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,11 @@ impl Bytes {
130130

131131
assert!(
132132
start <= end,
133-
"range start must not be greater than end: {:?} > {:?}",
134-
start,
135-
end,
133+
"range start must not be greater than end: {start:?} > {end:?}"
136134
);
137135
assert!(
138136
end <= len,
139-
"range end must not be greater than length: {:?} > {:?}",
140-
end,
141-
len,
137+
"range end must not be greater than length: {end:?} > {len:?}"
142138
);
143139

144140
if end == start {

tools/docker/Dockerfile.build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG ALPINE_BASE_IMAGE="alpine:3.20.3"
1+
ARG ALPINE_BASE_IMAGE="alpine:3.22.0"
22
ARG CARGO_BUILD_INCREMENTAL="true"
33
ARG CARGO_NET_RETRY="2"
44
ARG BUILDER_IMAGE=debian_builder
@@ -7,7 +7,7 @@ ARG BUILDER_IMAGE=debian_builder
77
FROM rust:1-slim-buster AS debian_builder
88
ENV CARGO_HOME="/root/.cargo"
99
WORKDIR /build
10-
RUN cargo install cbindgen; mv /root/.cargo/bin/cbindgen /usr/bin/; rm -rf /root/.cargo
10+
RUN cargo install cbindgen && mv /root/.cargo/bin/cbindgen /usr/bin/ && rm -rf /root/.cargo
1111

1212
### Debian buildplatform builder
1313
FROM --platform=$BUILDPLATFORM rust:1-slim-buster AS debian_builder_platform_native

0 commit comments

Comments
 (0)