Skip to content

Conversation

@lionel-
Copy link
Contributor

@lionel- lionel- commented Oct 22, 2025

Closes #40888

This updates runtimed to the latest version, which handles the "starting" variant of execution_state. It actually handles a bunch of other variants that are not documented in the protocol (see https://jupyter-client.readthedocs.io/en/stable/messaging.html#kernel-status), like "starting", "terminating", etc. I added implementations for these variants as well.

Release Notes:

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Oct 22, 2025
request_headers.insert("x-zed-metrics-id", HeaderValue::from_str(&metrics_id)?);
}

#[cfg(any(target_os = "windows", target_os = "macos"))]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A build issue appeared with the update.

I don't understand the details here, but I fixed it following existing code at

#[cfg(any(target_os = "windows", target_os = "macos"))]
async fn https_connect<T>(
stream: T,
target: (&str, u16),
auth: Option<HttpProxyAuthorization<'_>>,
proxy_domain: &str,
) -> Result<Box<dyn AsyncReadWrite>>
where
T: AsyncReadWrite,
{
let tls_connector = TlsConnector::from(native_tls::TlsConnector::new()?);
let stream = tls_connector.connect(proxy_domain, stream).await?;
http_connect(stream, target, auth).await
}
#[cfg(not(any(target_os = "windows", target_os = "macos")))]
async fn https_connect<T>(
stream: T,
target: (&str, u16),
auth: Option<HttpProxyAuthorization<'_>>,
proxy_domain: &str,
) -> Result<Box<dyn AsyncReadWrite>>
where
T: AsyncReadWrite,
{
let proxy_domain = rustls_pki_types::ServerName::try_from(proxy_domain)
.context("Address resolution failed")?
.to_owned();
let tls_connector = TlsConnector::from(std::sync::Arc::new(http_client_tls::tls_config()));
let stream = tls_connector.connect(proxy_domain, stream).await?;
http_connect(stream, target, auth).await
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This seems reasonable, but so hard to know...

With my tin foil hat on I am convinced that there's a giant conspiracy by the authors of rust tls libraries to make it impossible to actually set up a project to use tls properly :D

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guh. Yeah.

Cargo.toml Outdated
jsonwebtoken = "9.3"
jupyter-protocol = { git = "https://github.com/ConradIrwin/runtimed", rev = "7130c804216b6914355d15d0b91ea91f6babd734" }
jupyter-websocket-client = { git = "https://github.com/ConradIrwin/runtimed" ,rev = "7130c804216b6914355d15d0b91ea91f6babd734" }
jupyter-protocol = { git = "https://github.com/runtimed/runtimed", rev = "2ba4b96a0d093ae957254b08487696f530ef1b65" }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conrad's PR (runtimed/runtimed#182) was merged so we should now be able to depend on the main repo.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this correspond to an actual released version? Looks like it's tagged with sidecar-v0.8.0, tag: runt-cli-v0.3.0. If so, can we switch back to non-git dependencies?

Copy link
Contributor Author

@lionel- lionel- Oct 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep! now updated to latest releases

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh, that seems to have broken the tls config

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there something we need to change in https://github.com/runtimed/runtimed to make this compatible?

"async-dispatcher-runtime",
runtimelib = { version = "0.29.0", default-features = false, features = [
"async-dispatcher-runtime", "ring"
] }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for doing this absolutely necessary maintenance work to bring Zed up to the latest.

Cargo.toml Outdated
runtimelib = { git = "https://github.com/ConradIrwin/runtimed", rev = "7130c804216b6914355d15d0b91ea91f6babd734", default-features = false, features = [
"async-dispatcher-runtime",
runtimelib = { version = "0.29.0", default-features = false, features = [
"async-dispatcher-runtime", "ring"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going to push up a change over to aws-lc-rs

@ConradIrwin
Copy link
Member

@lionel- Ok, we pushed some changes to runtimelib to make sure the feature flags for async-tungstenite match what we use in Zed, to avoid needing to change the tls setup.

Assuming this fixes the build issues, will merge.

@ConradIrwin ConradIrwin enabled auto-merge (squash) November 13, 2025 19:25
@ConradIrwin ConradIrwin merged commit fa0c750 into zed-industries:main Nov 13, 2025
23 checks passed
@rgbkrk
Copy link
Collaborator

rgbkrk commented Nov 13, 2025

Thanks @lionel- and @ConradIrwin!

@rgbkrk
Copy link
Collaborator

rgbkrk commented Nov 14, 2025

Tried it out this morning, it's looking great.

ark-kernel-zed.mp4
@lionel- lionel- deleted the bugfix/kernel-status branch November 17, 2025 16:23
11happy pushed a commit to 11happy/zed that referenced this pull request Dec 1, 2025
…ndustries#40889)

Closes zed-industries#40888

This updates runtimed to the latest version, which handles the
"starting" variant of `execution_state`. It actually handles a bunch of
other variants that are not documented in the protocol (see
https://jupyter-client.readthedocs.io/en/stable/messaging.html#kernel-status),
like "starting", "terminating", etc. I added implementations for these
variants as well.

Release Notes:

- Fixed issue that prevented the Ark kernel from working in Zed
(zed-industries#40888).

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

3 participants