Skip to content
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
127 changes: 125 additions & 2 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -936,8 +936,130 @@ meld_fuse(
components = [":falcon-cascade-stream-composed"],
)

# ── cascade orchestrator — imports the five, exports `step` ───────
# No control-crate dep: the cascade is pure orchestration.
# ── falcon-core and its closure, as bazel rust_libraries (#397) ───
# //:falcon-cascade wraps falcon_core::FlightCore since #393. The CARGO build
# was updated; the BAZEL target was not, so it has not built since — and the
# meld_fuse + witness MC/DC coverage it feeds has produced nothing. These are
# the 12 crates of falcon-core's transitive closure that had no target yet
# (relay-math, relay-iekf and relay-mix-quad already had one).
#
# Deps mirror each crate's Cargo.toml [dependencies] exactly; they are
# generated from the manifests rather than hand-listed, because a bazel dep set
# that drifts from the cargo one is the same defect class this whole target is
# being repaired for.
rust_library(
name = "relay-geo",
srcs = glob(["crates/relay-geo/plain/src/**/*.rs"]),
edition = "2024",
deps = [
":relay-math",
],
)

rust_library(
name = "relay-adrc",
srcs = glob(["crates/relay-adrc/plain/src/**/*.rs"]),
edition = "2024",
deps = [
":relay-math",
],
)

rust_library(
name = "relay-fsm",
srcs = glob(["crates/relay-fsm/plain/src/**/*.rs"]),
edition = "2024",
)

rust_library(
name = "relay-preflight",
srcs = glob(["crates/relay-preflight/plain/src/**/*.rs"]),
edition = "2024",
)

rust_library(
name = "relay-calib",
srcs = glob(["crates/relay-calib/plain/src/**/*.rs"]),
edition = "2024",
)

rust_library(
name = "relay-batt",
srcs = glob(["crates/relay-batt/plain/src/**/*.rs"]),
edition = "2024",
)

rust_library(
name = "relay-flowrange",
srcs = glob(["crates/relay-flowrange/plain/src/**/*.rs"]),
edition = "2024",
deps = [
":relay-math",
],
)

rust_library(
name = "relay-notch",
srcs = glob(["crates/relay-notch/plain/src/**/*.rs"]),
edition = "2024",
deps = [
":relay-math",
],
)

rust_library(
name = "relay-log",
srcs = glob(["crates/relay-log/plain/src/**/*.rs"]),
edition = "2024",
)

rust_library(
name = "relay-param",
srcs = glob(["crates/relay-param/plain/src/**/*.rs"]),
edition = "2024",
)

rust_library(
name = "falcon-gnss-ubx",
srcs = glob(["crates/falcon-gnss-ubx/src/**/*.rs"]),
edition = "2024",
deps = [
"@embedded_io_async_crate//:embedded_io_async",
"@embedded_io_crate//:embedded_io",
],
)

rust_library(
name = "falcon-core",
srcs = glob(["crates/falcon-core/plain/src/**/*.rs"]),
edition = "2024",
deps = [
":falcon-gnss-ubx",
":relay-adrc",
":relay-batt",
":relay-calib",
":relay-flowrange",
":relay-fsm",
":relay-geo",
":relay-iekf",
":relay-log",
":relay-math",
":relay-mix-quad",
":relay-notch",
":relay-param",
":relay-preflight",
],
)

# ── cascade orchestrator — THE FLIGHT CORE, as one component ──────
# The comment that stood here said "No control-crate dep: the cascade is pure
# orchestration". That stopped being true at #393, when the component was
# rewritten to wrap falcon_core::FlightCore directly instead of composing five
# stage interfaces. The comment stayed and the dep was never added, so this
# target failed to build from #393 until #397 added the dep below.
#
# Past tense deliberately: a comment describing a CURRENT breakage is false the
# moment it is fixed, which is the very defect class this sentence records.
rust_wasm_component_bindgen(
name = "falcon-cascade",
crate_features = [
Expand All @@ -946,6 +1068,7 @@ rust_wasm_component_bindgen(
],
srcs = ["wasm/cm/cascade/src/lib.rs"],
wit = ":falcon_cascade_wit",
deps = [":falcon-core"],
profiles = ["release"],
)

Expand Down
49 changes: 49 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,55 @@ rust_library(
urls = ["https://static.crates.io/crates/libm/libm-0.2.16.crate"],
)

# embedded-io / embedded-io-async — the UBX driver's async byte-source bounds.
# Same treatment as libm above (http_archive, not crate_universe): both are pure
# no_std with no build script, embedded-io has NO dependencies and
# embedded-io-async depends only on embedded-io, so a single rust_library over
# src/ is the whole BUILD. They are here because //:falcon-cascade needs
# falcon-core, falcon-core needs falcon-gnss-ubx, and that is the only crate in
# the closure with an out-of-repo dependency (#397). sha256 values are the
# Cargo.lock checksums, which are the sha256 of the .crate tarball.
http_archive(
name = "embedded_io_crate",
build_file_content = """\
load("@rules_rust//rust:defs.bzl", "rust_library")

rust_library(
name = "embedded_io",
srcs = glob(["src/**/*.rs"]),
# lib.rs does `#![doc = include_str!("../README.md")]`, so the README has to
# be in the sandbox or the crate does not compile at all.
compile_data = ["README.md"],
edition = "2021",
visibility = ["//visibility:public"],
)
""",
sha256 = "9eb1aa714776b75c7e67e1da744b81a129b3ff919c8712b5e1b32252c1f07cc7",
strip_prefix = "embedded-io-0.7.1",
type = "tar.gz",
urls = ["https://static.crates.io/crates/embedded-io/embedded-io-0.7.1.crate"],
)

http_archive(
name = "embedded_io_async_crate",
build_file_content = """\
load("@rules_rust//rust:defs.bzl", "rust_library")

rust_library(
name = "embedded_io_async",
srcs = glob(["src/**/*.rs"]),
compile_data = ["README.md"],
edition = "2021",
deps = ["@embedded_io_crate//:embedded_io"],
visibility = ["//visibility:public"],
)
""",
sha256 = "2564b9f813c544241430e147d8bc454815ef9ac998878d30cc3055449f7fd4c0",
strip_prefix = "embedded-io-async-0.7.0",
type = "tar.gz",
urls = ["https://static.crates.io/crates/embedded-io-async/embedded-io-async-0.7.0.crate"],
)

# WASI WIT interfaces from rules_wasm_component
wasi_wit_ext = use_extension("@rules_wasm_component//wasm:extensions.bzl", "wasi_wit")
wasi_wit_ext.init()
Expand Down
Loading
Loading