diff --git a/Cargo.toml b/Cargo.toml index b120f74a44f1..a0da27bb2d65 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,6 +28,7 @@ smartstring = { version = "1" } multiversion = "0.7" either = "1.8" strum_macros = "0.25" +version_check = "0.9.4" [workspace.dependencies.arrow] package = "arrow2" diff --git a/crates/polars-arrow/Cargo.toml b/crates/polars-arrow/Cargo.toml index ef42608fe1cc..e28b975a2977 100644 --- a/crates/polars-arrow/Cargo.toml +++ b/crates/polars-arrow/Cargo.toml @@ -21,6 +21,9 @@ polars-error = { version = "0.31.1", path = "../polars-error" } serde = { version = "1", features = ["derive"], optional = true } thiserror.workspace = true +[build-dependencies] +version_check = { workspace = true } + [features] dtype-decimal = ["atoi", "ethnum"] dtype-array = [] diff --git a/crates/polars-arrow/build.rs b/crates/polars-arrow/build.rs new file mode 100644 index 000000000000..3e4ab64620ac --- /dev/null +++ b/crates/polars-arrow/build.rs @@ -0,0 +1,7 @@ +fn main() { + println!("cargo:rerun-if-changed=build.rs"); + let channel = version_check::Channel::read().unwrap(); + if channel.is_nightly() { + println!("cargo:rustc-cfg=feature=\"nightly\""); + } +} diff --git a/crates/polars-core/Cargo.toml b/crates/polars-core/Cargo.toml index 695ea1fc613e..2b5142eed89f 100644 --- a/crates/polars-core/Cargo.toml +++ b/crates/polars-core/Cargo.toml @@ -186,6 +186,9 @@ wasm-timer = "0.2.5" bincode = "1" serde_json = "1" +[build-dependencies] +version_check = { workspace = true } + [package.metadata.docs.rs] # not all because arrow 4.3 does not compile with simd # all-features = true diff --git a/crates/polars-core/build.rs b/crates/polars-core/build.rs new file mode 100644 index 000000000000..3e4ab64620ac --- /dev/null +++ b/crates/polars-core/build.rs @@ -0,0 +1,7 @@ +fn main() { + println!("cargo:rerun-if-changed=build.rs"); + let channel = version_check::Channel::read().unwrap(); + if channel.is_nightly() { + println!("cargo:rustc-cfg=feature=\"nightly\""); + } +} diff --git a/crates/polars-lazy/Cargo.toml b/crates/polars-lazy/Cargo.toml index fe0eb9e029c7..3f4794ffc1f0 100644 --- a/crates/polars-lazy/Cargo.toml +++ b/crates/polars-lazy/Cargo.toml @@ -30,6 +30,9 @@ pyo3 = { version = "0.19", optional = true } rayon.workspace = true smartstring.workspace = true +[build-dependencies] +version_check = { workspace = true } + [features] nightly = ["polars-core/nightly", "polars-pipe/nightly", "polars-plan/nightly"] compile = ["polars-plan/compile"] diff --git a/crates/polars-lazy/build.rs b/crates/polars-lazy/build.rs new file mode 100644 index 000000000000..3e4ab64620ac --- /dev/null +++ b/crates/polars-lazy/build.rs @@ -0,0 +1,7 @@ +fn main() { + println!("cargo:rerun-if-changed=build.rs"); + let channel = version_check::Channel::read().unwrap(); + if channel.is_nightly() { + println!("cargo:rustc-cfg=feature=\"nightly\""); + } +} diff --git a/crates/polars-ops/Cargo.toml b/crates/polars-ops/Cargo.toml index 9b3129326a61..b913c2051dd9 100644 --- a/crates/polars-ops/Cargo.toml +++ b/crates/polars-ops/Cargo.toml @@ -28,6 +28,9 @@ serde = { version = "1", features = ["derive"], optional = true } serde_json = { version = "1", optional = true } smartstring.workspace = true +[build-dependencies] +version_check = { workspace = true } + [features] simd = ["argminmax/nightly_simd"] nightly = ["polars-utils/nightly"] diff --git a/crates/polars-ops/build.rs b/crates/polars-ops/build.rs new file mode 100644 index 000000000000..3e4ab64620ac --- /dev/null +++ b/crates/polars-ops/build.rs @@ -0,0 +1,7 @@ +fn main() { + println!("cargo:rerun-if-changed=build.rs"); + let channel = version_check::Channel::read().unwrap(); + if channel.is_nightly() { + println!("cargo:rustc-cfg=feature=\"nightly\""); + } +} diff --git a/crates/polars-pipe/Cargo.toml b/crates/polars-pipe/Cargo.toml index 0770f40e5b8e..e2a0b690bb97 100644 --- a/crates/polars-pipe/Cargo.toml +++ b/crates/polars-pipe/Cargo.toml @@ -24,6 +24,9 @@ polars-utils = { version = "0.31.1", path = "../polars-utils", features = ["sysi rayon.workspace = true smartstring = { version = "1" } +[build-dependencies] +version_check = { workspace = true } + [features] compile = ["crossbeam-channel", "crossbeam-queue"] csv = ["polars-plan/csv", "polars-io/csv"] diff --git a/crates/polars-pipe/build.rs b/crates/polars-pipe/build.rs new file mode 100644 index 000000000000..3e4ab64620ac --- /dev/null +++ b/crates/polars-pipe/build.rs @@ -0,0 +1,7 @@ +fn main() { + println!("cargo:rerun-if-changed=build.rs"); + let channel = version_check::Channel::read().unwrap(); + if channel.is_nightly() { + println!("cargo:rustc-cfg=feature=\"nightly\""); + } +} diff --git a/crates/polars-plan/Cargo.toml b/crates/polars-plan/Cargo.toml index a741fd14ab34..d8667857f86b 100644 --- a/crates/polars-plan/Cargo.toml +++ b/crates/polars-plan/Cargo.toml @@ -32,6 +32,9 @@ serde = { version = "1", features = ["derive", "rc"], optional = true } smartstring.workspace = true strum_macros.workspace = true +[build-dependencies] +version_check = { workspace = true } + [features] # debugging utility debugging = [] diff --git a/crates/polars-plan/build.rs b/crates/polars-plan/build.rs new file mode 100644 index 000000000000..3e4ab64620ac --- /dev/null +++ b/crates/polars-plan/build.rs @@ -0,0 +1,7 @@ +fn main() { + println!("cargo:rerun-if-changed=build.rs"); + let channel = version_check::Channel::read().unwrap(); + if channel.is_nightly() { + println!("cargo:rustc-cfg=feature=\"nightly\""); + } +} diff --git a/crates/polars-utils/Cargo.toml b/crates/polars-utils/Cargo.toml index 5b847234f4ec..3afd2589da71 100644 --- a/crates/polars-utils/Cargo.toml +++ b/crates/polars-utils/Cargo.toml @@ -18,6 +18,9 @@ rayon.workspace = true smartstring.workspace = true sysinfo = { version = "0.29", default-features = false, optional = true } +[build-dependencies] +version_check = { workspace = true } + [features] bigidx = [] nightly = [] diff --git a/crates/polars-utils/build.rs b/crates/polars-utils/build.rs new file mode 100644 index 000000000000..3e4ab64620ac --- /dev/null +++ b/crates/polars-utils/build.rs @@ -0,0 +1,7 @@ +fn main() { + println!("cargo:rerun-if-changed=build.rs"); + let channel = version_check::Channel::read().unwrap(); + if channel.is_nightly() { + println!("cargo:rustc-cfg=feature=\"nightly\""); + } +} diff --git a/crates/polars/Cargo.toml b/crates/polars/Cargo.toml index 4a5c0576aed1..0c097700b1cd 100644 --- a/crates/polars/Cargo.toml +++ b/crates/polars/Cargo.toml @@ -330,7 +330,7 @@ ahash = "0.8" rand = "0.8" [build-dependencies] -version_check = "0.9.4" +version_check = { workspace = true } [package.metadata.docs.rs] # all-features = true diff --git a/py-polars/Cargo.lock b/py-polars/Cargo.lock index ca1ef838c1df..7b0d0d23c9f7 100644 --- a/py-polars/Cargo.lock +++ b/py-polars/Cargo.lock @@ -1462,6 +1462,7 @@ dependencies = [ "polars-error", "serde", "thiserror", + "version_check", ] [[package]] @@ -1493,6 +1494,7 @@ dependencies = [ "serde_json", "smartstring", "thiserror", + "version_check", "wasm-timer", "xxhash-rust", ] @@ -1577,6 +1579,7 @@ dependencies = [ "pyo3", "rayon", "smartstring", + "version_check", ] [[package]] @@ -1600,6 +1603,7 @@ dependencies = [ "serde", "serde_json", "smartstring", + "version_check", ] [[package]] @@ -1620,6 +1624,7 @@ dependencies = [ "polars-utils", "rayon", "smartstring", + "version_check", ] [[package]] @@ -1644,6 +1649,7 @@ dependencies = [ "serde", "smartstring", "strum_macros 0.25.1", + "version_check", ] [[package]] @@ -1699,6 +1705,7 @@ dependencies = [ "rayon", "smartstring", "sysinfo", + "version_check", ] [[package]]