mirror of
https://github.com/codewhale-hq/Codewhale.git
synced 2026-11-08 17:10:50 -10:00
Delete superseded Node-only extension-host resolution wrappers
The production host already uses resolve_extension_host_runtime; the last test consumer now explicitly selects Node through that same authority. Native Node/Bun host proof at6a4aeb passed10/0, actual missing-kernel-cap control failed0/1 and exact-restored handshake passed1/0. CI-policy Clippy found these two obsolete wrappers as dead production code; this removes them rather than allowing dead code. Focused shared-resolution and final lint verification follow; JS63/0 Bun and62/0 Node plus one Bun-only skip remain dated receipts, not platform parity. Signed-off-by: CodeWhale Bot <[email protected]>
This commit is contained in:
1 parent
6a4aeb89bb
commit
45e3d3a0eb
2 files changed
+10
-27
No files matched your search
@@ -305,13 +305,7 @@ pub struct NodeResolution {
|
||||
}
|
||||
|
||||
impl NodeResolution {
|
||||
/// One-line human summary of why no runtime was selected.
|
||||
#[must_use]
|
||||
pub fn describe_rejections(&self) -> String {
|
||||
self.describe_rejections_of("node")
|
||||
}
|
||||
|
||||
/// [`Self::describe_rejections`] for a runtime named `program`.
|
||||
/// One-line human summary of why runtime `program` was not selected.
|
||||
#[must_use]
|
||||
pub fn describe_rejections_of(&self, program: &str) -> String {
|
||||
if self.rejected.is_empty() {
|
||||
@@ -533,21 +527,6 @@ fn probe_runtime_version(kind: HostRuntimeKind, path: &Path) -> Result<(u32, u32
|
||||
.ok_or_else(|| format!("unrecognized version banner `{}`", banner.trim()))
|
||||
}
|
||||
|
||||
/// Resolve a Node.js runtime for the extension host by trying candidates in
|
||||
/// order and keeping the first that *runs* and meets the version floor:
|
||||
/// the `[extension_host] node` override, then every `node` on `PATH` (not
|
||||
/// only the first — a broken Homebrew node ahead of a working one is a real
|
||||
/// failure mode). Blocking: call from `spawn_blocking` in async code.
|
||||
///
|
||||
/// [`resolve_node`] keeps its single-probe contract for `js_execution`.
|
||||
#[must_use]
|
||||
pub fn resolve_node_for_extension_host(override_path: Option<&Path>) -> NodeResolution {
|
||||
select_runtime(
|
||||
HostRuntimeKind::Node,
|
||||
runtime_candidates(HostRuntimeKind::Node, override_path),
|
||||
)
|
||||
}
|
||||
|
||||
/// The override, then every `program` on `PATH`; for Bun also its default
|
||||
/// install location (`$BUN_INSTALL/bin`, else `~/.bun/bin`), which the Bun
|
||||
/// installer adds to shell profiles but a GUI-launched process may not see.
|
||||
|
||||
@@ -291,17 +291,21 @@ fn registry_enforces_schema_and_count_caps() {
|
||||
/// A Node for the integration tests, or `None` (skip) when there is none and
|
||||
/// the tests were not explicitly required.
|
||||
pub(crate) fn node_for_tests(test: &str) -> Option<PathBuf> {
|
||||
let resolution = crate::dependencies::resolve_node_for_extension_host(None);
|
||||
match resolution.selected {
|
||||
Some((path, _)) => Some(path),
|
||||
let resolution = crate::dependencies::resolve_extension_host_runtime(
|
||||
crate::config::ExtensionHostRuntime::Node,
|
||||
None,
|
||||
None,
|
||||
);
|
||||
match resolution.selected.as_ref() {
|
||||
Some(runtime) => Some(runtime.path.clone()),
|
||||
None if std::env::var_os("CODEWHALE_EXT_HOST_TESTS").is_some() => panic!(
|
||||
"{test}: CODEWHALE_EXT_HOST_TESTS is set but no Node ^22.19 || >=24 was found: {}",
|
||||
resolution.describe_rejections()
|
||||
resolution.failure()
|
||||
),
|
||||
None => {
|
||||
eprintln!(
|
||||
"skipping {test}: no Node ^22.19 || >=24 ({})",
|
||||
resolution.describe_rejections()
|
||||
resolution.failure()
|
||||
);
|
||||
None
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user