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

Update rust to 2025-01-15 #3021

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions mirrord/agent/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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-15 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-15 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
Expand All @@ -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-15 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
Expand Down
16 changes: 8 additions & 8 deletions mirrord/agent/src/steal/orig_dst.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions mirrord/cli/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ RUN cargo install [email protected]
FROM chef AS planner

COPY . /build/
RUN cargo +nightly-2024-10-11 chef prepare --recipe-path recipe.json
RUN cargo +nightly-2025-01-15 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-15 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-15 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

Expand Down
6 changes: 2 additions & 4 deletions mirrord/intproxy/src/proxies/outgoing/net_protocol_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,13 @@
"failed to send all bytes",
))?;
}

Check warning on line 205 in mirrord/intproxy/src/proxies/outgoing/net_protocol_ext.rs

View workflow job for this annotation

GitHub Actions / lint

Diff in /home/runner/work/mirrord/mirrord/mirrord/intproxy/src/proxies/outgoing/net_protocol_ext.rs
Ok(())
}
InnerConnectedSocket::TcpStream(stream) => {
stream.write_all(bytes).await.map_err(Into::into)
}
stream.write_all(bytes).await}
InnerConnectedSocket::UnixStream(stream) => {
stream.write_all(bytes).await.map_err(Into::into)
}
stream.write_all(bytes).await}
}
}

Expand Down
2 changes: 1 addition & 1 deletion mirrord/kube/src/api/container/targetless.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ where
}
}

impl<'c, T> ContainerApi<JobVariant<T>> for Targetless<'c, JobVariant<T>>
impl<T> ContainerApi<JobVariant<T>> for Targetless<'_, JobVariant<T>>
where
T: ContainerVariant<Update = Pod>,
{
Expand Down
2 changes: 1 addition & 1 deletion mirrord/layer/src/debugger_ports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<u16>().ok())
.map(|port| SocketAddr::new(IpAddr::V4(Ipv4Addr::LOCALHOST), port))
} else {
Expand Down
6 changes: 4 additions & 2 deletions mirrord/layer/src/file/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,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:?}",
);
}
}
Expand Down
1 change: 0 additions & 1 deletion mirrord/operator/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,6 @@ where
layer_config.kube_context.clone(),
)
.await
.map_err(KubeApiError::from)
.map_err(OperatorApiError::CreateKubeClient)?;

client_config.headers.push((
Expand Down
2 changes: 1 addition & 1 deletion mirrord/protocol/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mirrord-protocol"
version = "1.13.3"
version = "1.13.4"
authors.workspace = true
description.workspace = true
documentation.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion mirrord/protocol/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@
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,

Check failure on line 321 in mirrord/protocol/src/error.rs

View workflow job for this annotation

GitHub Actions / check-rust-docs

no variant or associated item named `QuotaExceeded` found for enum `ErrorKind` in the current scope

Check failure on line 321 in mirrord/protocol/src/error.rs

View workflow job for this annotation

GitHub Actions / macos_tests

no variant or associated item named `QuotaExceeded` found for enum `std::io::ErrorKind` in the current scope
io::ErrorKind::FileTooLarge => ErrorKindInternal::FileTooLarge,
io::ErrorKind::ResourceBusy => ErrorKindInternal::ResourceBusy,
io::ErrorKind::ExecutableFileBusy => ErrorKindInternal::ExecutableFileBusy,
Expand Down
6 changes: 2 additions & 4 deletions mirrord/vpn/src/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ impl VpnAgent {
_ => None,
},
)
.await
.map_err(VpnError::from)?
.await?
else {
return Err(VpnError::AgentUnexpectedResponse);
};
Expand Down Expand Up @@ -79,8 +78,7 @@ impl VpnAgent {
_ => None,
},
)
.await
.map_err(VpnError::from)?;
.await?;

match response {
Some(ServerVpn::NetworkConfiguration(network)) => Ok(network),
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "nightly-2024-10-11"
channel = "nightly-2025-01-15"
components = [ "rustfmt", "clippy", "rustc" ]
profile = "minimal"
Loading