Skip to content

Commit d80f700

Browse files
refactor(workspace): 主包迁入 src/function-stream 并集中 workspace 元数据
- 根 Cargo.toml 改为纯 workspace,主程序与库移至 src/function-stream - 新增 [workspace.package] 统一 version / edition,成员 crate 使用 *.workspace = true - Makefile:VERSION 从根 Cargo.toml 读取,构建显式 -p function-stream,lite 使用 OPTIMIZE_FLAGS - wasm_host bindgen WIT 路径改为 ../../wit,以适配子目录中的 package manifest - 移除根 src 下旧入口与 runtime/storage 模块,streaming/wasm 等 crate 路径与导入同步调整 - examples-validator 与全仓 edition 对齐为 2024 Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent f920659 commit d80f700

113 files changed

Lines changed: 581 additions & 548 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[workspace]
22
members = [
3-
".",
3+
"src/function-stream",
44
"protocol",
55
"cli/cli",
66
"src/catalog",
@@ -17,91 +17,10 @@ members = [
1717
"src/streaming_planner",
1818
"src/wasm_runtime",
1919
]
20+
resolver = "2"
21+
default-members = ["src/function-stream"]
2022

21-
[package]
22-
name = "function-stream"
23+
# Shared crate metadata for workspace members (`version.workspace = true`, etc.).
24+
[workspace.package]
2325
version = "0.6.0"
2426
edition = "2024"
25-
26-
[lib]
27-
name = "function_stream"
28-
path = "src/lib.rs"
29-
30-
[[bin]]
31-
name = "function-stream"
32-
path = "src/main.rs"
33-
34-
35-
[dependencies]
36-
tokio = { version = "1.0", features = ["macros", "rt-multi-thread", "sync", "time", "net", "signal"] }
37-
serde = { version = "1.0", features = ["derive"] }
38-
serde_yaml = "0.9"
39-
serde_json = "1.0"
40-
uuid = { version = "1.0", features = ["v4", "v7"] }
41-
log = "0.4"
42-
tracing = "0.1"
43-
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
44-
tracing-appender = "0.2"
45-
anyhow = "1.0"
46-
thiserror = "2"
47-
tonic = { version = "0.12", features = ["default"] }
48-
async-trait = "0.1"
49-
num_cpus = "1.0"
50-
protocol = { path = "./protocol" }
51-
function-stream-config = { path = "src/config" }
52-
function-stream-logger = { path = "src/logger" }
53-
function-stream-runtime-common = { path = "src/runtime_common" }
54-
function-stream-streaming-planner = { path = "src/streaming_planner" }
55-
prost = "0.13"
56-
rdkafka = { version = "0.38", features = ["cmake-build", "ssl", "gssapi", "curl"] }
57-
crossbeam-channel = "0.5"
58-
wasmtime = { version = "41.0.3", features = ["component-model", "async"] }
59-
base64 = "0.22"
60-
wasmtime-wasi = "41.0.3"
61-
rocksdb = { version = "0.21", features = ["multi-threaded-cf", "lz4"] }
62-
bincode = { version = "2", features = ["serde"] }
63-
chrono = "0.4"
64-
tokio-stream = "0.1.18"
65-
lru = "0.12"
66-
parking_lot = "0.12"
67-
arrow = { version = "55", default-features = false }
68-
arrow-array = "55"
69-
arrow-ipc = "55"
70-
arrow-schema = { version = "55", features = ["serde"] }
71-
parquet = "55"
72-
object_store = { version = "0.12.5", features = ["aws"] }
73-
bytes = "1"
74-
futures = "0.3"
75-
serde_json_path = "0.7"
76-
xxhash-rust = { version = "0.8", features = ["xxh3"] }
77-
proctitle = "0.1"
78-
unicase = "2.7"
79-
petgraph = "0.7"
80-
rand = { version = "0.8", features = ["small_rng"] }
81-
itertools = "0.14"
82-
strum = { version = "0.26", features = ["derive"] }
83-
84-
arrow-json = {version = '55.2.0'}
85-
apache-avro = "0.21"
86-
datafusion = {git = 'https://github.com/FunctionStream/datafusion', branch = '48.0.1/fs'}
87-
datafusion-common = {git = 'https://github.com/FunctionStream/datafusion', branch = '48.0.1/fs'}
88-
datafusion-execution = {git = 'https://github.com/FunctionStream/datafusion', branch = '48.0.1/fs'}
89-
datafusion-expr = {git = 'https://github.com/FunctionStream/datafusion', branch = '48.0.1/fs'}
90-
datafusion-physical-expr = {git = 'https://github.com/FunctionStream/datafusion', branch = '48.0.1/fs'}
91-
datafusion-proto = {git = 'https://github.com/FunctionStream/datafusion', branch = '48.0.1/fs'}
92-
93-
sqlparser = { git = "https://github.com/FunctionStream/sqlparser-rs", branch = "0.58.0/fs" }
94-
95-
ahash = "0.8"
96-
governor = "0.8.0"
97-
lance = { version = "4.0.0", default-features = false, features = ["aws"] }
98-
arrow-array-lance = { package = "arrow-array", version = "57.3.0" }
99-
arrow-ipc-lance = { package = "arrow-ipc", version = "57.3.0" }
100-
101-
[features]
102-
default = ["incremental-cache", "python"]
103-
incremental-cache = ["wasmtime/incremental-cache"]
104-
python = []
105-
106-
[dev-dependencies]
107-
tempfile = "3.27.0"

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# See the License for the specific language governing permissions and
1111
# limitations under the License.
1212
APP_NAME := function-stream
13+
# Version from root `[workspace.package]` (single source of truth).
1314
VERSION := $(shell grep '^version' Cargo.toml | head -1 | awk -F '"' '{print $$2}')
1415
DATE := $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
1516

@@ -106,6 +107,7 @@ build: .check-env .ensure-target .build-wasm
106107
@RUSTFLAGS="$(OPTIMIZE_FLAGS)" \
107108
cargo build --release \
108109
--target $(TRIPLE) \
110+
-p $(APP_NAME) \
109111
--features python \
110112
--quiet
111113
$(call log,BUILD,CLI)
@@ -118,14 +120,15 @@ build: .check-env .ensure-target .build-wasm
118120

119121
build-lite: .check-env .ensure-target
120122
$(call log,BUILD,Rust Lite [$(OS_NAME) / $(TRIPLE)])
121-
@RUSTFLAGS="$(INDUSTRIAL_RUSTFLAGS)" \
123+
@RUSTFLAGS="$(OPTIMIZE_FLAGS)" \
122124
cargo build --release \
123125
--target $(TRIPLE) \
126+
-p $(APP_NAME) \
124127
--no-default-features \
125128
--features incremental-cache \
126129
--quiet
127130
$(call log,BUILD,CLI for dist)
128-
@RUSTFLAGS="$(INDUSTRIAL_RUSTFLAGS)" \
131+
@RUSTFLAGS="$(OPTIMIZE_FLAGS)" \
129132
cargo build --release \
130133
--target $(TRIPLE) \
131134
-p function-stream-cli \

cli/cli/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "function-stream-cli"
3-
version = "0.1.0"
4-
edition = "2021"
3+
version.workspace = true
4+
edition.workspace = true
55

66
[[bin]]
77
name = "cli"

examples/examples-validator/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "examples-validator"
33
version = "0.1.0"
4-
edition = "2021"
4+
edition = "2024"
55

66
[workspace]
77

protocol/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "protocol"
3-
version = "0.1.0"
4-
edition = "2024"
3+
version.workspace = true
4+
edition.workspace = true
55
description = "Protocol Buffers protocol definitions for function stream"
66
license = "MIT OR Apache-2.0"
77
repository = "https://github.com/your-username/rust-function-stream"

src/catalog/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "function-stream-catalog"
3-
version = "0.6.0"
4-
edition = "2024"
3+
version.workspace = true
4+
edition.workspace = true
55

66
[lib]
77
name = "function_stream_catalog"

src/catalog_storage/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "function-stream-catalog-storage"
3-
version = "0.6.0"
4-
edition = "2024"
3+
version.workspace = true
4+
edition.workspace = true
55

66
[lib]
77
name = "function_stream_catalog_storage"

src/catalog_storage/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Persistent catalog storage implementations.
22
//!
33
//! The stream catalog manager and task persistence (`stream_catalog/`, `task/`) live in this
4-
//! package and are compiled as part of `function-stream` via `#[path]` in `src/storage.rs`.
4+
//! package and are compiled as part of `function-stream` via `#[path]` in `src/lib.rs` / `src/main.rs`.
55
66
pub mod memory;
77
pub mod rocksdb;

src/catalog_storage/src/stream_catalog/manager.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ pub fn restore_global_catalog_from_store() {
627627
}
628628

629629
pub fn restore_streaming_jobs_from_store() {
630-
use crate::runtime::streaming::job::JobManager;
630+
use crate::streaming::job::JobManager;
631631

632632
let Some(catalog) = CatalogManager::try_global() else {
633633
warn!("CatalogManager not available; skipping streaming job restore");
@@ -742,7 +742,7 @@ mod tests {
742742
use crate::sql::schema::column_descriptor::ColumnDescriptor;
743743
use crate::sql::schema::table::CatalogEntity;
744744
use crate::sql::schema::temporal_pipeline_config::TemporalPipelineConfig;
745-
use crate::storage::stream_catalog::InMemoryMetaStore;
745+
use crate::stream_catalog::InMemoryMetaStore;
746746

747747
use super::CatalogManager;
748748

0 commit comments

Comments
 (0)