diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 54115cef62f..f0fe3181e5e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -151,7 +151,7 @@ jobs: - run: rm rust-toolchain.toml - uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: nightly-2024-10-11 + toolchain: nightly-2025-01-22 components: rustfmt, clippy target: aarch64-unknown-linux-gnu,x86_64-unknown-linux-gnu - uses: actions/setup-python@v5 # For http mirroring tests with Flask and FastAPI. @@ -193,7 +193,7 @@ jobs: repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: nightly-2024-10-11 + toolchain: nightly-2025-01-22 # TODO(alex): `no-deps` here due to an issue in `futures-util`. - run: cargo doc --document-private-items --no-deps @@ -210,7 +210,7 @@ jobs: repo-token: ${{ secrets.GITHUB_TOKEN }} # the setup rust toolchain action ignores the input if file exists.. so remove it - run: rm rust-toolchain.toml - - run: rustup default nightly-2024-10-11 + - run: rustup default nightly-2025-01-22 - name: test run: cargo test --target x86_64-unknown-linux-gnu -p mirrord-agent @@ -391,7 +391,7 @@ jobs: with: components: rustfmt, clippy target: aarch64-apple-darwin - toolchain: nightly-2024-10-11 + toolchain: nightly-2025-01-22 - name: Install Protoc uses: arduino/setup-protoc@v3 with: diff --git a/Cargo.lock b/Cargo.lock index 76ea7cf4306..a9a5e72661a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -584,9 +584,9 @@ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "aws-config" -version = "1.5.14" +version = "1.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f40e82e858e02445402906e454a73e244c7f501fcae198977585946c48e8697" +checksum = "dc47e70fc35d054c8fcd296d47a61711f043ac80534a10b4f741904f81e73a90" dependencies = [ "aws-credential-types", "aws-runtime", @@ -676,9 +676,9 @@ dependencies = [ [[package]] name = "aws-sdk-sqs" -version = "1.55.0" +version = "1.56.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2db64ffe78706b344b7c9b620f96c3c0655745e006b87bad20f424562656a0dd" +checksum = "ca6b2f438a99c189b89279ca88ed05c2bcdcfcacd7d78a821b8650166040b9b4" dependencies = [ "aws-credential-types", "aws-runtime", @@ -698,9 +698,9 @@ dependencies = [ [[package]] name = "aws-sdk-sso" -version = "1.55.0" +version = "1.56.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33993c0b054f4251ff2946941b56c26b582677303eeca34087594eb901ece022" +checksum = "12e057fdcb8842de9b83592a70f5b4da0ee10bc0ad278247da1425a742a444d7" dependencies = [ "aws-credential-types", "aws-runtime", @@ -720,9 +720,9 @@ dependencies = [ [[package]] name = "aws-sdk-ssooidc" -version = "1.56.0" +version = "1.57.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bd3ceba74a584337a8f3839c818f14f1a2288bfd24235120ff22d7e17a0dd54" +checksum = "a120ade4a44691b3c5c2ff2fa61b14ed331fdc218397f61ab48d66593012ae2a" dependencies = [ "aws-credential-types", "aws-runtime", @@ -742,9 +742,9 @@ dependencies = [ [[package]] name = "aws-sdk-sts" -version = "1.56.0" +version = "1.57.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07835598e52dd354368429cb2abf447ce523ea446d0a533a63cb42cd0d2d9280" +checksum = "115fd4fb663817ed595a5ee4f1649d7aacd861d47462323cb37576ce89271b93" dependencies = [ "aws-credential-types", "aws-runtime", @@ -1669,9 +1669,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" dependencies = [ "libc", ] @@ -4493,7 +4493,7 @@ dependencies = [ [[package]] name = "mirrord-protocol" -version = "1.16.0" +version = "1.16.1" dependencies = [ "actix-codec", "bincode", @@ -4857,9 +4857,9 @@ checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "openssl-probe" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" [[package]] name = "option-ext" @@ -6169,9 +6169,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.10.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2bf47e6ff922db3825eb750c4e2ff784c6ff8fb9e13046ef6a1d1c5401b0b37" +checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c" dependencies = [ "web-time", ] @@ -7650,9 +7650,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" +checksum = "11cd88e12b17c6494200a9c1b683a04fcac9573ed74cd1b62aeb2727c5592243" [[package]] name = "unicode-linebreak" diff --git a/changelog.d/+update-rust-2025-01-22.internal.md b/changelog.d/+update-rust-2025-01-22.internal.md new file mode 100644 index 00000000000..a280d4c2a3a --- /dev/null +++ b/changelog.d/+update-rust-2025-01-22.internal.md @@ -0,0 +1 @@ +Update rust nightly-2025-01-22. diff --git a/mirrord/agent/Dockerfile b/mirrord/agent/Dockerfile index e9de8df84d6..eb5006ac1dd 100644 --- a/mirrord/agent/Dockerfile +++ b/mirrord/agent/Dockerfile @@ -1,4 +1,4 @@ -FROM --platform=$BUILDPLATFORM ghcr.io/metalbear-co/ci-agent-build:193d12d5d8015c1ed60b9eda30c708cb9c4653e9 AS chef +FROM --platform=$BUILDPLATFORM ghcr.io/metalbear-co/ci-agent-build:602d397f8e2088ca6ef229e7da0f86490153d8b7 AS chef ARG TARGETARCH WORKDIR /app @@ -25,12 +25,12 @@ COPY Cargo.toml Cargo.lock CHANGELOG.md README.md LICENSE rust-toolchain.toml /a # so we remove from the workspace RUN sed -i '/members = \[/,/\]/c\members = [\n "mirrord/*",\n]' /app/Cargo.toml -RUN cargo +nightly-2024-10-11 chef prepare --recipe-path recipe.json +RUN cargo +nightly-2025-01-22 chef prepare --recipe-path recipe.json FROM chef AS builder COPY --from=planner /app/recipe.json recipe.json -RUN cargo +nightly-2024-10-11 chef cook --release --zigbuild --target $(cat /.platform) --recipe-path recipe.json +RUN cargo +nightly-2025-01-22 chef cook --release --zigbuild --target $(cat /.platform) --recipe-path recipe.json # Copy order is important here, since we want the cache to be invalidated as less as possible # so we start with the most static files, then the most dynamic ones @@ -44,7 +44,7 @@ COPY Cargo.toml Cargo.lock CHANGELOG.md README.md LICENSE rust-toolchain.toml /a # so we remove from the workspace RUN sed -i '/members = \[/,/\]/c\members = [\n "mirrord/*",\n]' /app/Cargo.toml -RUN cargo +nightly-2024-10-11 zigbuild -Z bindeps --manifest-path /app/mirrord/agent/Cargo.toml --target $(cat /.platform) --release +RUN cargo +nightly-2025-01-22 zigbuild -Z bindeps --manifest-path /app/mirrord/agent/Cargo.toml --target $(cat /.platform) --release RUN cp /app/target/$(cat /.platform)/release/mirrord-agent /mirrord-agent FROM ghcr.io/metalbear-co/ci-agent-runtime:latest diff --git a/mirrord/agent/src/steal/orig_dst.rs b/mirrord/agent/src/steal/orig_dst.rs index c0040b4270c..fbd6dc479ab 100644 --- a/mirrord/agent/src/steal/orig_dst.rs +++ b/mirrord/agent/src/steal/orig_dst.rs @@ -77,14 +77,14 @@ mod linux { let arr = sa.sin6_addr.s6_addr; let ip = Ipv6Addr::new( - (arr[0] as u16) << 8 | (arr[1] as u16), - (arr[2] as u16) << 8 | (arr[3] as u16), - (arr[4] as u16) << 8 | (arr[5] as u16), - (arr[6] as u16) << 8 | (arr[7] as u16), - (arr[8] as u16) << 8 | (arr[9] as u16), - (arr[10] as u16) << 8 | (arr[11] as u16), - (arr[12] as u16) << 8 | (arr[13] as u16), - (arr[14] as u16) << 8 | (arr[15] as u16), + ((arr[0] as u16) << 8) | (arr[1] as u16), + ((arr[2] as u16) << 8) | (arr[3] as u16), + ((arr[4] as u16) << 8) | (arr[5] as u16), + ((arr[6] as u16) << 8) | (arr[7] as u16), + ((arr[8] as u16) << 8) | (arr[9] as u16), + ((arr[10] as u16) << 8) | (arr[11] as u16), + ((arr[12] as u16) << 8) | (arr[13] as u16), + ((arr[14] as u16) << 8) | (arr[15] as u16), ); let port = sa.sin6_port; diff --git a/mirrord/cli/Dockerfile b/mirrord/cli/Dockerfile index 144f4a0e162..717d7209979 100644 --- a/mirrord/cli/Dockerfile +++ b/mirrord/cli/Dockerfile @@ -1,4 +1,4 @@ -FROM --platform=$BUILDPLATFORM ghcr.io/metalbear-co/ci-agent-build:193d12d5d8015c1ed60b9eda30c708cb9c4653e9 AS chef +FROM --platform=$BUILDPLATFORM ghcr.io/metalbear-co/ci-agent-build:602d397f8e2088ca6ef229e7da0f86490153d8b7 AS chef ARG TARGETARCH WORKDIR /build @@ -14,15 +14,15 @@ RUN cargo install cargo-chef@0.1.68 FROM chef AS planner COPY . /build/ -RUN cargo +nightly-2024-10-11 chef prepare --recipe-path recipe.json +RUN cargo +nightly-2025-01-22 chef prepare --recipe-path recipe.json FROM chef AS builder COPY --from=planner /build/recipe.json recipe.json -RUN cargo +nightly-2024-10-11 chef cook --release --zigbuild --target $(cat /.platform) --recipe-path recipe.json +RUN cargo +nightly-2025-01-22 chef cook --release --zigbuild --target $(cat /.platform) --recipe-path recipe.json COPY . /build/ -RUN cargo +nightly-2024-10-11 zigbuild -p mirrord -p mirrord-layer -Z bindeps --target $(cat /.platform) --release --locked +RUN cargo +nightly-2025-01-22 zigbuild -p mirrord -p mirrord-layer -Z bindeps --target $(cat /.platform) --release --locked RUN cp /build/target/$(cat /.platform)/release/mirrord /mirrord RUN cp /build/target/$(cat /.platform)/release/libmirrord_layer.so /libmirrord_layer.so diff --git a/mirrord/intproxy/src/proxies/outgoing/net_protocol_ext.rs b/mirrord/intproxy/src/proxies/outgoing/net_protocol_ext.rs index 348c0f168f2..09ea08ae45d 100644 --- a/mirrord/intproxy/src/proxies/outgoing/net_protocol_ext.rs +++ b/mirrord/intproxy/src/proxies/outgoing/net_protocol_ext.rs @@ -205,12 +205,8 @@ impl ConnectedSocket { Ok(()) } - InnerConnectedSocket::TcpStream(stream) => { - stream.write_all(bytes).await.map_err(Into::into) - } - InnerConnectedSocket::UnixStream(stream) => { - stream.write_all(bytes).await.map_err(Into::into) - } + InnerConnectedSocket::TcpStream(stream) => stream.write_all(bytes).await, + InnerConnectedSocket::UnixStream(stream) => stream.write_all(bytes).await, } } diff --git a/mirrord/kube/src/api/container/targetless.rs b/mirrord/kube/src/api/container/targetless.rs index 1a3cf65c771..b9ef25943e0 100644 --- a/mirrord/kube/src/api/container/targetless.rs +++ b/mirrord/kube/src/api/container/targetless.rs @@ -27,7 +27,7 @@ where } } -impl<'c, T> ContainerApi> for Targetless<'c, JobVariant> +impl ContainerApi> for Targetless<'_, JobVariant> where T: ContainerVariant, { diff --git a/mirrord/layer/src/debugger_ports.rs b/mirrord/layer/src/debugger_ports.rs index b465d3190a9..8f67896c47e 100644 --- a/mirrord/layer/src/debugger_ports.rs +++ b/mirrord/layer/src/debugger_ports.rs @@ -233,7 +233,7 @@ impl DebuggerType { .split(',') .find_map(|arg| arg.strip_prefix("address=")) }) - .and_then(|full_address| full_address.split(':').last()) + .and_then(|full_address| full_address.split(':').next_back()) .and_then(|port| port.parse::().ok()) .map(|port| SocketAddr::new(IpAddr::V4(Ipv4Addr::LOCALHOST), port)) } else { diff --git a/mirrord/layer/src/file/ops.rs b/mirrord/layer/src/file/ops.rs index 8ca2401101f..c47f7cad0d4 100644 --- a/mirrord/layer/src/file/ops.rs +++ b/mirrord/layer/src/file/ops.rs @@ -122,8 +122,10 @@ impl Drop for RemoteFile { // operation to complete. The write operation is hooked and at some point tries to lock // `OPEN_FILES`, which means the thread deadlocks with itself (we call // `OPEN_FILES.lock()?.remove()` and then while still locked, `OPEN_FILES.lock()` again) - Self::remote_close(self.fd).expect( - "mirrord failed to send close file message to main layer thread. Error: {err:?}", + let result = Self::remote_close(self.fd); + assert!( + result.is_ok(), + "mirrord failed to send close file message to main layer thread. Error: {result:?}", ); } } diff --git a/mirrord/operator/src/client.rs b/mirrord/operator/src/client.rs index 9550ddfe4b2..26f3d66e5b1 100644 --- a/mirrord/operator/src/client.rs +++ b/mirrord/operator/src/client.rs @@ -404,7 +404,6 @@ where layer_config.kube_context.clone(), ) .await - .map_err(KubeApiError::from) .map_err(OperatorApiError::CreateKubeClient)?; client_config.headers.push(( diff --git a/mirrord/protocol/Cargo.toml b/mirrord/protocol/Cargo.toml index 67eab572e62..7b491c83e85 100644 --- a/mirrord/protocol/Cargo.toml +++ b/mirrord/protocol/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mirrord-protocol" -version = "1.16.0" +version = "1.16.1" authors.workspace = true description.workspace = true documentation.workspace = true diff --git a/mirrord/protocol/src/error.rs b/mirrord/protocol/src/error.rs index 67197d76843..1047c9059cd 100644 --- a/mirrord/protocol/src/error.rs +++ b/mirrord/protocol/src/error.rs @@ -318,7 +318,7 @@ impl From for ErrorKindInternal { io::ErrorKind::WriteZero => ErrorKindInternal::WriteZero, io::ErrorKind::StorageFull => ErrorKindInternal::StorageFull, io::ErrorKind::NotSeekable => ErrorKindInternal::NotSeekable, - io::ErrorKind::FilesystemQuotaExceeded => ErrorKindInternal::FilesystemQuotaExceeded, + io::ErrorKind::QuotaExceeded => ErrorKindInternal::FilesystemQuotaExceeded, io::ErrorKind::FileTooLarge => ErrorKindInternal::FileTooLarge, io::ErrorKind::ResourceBusy => ErrorKindInternal::ResourceBusy, io::ErrorKind::ExecutableFileBusy => ErrorKindInternal::ExecutableFileBusy, diff --git a/mirrord/vpn/src/agent.rs b/mirrord/vpn/src/agent.rs index 3f145c421a0..bf3b97848d8 100644 --- a/mirrord/vpn/src/agent.rs +++ b/mirrord/vpn/src/agent.rs @@ -42,8 +42,7 @@ impl VpnAgent { _ => None, }, ) - .await - .map_err(VpnError::from)? + .await? else { return Err(VpnError::AgentUnexpectedResponse); }; @@ -79,8 +78,7 @@ impl VpnAgent { _ => None, }, ) - .await - .map_err(VpnError::from)?; + .await?; match response { Some(ServerVpn::NetworkConfiguration(network)) => Ok(network), diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 4451b59249b..a61307b6277 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "nightly-2024-10-11" +channel = "nightly-2025-01-22" components = [ "rustfmt", "clippy", "rustc" ] profile = "minimal" diff --git a/tests/rust-sqs-printer/Dockerfile b/tests/rust-sqs-printer/Dockerfile index f80966126ee..632c4711240 100644 --- a/tests/rust-sqs-printer/Dockerfile +++ b/tests/rust-sqs-printer/Dockerfile @@ -1,5 +1,5 @@ # Using the agent's build image, that has rustup targets, zigbuild etc. -FROM --platform=$BUILDPLATFORM ghcr.io/metalbear-co/ci-agent-build:193d12d5d8015c1ed60b9eda30c708cb9c4653e9 AS build-env +FROM --platform=$BUILDPLATFORM ghcr.io/metalbear-co/ci-agent-build:602d397f8e2088ca6ef229e7da0f86490153d8b7 AS build-env ARG TARGETARCH WORKDIR /build