diff --git a/.github/workflows/rust.yaml b/.github/workflows/rust.yaml index dd7b6ee4..5b4907d7 100644 --- a/.github/workflows/rust.yaml +++ b/.github/workflows/rust.yaml @@ -54,6 +54,10 @@ jobs: run: rustup install 1.80 - run: cargo test --workspace --all-features --exclude zen-ffi --exclude zen-nodejs --exclude zen-python - run: cargo test --workspace --all-features --exclude zen-ffi --exclude zen-nodejs --exclude zen-python --release + - name: Test without arbitrary_precision + run: cargo test --workspace --exclude zen-ffi --exclude zen-nodejs --exclude zen-python + - name: Test without arbitrary_precision (release) + run: cargo test --workspace --exclude zen-ffi --exclude zen-nodejs --exclude zen-python --release build: name: cargo +${{ matrix.rust }} build diff --git a/bindings/c/Cargo.toml b/bindings/c/Cargo.toml index 7641efc6..ffb31ade 100644 --- a/bindings/c/Cargo.toml +++ b/bindings/c/Cargo.toml @@ -12,8 +12,8 @@ serde = { workspace = true } serde_json = { workspace = true } strum = { workspace = true, features = ["derive"] } tokio = { workspace = true, features = ["rt"] } -zen-engine = { path = "../../core/engine" } -zen-expression = { path = "../../core/expression" } +zen-engine = { path = "../../core/engine", features = ["arbitrary_precision"] } +zen-expression = { path = "../../core/expression", features = ["arbitrary_precision"] } zen-tmpl = { path = "../../core/template" } [lib] diff --git a/bindings/nodejs/Cargo.toml b/bindings/nodejs/Cargo.toml index f7488dd9..5bc273ee 100644 --- a/bindings/nodejs/Cargo.toml +++ b/bindings/nodejs/Cargo.toml @@ -15,8 +15,8 @@ napi-sys = "3" napi-derive = "3" tokio-util = { workspace = true, features = ["rt"] } serde_json = { workspace = true } -zen-engine = { path = "../../core/engine" } -zen-expression = { path = "../../core/expression" } +zen-engine = { path = "../../core/engine", features = ["arbitrary_precision"] } +zen-expression = { path = "../../core/expression", features = ["arbitrary_precision"] } zen-tmpl = { path = "../../core/template" } serde = { workspace = true, features = ["derive"] } json_dotpath = { workspace = true } diff --git a/bindings/python/Cargo.toml b/bindings/python/Cargo.toml index bd323e73..052a88b0 100644 --- a/bindings/python/Cargo.toml +++ b/bindings/python/Cargo.toml @@ -20,6 +20,6 @@ serde = { workspace = true } serde_json = { workspace = true } rust_decimal = { workspace = true, features = ["maths-nopanic"] } tokio-util = { version = "0.7", features = ["rt"] } -zen-engine = { path = "../../core/engine" } -zen-expression = { path = "../../core/expression" } +zen-engine = { path = "../../core/engine", features = ["arbitrary_precision"] } +zen-expression = { path = "../../core/expression", features = ["arbitrary_precision"] } zen-tmpl = { path = "../../core/template" } diff --git a/bindings/uniffi/Cargo.toml b/bindings/uniffi/Cargo.toml index 8315f77b..570b904c 100644 --- a/bindings/uniffi/Cargo.toml +++ b/bindings/uniffi/Cargo.toml @@ -15,8 +15,8 @@ path = "uniffi-bindgen.rs" [dependencies] uniffi = { version = "0.29", features = ["tokio", "cli"] } serde_json = { workspace = true } -zen-engine = { path = "../../core/engine" } -zen-expression = { path = "../../core/expression" } +zen-engine = { path = "../../core/engine", features = ["arbitrary_precision"] } +zen-expression = { path = "../../core/expression", features = ["arbitrary_precision"] } serde = { workspace = true, features = ["derive"] } async-trait = "0.1" tokio = "1.46" diff --git a/core/engine/Cargo.toml b/core/engine/Cargo.toml index 57baee32..22e5c4ba 100644 --- a/core/engine/Cargo.toml +++ b/core/engine/Cargo.toml @@ -24,9 +24,9 @@ rust_decimal = { workspace = true, features = ["maths-nopanic"] } fixedbitset = "0.5" tokio = { workspace = true, features = ["sync", "time"] } rquickjs = { version = "0.10", features = ["macro", "loader", "rust-alloc", "futures", "either", "properties"] } -zen-types = { path = "../types", version = "0.53.0", default-features = false } -zen-expression = { path = "../expression", version = "0.53.0", default-features = false, features = ["regex-deprecated"] } -zen-tmpl = { path = "../template", version = "0.53.0", default-features = false, features = ["regex-deprecated"] } +zen-types = { path = "../types", version = "0.53.0" } +zen-expression = { path = "../expression", version = "0.53.0" } +zen-tmpl = { path = "../template", version = "0.53.0" } nohash-hasher = { workspace = true } downcast-rs = { version = "2.0", features = ["std", "sync"] } @@ -52,6 +52,6 @@ harness = false name = "engine" [features] -default = ["arbitrary_precision"] +default = [] bindgen = ["rquickjs/bindgen"] arbitrary_precision = ["serde_json/arbitrary_precision", "zen-expression/arbitrary_precision", "zen-types/arbitrary_precision", "zen-tmpl/arbitrary_precision"] \ No newline at end of file diff --git a/core/expression/Cargo.toml b/core/expression/Cargo.toml index 14858f2b..17cc30a0 100644 --- a/core/expression/Cargo.toml +++ b/core/expression/Cargo.toml @@ -30,7 +30,7 @@ strsim = "0.11" iana-time-zone = "0.1" zen-macros = { path = "../macros", version = "0.53.0" } -zen-types = { path = "../types", version = "0.53.0", default-features = false } +zen-types = { path = "../types", version = "0.53.0" } [dev-dependencies] criterion = { workspace = true } @@ -41,7 +41,7 @@ serde_json5 = "0.2" recursive = { workspace = true } [features] -default = ["regex-deprecated", "arbitrary_precision"] +default = ["regex-deprecated"] regex-lite = ["dep:regex-lite"] regex-deprecated = ["dep:regex"] arbitrary_precision = ["serde_json/arbitrary_precision", "zen-types/arbitrary_precision"] diff --git a/core/template/Cargo.toml b/core/template/Cargo.toml index c825e00c..bffc9830 100644 --- a/core/template/Cargo.toml +++ b/core/template/Cargo.toml @@ -8,13 +8,13 @@ edition = "2021" repository = "https://github.com/gorules/zen.git" [dependencies] -zen-expression = { path = "../expression", version = "0.53.0", default-features = false } +zen-expression = { path = "../expression", version = "0.53.0" } thiserror = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } [features] -default = ["regex-deprecated", "arbitrary_precision"] +default = ["regex-deprecated"] regex-lite = ["zen-expression/regex-lite"] regex-deprecated = ["zen-expression/regex-deprecated"] diff --git a/core/types/Cargo.toml b/core/types/Cargo.toml index e3b1b0d4..2da2fa56 100644 --- a/core/types/Cargo.toml +++ b/core/types/Cargo.toml @@ -15,5 +15,5 @@ thiserror = { workspace = true } nohash-hasher = { workspace = true } [features] -default = ["arbitrary_precision"] +default = [] arbitrary_precision = ["serde_json/arbitrary_precision"] diff --git a/core/types/build.rs b/core/types/build.rs new file mode 100644 index 00000000..ae4a0310 --- /dev/null +++ b/core/types/build.rs @@ -0,0 +1,7 @@ +fn main() { + #[cfg(not(feature = "arbitrary_precision"))] + println!("cargo:warning=zen: arbitrary_precision is now opt-in across all zen crates \ + (zen-engine, zen-expression, zen-types). \ + If you rely on precise decimal handling, add features = [\"arbitrary_precision\"]. \ + See CHANGELOG for details."); +}