Skip to content

[rust] Allow developers to develop Rust functions on Windows#14439

Closed
Zxilly wants to merge 2 commits intovercel:mainfrom
Zxilly:main
Closed

[rust] Allow developers to develop Rust functions on Windows#14439
Zxilly wants to merge 2 commits intovercel:mainfrom
Zxilly:main

Conversation

@Zxilly
Copy link
Copy Markdown
Contributor

@Zxilly Zxilly commented Dec 8, 2025

Previously, the runtime failed to compile on Windows due to the std::os::unix::net::UnixStream referenced in the IPC module. However, it appears IPC is only utilized in Vercel's production environment and is unnecessary during local development. This patch resolves the issue by isolating IPC-related logic into conditional compilation specific to Unix systems.

@ecklf plz review this

@Zxilly Zxilly requested a review from a team as a code owner December 8, 2025 21:53
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Dec 8, 2025

⚠️ No Changeset found

Latest commit: b138f17

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ecklf
Copy link
Copy Markdown
Member

ecklf commented Jan 21, 2026

Will check this week, thanks 👏

@ecklf
Copy link
Copy Markdown
Member

ecklf commented Jan 26, 2026

@Zxilly I suppose the agent review comment is valid?

@ecklf
Copy link
Copy Markdown
Member

ecklf commented Jan 26, 2026

Suggesting the following changes:

diff --git a/crates/vercel_runtime/src/lib.rs b/crates/vercel_runtime/src/lib.rs
index d801f119a..74be1d3d1 100644
--- a/crates/vercel_runtime/src/lib.rs
+++ b/crates/vercel_runtime/src/lib.rs
@@ -9,34 +9,31 @@ use std::task::{Context, Poll};
 use tokio::net::TcpListener;
 use tower::Service;
 
-#[cfg(unix)]
-use {
-    std::env,
-    std::os::unix::net::UnixStream,
-    std::sync::atomic::Ordering,
-    std::sync::{Arc, Mutex},
-};
-
 pub use hyper::Response;
 pub use types::{Error, ResponseBody};
 pub type Request = hyper::Request<hyper::body::Incoming>;
 
-#[cfg(unix)]
-use {
-  crate::ipc::core::{EndMessage, StartMessage},
-  crate::ipc::log::{Level, LogMessage},
-  crate::ipc_utils::{
-      enqueue_or_send_message, flush_init_log_buffer, send_message, IPC_READY,
-  },
-};
-
 #[cfg(feature = "axum")]
 pub mod axum;
 
+#[cfg(unix)]
+mod ipc;
+#[cfg(unix)]
+mod ipc_utils;
 mod types;
 
 use crate::types::IntoFunctionResponse;
 
+#[cfg(unix)]
+use {
+    crate::ipc::core::{EndMessage, StartMessage},
+    crate::ipc::log::{Level, LogMessage},
+    crate::ipc_utils::{IPC_READY, enqueue_or_send_message, flush_init_log_buffer, send_message},
+    std::env,
+    std::os::unix::net::UnixStream,
+    std::sync::atomic::Ordering,
+    std::sync::{Arc, Mutex},
+};
 
 #[cfg(unix)]
 #[derive(Clone)]

@ecklf
Copy link
Copy Markdown
Member

ecklf commented Jan 26, 2026

I think as a follow-up we'd also need a change to the builder script to prevent compiling production prebuilt deployments and/or we find an alternative in how we can also make things compatible for windows. But I am fine shipping this to unblock you for now.

@ecklf
Copy link
Copy Markdown
Member

ecklf commented Jan 26, 2026

I'll be creating a new PR as we need to publish a new package version / update codeowners based on your changes.

#14724

@ecklf ecklf closed this Jan 26, 2026
ecklf added a commit that referenced this pull request Jan 26, 2026
Based on #14439

Adds the following in addition:
* Disabling prebuilt deployments for production on Windows
* Bumps version
* Updates codeowners for rust-related packages

---------

Co-authored-by: Zxilly <zxilly@outlook.com>
@ecklf
Copy link
Copy Markdown
Member

ecklf commented Jan 26, 2026

The new packages have been released. However, it may take some time for the builder changes to propagate upstream to the live Vercel builds. But the main issue of this PR should be unblocked.

@ecklf ecklf reopened this Jan 26, 2026
@ecklf ecklf requested a review from a team as a code owner January 26, 2026 16:43
@ecklf ecklf closed this Jan 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants