Skip to content

[auto] Update Rust toolchain to 1.88.0 #218

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

Merged
merged 4 commits into from
Jul 1, 2025
Merged
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
8 changes: 8 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,5 +157,13 @@ jobs:
- name: Install dependencies
run: |
brew install autoconf automake libtool

- name: Update Rust to pinned version
run: |
RUST_VERSION=$(grep "FROM rust" Earthfile | awk -F'[:\\-]' '{print $2}')
echo ${RUST_VERSION}
rustup install ${RUST_VERSION}
rustup override set ${RUST_VERSION}

- name: Build lightway client on mac
run: cargo build --release -p lightway-client
7 changes: 0 additions & 7 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ARG --global debian = bookworm
IMPORT github.com/earthly/lib/rust:a49d2a0f4028cd15666d19904f8fc5fbd0b9ba87 AS lib-rust

install-build-dependencies:
FROM rust:1.87.0-$debian
FROM rust:1.88.0-$debian
WORKDIR /lightway
RUN dpkg --add-architecture arm64
RUN apt-get update -qq
Expand Down
4 changes: 2 additions & 2 deletions lightway-app-utils/examples/udprelay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ async fn build_tun(name: String) -> Result<Tun> {
}

async fn build_udp(port: u16, _peer: SocketAddr) -> Result<UdpSocket> {
let sockaddr = format!("0.0.0.0:{}", port);
let sockaddr = format!("0.0.0.0:{port}");
let sockaddr = sockaddr.parse::<SocketAddr>()?;
let sock = UdpSocket::bind(sockaddr).await?;
// Connected UDP socket makes app not receiving udp messages in some cases
Expand Down Expand Up @@ -123,7 +123,7 @@ trait TunAdapter: Sync + Send {
async fn main() -> Result<()> {
let args = Arguments::parse();

println!("Starting with {:?}", args);
println!("Starting with {args:?}");

let sock = build_udp(args.port, args.remote).await?;
let tun = build_tun(args.tun_name).await?;
Expand Down
1 change: 0 additions & 1 deletion lightway-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ workspace = true
[dependencies]
bytes.workspace = true
delegate.workspace = true
if_chain = "1.0.2"
lru = "0.14.0"
metrics.workspace = true
more-asserts.workspace = true
Expand Down
16 changes: 7 additions & 9 deletions lightway-core/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -876,15 +876,13 @@ impl<AppState: Send> Connection<AppState> {
return Err(ConnectionError::InvalidState);
}

if_chain::if_chain! {
if let Some(pmtu) = &self.pmtud;
if let Some((data_mps, frag_mps)) = pmtu.maximum_packet_sizes();
if pkt.len() > data_mps;
then {
self.send_fragmented_outside_data(pkt.clone().freeze(), frag_mps, is_encoded)
} else {
self.send_outside_data(pkt, is_encoded)
}
if let Some(pmtu) = &self.pmtud
&& let Some((data_mps, frag_mps)) = pmtu.maximum_packet_sizes()
&& pkt.len() > data_mps
{
self.send_fragmented_outside_data(pkt.clone().freeze(), frag_mps, is_encoded)
} else {
self.send_outside_data(pkt, is_encoded)
}
}

Expand Down
2 changes: 1 addition & 1 deletion lightway-core/src/connection/fragment_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ mod tests {
impl FragmentedPacket {
fn debug_string(&self) -> String {
let total_bytes: usize = self.fragments.iter().map(|f| f.size).sum();
let mut s = format!("{}: {{ ", total_bytes);
let mut s = format!("{total_bytes}: {{ ");
let frags: String = itertools::intersperse(
self.fragments.iter().map(Fragment::debug_string),
", ".to_string(),
Expand Down
4 changes: 2 additions & 2 deletions lightway-core/tests/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ async fn client<S: TestSock>(
let event_handler_handle = tokio::spawn(async move {
let client = event_client;
while let Some(event) = event_stream.next().await {
println!("Client state changed to {:?}", event);
println!("Client state changed to {event:?}");
match event {
Event::StateChanged(State::Online) => {
let mut client = client.lock().unwrap();
Expand Down Expand Up @@ -455,7 +455,7 @@ async fn client<S: TestSock>(
if event_handler_handle.is_finished() {
// Event handler returning early. Fatal error.
let result = event_handler_handle.await;
panic!("Event handler returning early. Fatal error. {:?}", result);
panic!("Event handler returning early. Fatal error. {result:?}");
}

tokio::select! {
Expand Down
Loading