Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
10 changes: 0 additions & 10 deletions Cargo.lock

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

32 changes: 32 additions & 0 deletions Cross.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Local cross-compile config for dec-bench harness tests.
# CI uses manylinux_2_28 directly; this is the convenience path for
# `cross build --target aarch64-unknown-linux-gnu -p moose-cli`.
[build.env]
# Tell openssl-sys to link the system OpenSSL 1.1 inside the container
# instead of vendoring OpenSSL 3.5.5. The vendored build strips deprecated
# symbols (SSL_get_peer_certificate), which librdkafka still calls — so the
# link fails. Using the system lib keeps both old and new names available.
passthrough = ["OPENSSL_LIB_DIR", "OPENSSL_INCLUDE_DIR", "OPENSSL_STATIC"]
Comment thread
callicles marked this conversation as resolved.
Outdated

[target.aarch64-unknown-linux-gnu]
# The pinned 0.2.5 image ships libssl 1.0.0, which lacks SSL_get_peer_certificate
# as an exported symbol and fails librdkafka's final link. `:main` is Ubuntu
# 20.04 with libssl 1.1.1, which has the symbol.
image = "ghcr.io/cross-rs/aarch64-unknown-linux-gnu:main"
Comment thread
callicles marked this conversation as resolved.
# cross's /opt/toolchain.cmake pins CMAKE_FIND_ROOT_PATH to /usr/aarch64-linux-gnu
# (sysroot layout), but apt multiarch installs arm64 libs to
# /usr/lib/aarch64-linux-gnu (Debian layout). rdkafka-sys's cmake build of
# librdkafka does FIND_PACKAGE(ZLIB) / FIND_PACKAGE(OpenSSL) and can't see
# across that gap — so we symlink the multiarch lib/headers into the sysroot.
pre-build = [
"dpkg --add-architecture arm64",
"apt-get update",
"apt-get install -y --no-install-recommends protobuf-compiler libprotobuf-dev cmake pkg-config zlib1g-dev:arm64 libssl-dev:arm64",
"mkdir -p /usr/aarch64-linux-gnu/lib /usr/aarch64-linux-gnu/include",
"ln -sf /usr/lib/aarch64-linux-gnu/libz.so /usr/aarch64-linux-gnu/lib/libz.so",
"ln -sf /usr/lib/aarch64-linux-gnu/libz.a /usr/aarch64-linux-gnu/lib/libz.a",
"ln -sf /usr/include/zlib.h /usr/aarch64-linux-gnu/include/zlib.h",
"ln -sf /usr/include/zconf.h /usr/aarch64-linux-gnu/include/zconf.h",
"for f in libssl.so libssl.a libcrypto.so libcrypto.a; do ln -sf /usr/lib/aarch64-linux-gnu/$f /usr/aarch64-linux-gnu/lib/$f; done",
"ln -sfn /usr/include/openssl /usr/aarch64-linux-gnu/include/openssl",
Comment thread
callicles marked this conversation as resolved.
]
2 changes: 1 addition & 1 deletion apps/framework-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ posthog514client-rs = { path = "../../packages/posthog514client-rs" }
# Remove this fork once upstream adds dialect-aware serialization.
sqlparser = { git = "https://github.com/514-labs/datafusion-sqlparser-rs", rev = "f84bd06", features = ["visitor"] }
itertools = "0.13.0"
openssl = { version = "0.10", features = ["vendored"] }
openssl = { version = "0.10" }
clap = { version = "4.3.17", features = ["derive"] }
tokio = { version = "1", features = ["full"] }
thiserror = "1.0.59"
Expand Down
6 changes: 5 additions & 1 deletion apps/framework-cli/src/cli/local_webserver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2698,7 +2698,11 @@ impl Webserver {
.await
.unwrap_or_else(|e| handle_listener_err(management_socket.port(), e));

// Check if proxy port is available
// Defense in depth: quick bind-and-drop on proxy_port so Docker-mode
// users get a clear error before the Node worker spawns. The
// --dockerless path also runs a structured preflight in
// NativeInfraProvider::start that covers this port alongside the
// embedded-infra ports.
let proxy_socket = self.get_socket(project.http_server_config.proxy_port).await;
TcpListener::bind(proxy_socket)
.await
Expand Down
3 changes: 3 additions & 0 deletions apps/framework-cli/src/utilities/native_infra/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,7 @@ pub enum NativeInfraError {

#[error("health check failed for {service}: {reason}")]
HealthCheck { service: String, reason: String },

#[error("{0}")]
PortConflict(#[from] super::preflight::PortConflictError),
}
14 changes: 14 additions & 0 deletions apps/framework-cli/src/utilities/native_infra/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pub mod clickhouse;
pub mod devkafka;
pub mod devredis;
pub mod errors;
pub mod preflight;
pub mod temporal;

use crate::cli::display::{with_spinner_completion, with_timing, Message};
Expand Down Expand Up @@ -126,6 +127,19 @@ impl InfraProvider for NativeInfraProvider {
}

fn start(&self, project: &Project) -> Result<(), RoutineFailure> {
// Preflight: surface EADDRINUSE in a single actionable message before
// anything starts. Prevents the Node consumption worker from entering
// an unbounded restart loop when a prior `moose dev --dockerless` is
// still holding ports 4001 / 6379 / 19092.
let specs = preflight::port_specs_for(
project,
self.scripts_enabled,
/* include_webserver = */ true,
Comment thread
callicles marked this conversation as resolved.
Outdated
);
preflight::check_ports(&specs, &preflight::native_dir_for(project))
.map_err(NativeInfraError::from)
.map_err(Self::map_native_err)?;

// Start embedded devredis (Redis needed early for leadership/presence)
let devredis_handle = with_timing("Start devredis", || {
with_spinner_completion(
Expand Down
Loading
Loading