Skip to content
Closed
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
1 change: 1 addition & 0 deletions Cargo.lock

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

11 changes: 11 additions & 0 deletions store-sqlite-plugin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,23 @@ license = "Apache-2.0"
# rlib: REQUIRED for `cargo test` to emit the cdylib artifact the conformance and e2e tests load.
crate-type = ["cdylib", "rlib"]

[features]
# THE DROPPED-IN DOOR: `export_door!` emits the one C symbol `busbar_plugin_door`, and ONLY the
# dropped-in cdylib may export it (compiled in = dropped in, one table: a busbar build that links
# this crate as a row, alone or beside others, must carry no door symbol, or two doors in one
# binary multiply define it under `lto = "fat"`). OFF by default; the dropped-in artifact is built
# `cargo build --release -p busbar-store-sqlite-plugin --features dropped-in`, and `cargo test` names this crate
# below with it on so the cdylib the conformance test opens carries the door.
dropped-in = []

[dependencies]
# THE LOGIC, same repo: its `door::door` is the door this image exports.
busbar-store-sqlite = { path = "../store-sqlite" }
busbar-contract = { git = "https://github.com/GetBusbar/busbar", rev = "e1d3d8b097201859751d77208e66249d98b50a4b" }

[dev-dependencies]
# The conformance test opens this crate's own cdylib WITH its dropped-in door on (see `[features]`).
busbar-store-sqlite-plugin = { path = ".", features = ["dropped-in"] }
# The conformance and e2e tests load the built cdylib and the linked door over the REAL loader (the
# one dispatcher, the store v3 table) — dev-only, never in the shipped artifact. Same pinned rev as
# the logic crate's busbar-contract, so one busbar source resolves.
Expand Down
6 changes: 4 additions & 2 deletions store-sqlite-plugin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//! All the store lives in the `busbar-store-sqlite` crate, including its one door
//! (`busbar_store_sqlite::door::door`, the store v3 table). This crate re-exports the logic crate,
//! so the library it builds carries exactly the code a busbar build links, and exports that door as
//! the image's ONE symbol, `busbar_plugin_door` (`export_door!`, unconditionally) — one source,
//! the image's ONE symbol, `busbar_plugin_door` (`export_door!`, behind the `dropped-in` feature) — one source,
//! both doors (DECISIONS #2 rule (1)).
//!
//! This crate is `deny`, not `forbid`: the export macro's `#[unsafe(no_mangle)]` is the one reviewed
Expand All @@ -18,7 +18,9 @@

pub use busbar_store_sqlite::*;

/// The exported door: the macro's `#[no_mangle]` symbol is the one exemption.
/// The exported door, behind `dropped-in` (the cdylib build only): the macro's `#[no_mangle]` symbol is
/// the one exemption.
#[cfg(feature = "dropped-in")]
#[allow(unsafe_code)]
mod exported {
busbar_contract::export_door!(busbar_store_sqlite::door::door);
Expand Down
Loading