From 4e04a4e48f2e87a849ebd52ad3b26b1ba1cb9b4e Mon Sep 17 00:00:00 2001 From: tison Date: Sun, 18 Feb 2024 18:30:01 +0800 Subject: [PATCH] build: support build without git (#3309) * build: support build without git Signed-off-by: tison * chore Signed-off-by: tison * address comment Signed-off-by: tison * fix syntax Signed-off-by: tison --------- Signed-off-by: tison --- .github/workflows/develop.yml | 2 +- Cargo.lock | 6 +- Cargo.toml | 1 - src/catalog/Cargo.toml | 4 +- .../information_schema/memory_table/tables.rs | 47 ++++----- src/client/Cargo.toml | 2 +- src/cmd/build.rs | 2 +- src/common/datasource/Cargo.toml | 4 +- src/common/function/Cargo.toml | 2 +- src/common/function/src/system/build.rs | 21 +--- src/common/greptimedb-telemetry/build.rs | 2 +- src/common/meta/Cargo.toml | 2 +- src/common/query/Cargo.toml | 2 +- src/common/recordbatch/Cargo.toml | 2 +- src/common/runtime/Cargo.toml | 2 +- src/common/substrait/Cargo.toml | 2 +- src/common/time/Cargo.toml | 2 +- src/common/version/src/lib.rs | 95 ++++++++++++++++--- src/datanode/Cargo.toml | 6 +- src/datatypes/Cargo.toml | 2 +- src/frontend/Cargo.toml | 4 +- src/index/Cargo.toml | 4 +- src/log-store/Cargo.toml | 4 +- src/meta-client/Cargo.toml | 2 +- src/meta-srv/Cargo.toml | 4 +- src/mito2/Cargo.toml | 4 +- src/operator/Cargo.toml | 2 +- src/partition/Cargo.toml | 2 +- src/puffin/Cargo.toml | 2 +- src/query/Cargo.toml | 6 +- src/script/Cargo.toml | 2 +- src/servers/Cargo.toml | 14 +-- src/servers/build.rs | 6 +- src/table/Cargo.toml | 2 +- tests-integration/Cargo.toml | 4 +- 35 files changed, 154 insertions(+), 116 deletions(-) diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index e8dfe23f7c1b..4a56e44fb465 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -81,7 +81,7 @@ jobs: # Shares across multiple jobs shared-key: "check-toml" - name: Install taplo - run: cargo +stable install taplo-cli --version ^0.8 --locked + run: cargo +stable install taplo-cli --version ^0.9 --locked - name: Run taplo run: taplo format --check diff --git a/Cargo.lock b/Cargo.lock index 2931e3a8ea3c..4113c6f8c7d4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1243,7 +1243,6 @@ dependencies = [ "arrow-schema", "async-stream", "async-trait", - "build-data", "catalog", "chrono", "common-catalog", @@ -1257,6 +1256,7 @@ dependencies = [ "common-telemetry", "common-test-util", "common-time", + "common-version", "dashmap", "datafusion", "datatypes", @@ -1782,7 +1782,6 @@ dependencies = [ "api", "arc-swap", "async-trait", - "build-data", "chrono-tz 0.6.3", "common-error", "common-macro", @@ -1790,6 +1789,7 @@ dependencies = [ "common-runtime", "common-telemetry", "common-time", + "common-version", "datafusion", "datatypes", "libc", @@ -8882,7 +8882,6 @@ dependencies = [ "axum-macros", "axum-test-helper 0.3.0", "base64 0.21.5", - "build-data", "bytes", "catalog", "chrono", @@ -8901,6 +8900,7 @@ dependencies = [ "common-telemetry", "common-test-util", "common-time", + "common-version", "datafusion", "datafusion-common", "datafusion-expr", diff --git a/Cargo.toml b/Cargo.toml index 45b47d6f515e..7dfd452e3204 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -164,7 +164,6 @@ common-grpc-expr = { path = "src/common/grpc-expr" } common-macro = { path = "src/common/macro" } common-mem-prof = { path = "src/common/mem-prof" } common-meta = { path = "src/common/meta" } -common-pprof = { path = "src/common/pprof" } common-procedure = { path = "src/common/procedure" } common-procedure-test = { path = "src/common/procedure-test" } common-query = { path = "src/common/query" } diff --git a/src/catalog/Cargo.toml b/src/catalog/Cargo.toml index 16e407a6995c..b3355dd2d9c6 100644 --- a/src/catalog/Cargo.toml +++ b/src/catalog/Cargo.toml @@ -10,11 +10,10 @@ testing = [] [dependencies] api.workspace = true arc-swap = "1.0" -arrow-schema.workspace = true arrow.workspace = true +arrow-schema.workspace = true async-stream.workspace = true async-trait = "0.1" -build-data = "0.1" common-catalog.workspace = true common-error.workspace = true common-grpc.workspace = true @@ -25,6 +24,7 @@ common-recordbatch.workspace = true common-runtime.workspace = true common-telemetry.workspace = true common-time.workspace = true +common-version.workspace = true dashmap.workspace = true datafusion.workspace = true datatypes.workspace = true diff --git a/src/catalog/src/information_schema/memory_table/tables.rs b/src/catalog/src/information_schema/memory_table/tables.rs index 9922edd7c49f..9655725aece2 100644 --- a/src/catalog/src/information_schema/memory_table/tables.rs +++ b/src/catalog/src/information_schema/memory_table/tables.rs @@ -21,8 +21,6 @@ use datatypes::vectors::{Int64Vector, StringVector}; use crate::information_schema::table_names::*; -const UNKNOWN: &str = "unknown"; - /// Find the schema and columns by the table_name, only valid for memory tables. /// Safety: the user MUST ensure the table schema exists, panic otherwise. pub fn get_schema_columns(table_name: &str) -> (SchemaRef, Vec) { @@ -72,30 +70,27 @@ pub fn get_schema_columns(table_name: &str) -> (SchemaRef, Vec) { ], ), - BUILD_INFO => ( - string_columns(&[ - "GIT_BRANCH", - "GIT_COMMIT", - "GIT_COMMIT_SHORT", - "GIT_DIRTY", - "PKG_VERSION", - ]), - vec![ - Arc::new(StringVector::from(vec![ - build_data::get_git_branch().unwrap_or_else(|_| UNKNOWN.to_string()) - ])), - Arc::new(StringVector::from(vec![ - build_data::get_git_commit().unwrap_or_else(|_| UNKNOWN.to_string()) - ])), - Arc::new(StringVector::from(vec![ - build_data::get_git_commit_short().unwrap_or_else(|_| UNKNOWN.to_string()) - ])), - Arc::new(StringVector::from(vec![ - build_data::get_git_dirty().map_or(UNKNOWN.to_string(), |v| v.to_string()) - ])), - Arc::new(StringVector::from(vec![option_env!("CARGO_PKG_VERSION")])), - ], - ), + BUILD_INFO => { + let build_info = common_version::build_info(); + ( + string_columns(&[ + "GIT_BRANCH", + "GIT_COMMIT", + "GIT_COMMIT_SHORT", + "GIT_DIRTY", + "PKG_VERSION", + ]), + vec![ + Arc::new(StringVector::from(vec![build_info.branch.to_string()])), + Arc::new(StringVector::from(vec![build_info.commit.to_string()])), + Arc::new(StringVector::from(vec![build_info + .commit_short + .to_string()])), + Arc::new(StringVector::from(vec![build_info.dirty.to_string()])), + Arc::new(StringVector::from(vec![build_info.version.to_string()])), + ], + ) + } CHARACTER_SETS => ( vec![ diff --git a/src/client/Cargo.toml b/src/client/Cargo.toml index d9f7feb945fa..c8c827661fab 100644 --- a/src/client/Cargo.toml +++ b/src/client/Cargo.toml @@ -36,8 +36,8 @@ prost.workspace = true rand.workspace = true session.workspace = true snafu.workspace = true -tokio-stream = { workspace = true, features = ["net"] } tokio.workspace = true +tokio-stream = { workspace = true, features = ["net"] } tonic.workspace = true [dev-dependencies] diff --git a/src/cmd/build.rs b/src/cmd/build.rs index 85d72f6df218..5b7f1458843c 100644 --- a/src/cmd/build.rs +++ b/src/cmd/build.rs @@ -13,5 +13,5 @@ // limitations under the License. fn main() { - common_version::setup_git_versions(); + common_version::setup_build_info(); } diff --git a/src/common/datasource/Cargo.toml b/src/common/datasource/Cargo.toml index 193fc108da74..1e456b40c860 100644 --- a/src/common/datasource/Cargo.toml +++ b/src/common/datasource/Cargo.toml @@ -5,8 +5,8 @@ edition.workspace = true license.workspace = true [dependencies] -arrow-schema.workspace = true arrow.workspace = true +arrow-schema.workspace = true async-compression = { version = "0.3", features = [ "bzip2", "gzip", @@ -34,8 +34,8 @@ regex = "1.7" serde.workspace = true snafu.workspace = true strum.workspace = true -tokio-util.workspace = true tokio.workspace = true +tokio-util.workspace = true url = "2.3" [dev-dependencies] diff --git a/src/common/function/Cargo.toml b/src/common/function/Cargo.toml index f3161a5a55fe..7053d10771ad 100644 --- a/src/common/function/Cargo.toml +++ b/src/common/function/Cargo.toml @@ -8,7 +8,6 @@ license.workspace = true api.workspace = true arc-swap = "1.0" async-trait.workspace = true -build-data = "0.1" chrono-tz = "0.6" common-error.workspace = true common-macro.workspace = true @@ -16,6 +15,7 @@ common-query.workspace = true common-runtime.workspace = true common-telemetry.workspace = true common-time.workspace = true +common-version.workspace = true datafusion.workspace = true datatypes.workspace = true libc = "0.2" diff --git a/src/common/function/src/system/build.rs b/src/common/function/src/system/build.rs index 43433ce425ce..ce9e77fdfb7c 100644 --- a/src/common/function/src/system/build.rs +++ b/src/common/function/src/system/build.rs @@ -22,8 +22,6 @@ use datatypes::vectors::{StringVector, VectorRef}; use crate::function::{Function, FunctionContext}; -const DEFAULT_VALUE: &str = "unknown"; - /// Generates build information #[derive(Clone, Debug, Default)] pub struct BuildFunction; @@ -52,15 +50,7 @@ impl Function for BuildFunction { } fn eval(&self, _func_ctx: FunctionContext, _columns: &[VectorRef]) -> Result { - let build_info = format!( - "branch: {}\ncommit: {}\ncommit short: {}\ndirty: {}\nversion: {}", - build_data::get_git_branch().unwrap_or_else(|_| DEFAULT_VALUE.to_string()), - build_data::get_git_commit().unwrap_or_else(|_| DEFAULT_VALUE.to_string()), - build_data::get_git_commit_short().unwrap_or_else(|_| DEFAULT_VALUE.to_string()), - build_data::get_git_dirty().map_or(DEFAULT_VALUE.to_string(), |v| v.to_string()), - env!("CARGO_PKG_VERSION") - ); - + let build_info = common_version::build_info().to_string(); let v = Arc::new(StringVector::from(vec![build_info])); Ok(v) } @@ -87,14 +77,7 @@ mod tests { volatility: Volatility::Immutable } if valid_types == vec![ConcreteDataType::string_datatype()] )); - let build_info = format!( - "branch: {}\ncommit: {}\ncommit short: {}\ndirty: {}\nversion: {}", - build_data::get_git_branch().unwrap_or_else(|_| DEFAULT_VALUE.to_string()), - build_data::get_git_commit().unwrap_or_else(|_| DEFAULT_VALUE.to_string()), - build_data::get_git_commit_short().unwrap_or_else(|_| DEFAULT_VALUE.to_string()), - build_data::get_git_dirty().map_or(DEFAULT_VALUE.to_string(), |v| v.to_string()), - env!("CARGO_PKG_VERSION") - ); + let build_info = common_version::build_info().to_string(); let vector = build.eval(FunctionContext::default(), &[]).unwrap(); let expect: VectorRef = Arc::new(StringVector::from(vec![build_info])); assert_eq!(expect, vector); diff --git a/src/common/greptimedb-telemetry/build.rs b/src/common/greptimedb-telemetry/build.rs index 85d72f6df218..5b7f1458843c 100644 --- a/src/common/greptimedb-telemetry/build.rs +++ b/src/common/greptimedb-telemetry/build.rs @@ -13,5 +13,5 @@ // limitations under the License. fn main() { - common_version::setup_git_versions(); + common_version::setup_build_info(); } diff --git a/src/common/meta/Cargo.toml b/src/common/meta/Cargo.toml index 18c8a6e5d555..68983d784336 100644 --- a/src/common/meta/Cargo.toml +++ b/src/common/meta/Cargo.toml @@ -28,8 +28,8 @@ common-wal.workspace = true datatypes.workspace = true derive_builder.workspace = true etcd-client.workspace = true -futures-util.workspace = true futures.workspace = true +futures-util.workspace = true hex = { version = "0.4" } humantime-serde.workspace = true lazy_static.workspace = true diff --git a/src/common/query/Cargo.toml b/src/common/query/Cargo.toml index 3dabbb84f1f3..0232722499ac 100644 --- a/src/common/query/Cargo.toml +++ b/src/common/query/Cargo.toml @@ -11,9 +11,9 @@ common-error.workspace = true common-macro.workspace = true common-recordbatch.workspace = true common-time.workspace = true +datafusion.workspace = true datafusion-common.workspace = true datafusion-expr.workspace = true -datafusion.workspace = true datatypes.workspace = true serde.workspace = true snafu.workspace = true diff --git a/src/common/recordbatch/Cargo.toml b/src/common/recordbatch/Cargo.toml index c90153b65ce5..ac91e934cc7d 100644 --- a/src/common/recordbatch/Cargo.toml +++ b/src/common/recordbatch/Cargo.toml @@ -9,8 +9,8 @@ arc-swap = "1.6" common-base.workspace = true common-error.workspace = true common-macro.workspace = true -datafusion-common.workspace = true datafusion.workspace = true +datafusion-common.workspace = true datatypes.workspace = true futures.workspace = true paste = "1.0" diff --git a/src/common/runtime/Cargo.toml b/src/common/runtime/Cargo.toml index 629da4f4e0d4..76dc0aa9ffa0 100644 --- a/src/common/runtime/Cargo.toml +++ b/src/common/runtime/Cargo.toml @@ -14,10 +14,10 @@ once_cell.workspace = true paste.workspace = true prometheus.workspace = true snafu.workspace = true +tokio.workspace = true tokio-metrics = "0.3" tokio-metrics-collector = "0.2" tokio-util.workspace = true -tokio.workspace = true [dev-dependencies] tokio-test = "0.4" diff --git a/src/common/substrait/Cargo.toml b/src/common/substrait/Cargo.toml index 9ae36600677c..891cba1d833f 100644 --- a/src/common/substrait/Cargo.toml +++ b/src/common/substrait/Cargo.toml @@ -13,10 +13,10 @@ common-catalog.workspace = true common-error.workspace = true common-macro.workspace = true common-telemetry.workspace = true +datafusion.workspace = true datafusion-common.workspace = true datafusion-expr.workspace = true datafusion-substrait.workspace = true -datafusion.workspace = true datatypes.workspace = true futures = "0.3" promql.workspace = true diff --git a/src/common/time/Cargo.toml b/src/common/time/Cargo.toml index 04976ebadd45..032520ffee18 100644 --- a/src/common/time/Cargo.toml +++ b/src/common/time/Cargo.toml @@ -6,8 +6,8 @@ license.workspace = true [dependencies] arrow.workspace = true -chrono-tz = "0.8" chrono.workspace = true +chrono-tz = "0.8" common-error.workspace = true common-macro.workspace = true once_cell.workspace = true diff --git a/src/common/version/src/lib.rs b/src/common/version/src/lib.rs index 28ceaf8129de..b3cb124ffcb5 100644 --- a/src/common/version/src/lib.rs +++ b/src/common/version/src/lib.rs @@ -12,24 +12,89 @@ // See the License for the specific language governing permissions and // limitations under the License. -const DEFAULT_VALUE: &str = "unknown"; +use std::borrow::Cow; +use std::fmt::Display; +use std::sync::OnceLock; + +const UNKNOWN: &str = "unknown"; + +pub struct BuildInfo { + pub branch: Cow<'static, str>, + pub commit: Cow<'static, str>, + pub commit_short: Cow<'static, str>, + pub dirty: Cow<'static, str>, + pub timestamp: Cow<'static, str>, + + /// Rustc Version + pub rustc: Cow<'static, str>, + /// GreptimeDB Version + pub version: Cow<'static, str>, +} + +impl Display for BuildInfo { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!( + f, + "{}", + [ + format!("branch: {}", self.branch), + format!("commit: {}", self.commit), + format!("commit_short: {}", self.commit_short), + format!("dirty: {}", self.dirty), + format!("version: {}", self.version), + ] + .join("\n") + ) + } +} + +static BUILD: OnceLock = OnceLock::new(); + +pub fn build_info() -> &'static BuildInfo { + BUILD.get_or_init(|| { + let branch = build_data::get_git_branch() + .map(Cow::Owned) + .unwrap_or(Cow::Borrowed(UNKNOWN)); + let commit = build_data::get_git_commit() + .map(Cow::Owned) + .unwrap_or(Cow::Borrowed(UNKNOWN)); + let commit_short = build_data::get_git_commit_short() + .map(Cow::Owned) + .unwrap_or(Cow::Borrowed(UNKNOWN)); + let dirty = build_data::get_git_dirty() + .map(|b| Cow::Owned(b.to_string())) + .unwrap_or(Cow::Borrowed(UNKNOWN)); + let timestamp = build_data::get_source_time() + .map(|ts| Cow::Owned(build_data::format_timestamp(ts))) + .unwrap_or(Cow::Borrowed(UNKNOWN)); + let rustc = build_data::get_rustc_version() + .map(Cow::Owned) + .unwrap_or(Cow::Borrowed(UNKNOWN)); + let version = Cow::Borrowed(env!("CARGO_PKG_VERSION")); + + BuildInfo { + branch, + commit, + commit_short, + dirty, + timestamp, + rustc, + version, + } + }) +} #[allow(clippy::print_stdout)] -pub fn setup_git_versions() { - println!( - "cargo:rustc-env=GIT_COMMIT={}", - build_data::get_git_commit().unwrap_or_else(|_| DEFAULT_VALUE.to_string()) - ); +pub fn setup_build_info() { + let build_info = build_info(); + println!("cargo:rustc-env=GIT_COMMIT={}", build_info.commit); println!( "cargo:rustc-env=GIT_COMMIT_SHORT={}", - build_data::get_git_commit_short().unwrap_or_else(|_| DEFAULT_VALUE.to_string()) - ); - println!( - "cargo:rustc-env=GIT_BRANCH={}", - build_data::get_git_branch().unwrap_or_else(|_| DEFAULT_VALUE.to_string()) - ); - println!( - "cargo:rustc-env=GIT_DIRTY={}", - build_data::get_git_dirty().map_or(DEFAULT_VALUE.to_string(), |v| v.to_string()) + build_info.commit_short ); + println!("cargo:rustc-env=GIT_BRANCH={}", build_info.branch); + println!("cargo:rustc-env=GIT_DIRTY={}", build_info.dirty); + println!("cargo:rustc-env=GIT_DIRTY={}", build_info.dirty); + println!("cargo:rustc-env=RUSTC_VERSION={}", build_info.rustc); + println!("cargo:rustc-env=SOURCE_TIMESTAMP={}", build_info.timestamp); } diff --git a/src/datanode/Cargo.toml b/src/datanode/Cargo.toml index 64c8d030640b..dc50c905f40a 100644 --- a/src/datanode/Cargo.toml +++ b/src/datanode/Cargo.toml @@ -23,8 +23,8 @@ common-datasource.workspace = true common-error.workspace = true common-function.workspace = true common-greptimedb-telemetry.workspace = true -common-grpc-expr.workspace = true common-grpc.workspace = true +common-grpc-expr.workspace = true common-macro.workspace = true common-meta.workspace = true common-procedure.workspace = true @@ -35,9 +35,9 @@ common-telemetry.workspace = true common-time.workspace = true common-wal.workspace = true dashmap.workspace = true +datafusion.workspace = true datafusion-common.workspace = true datafusion-expr.workspace = true -datafusion.workspace = true datatypes.workspace = true file-engine.workspace = true futures = "0.3" @@ -65,8 +65,8 @@ sql.workspace = true store-api.workspace = true substrait.workspace = true table.workspace = true -tokio-stream = { workspace = true, features = ["net"] } tokio.workspace = true +tokio-stream = { workspace = true, features = ["net"] } toml.workspace = true tonic.workspace = true tower = { version = "0.4", features = ["full"] } diff --git a/src/datatypes/Cargo.toml b/src/datatypes/Cargo.toml index c7674d9973ae..ce40c640d492 100644 --- a/src/datatypes/Cargo.toml +++ b/src/datatypes/Cargo.toml @@ -9,9 +9,9 @@ default = [] test = [] [dependencies] +arrow.workspace = true arrow-array.workspace = true arrow-schema.workspace = true -arrow.workspace = true common-base.workspace = true common-decimal.workspace = true common-error.workspace = true diff --git a/src/frontend/Cargo.toml b/src/frontend/Cargo.toml index 6df16182511c..81990c37f192 100644 --- a/src/frontend/Cargo.toml +++ b/src/frontend/Cargo.toml @@ -26,8 +26,8 @@ common-config.workspace = true common-datasource.workspace = true common-error.workspace = true common-function.workspace = true -common-grpc-expr.workspace = true common-grpc.workspace = true +common-grpc-expr.workspace = true common-macro.workspace = true common-meta.workspace = true common-procedure.workspace = true @@ -36,9 +36,9 @@ common-recordbatch.workspace = true common-runtime.workspace = true common-telemetry.workspace = true common-time.workspace = true +datafusion.workspace = true datafusion-common.workspace = true datafusion-expr.workspace = true -datafusion.workspace = true datanode.workspace = true datatypes.workspace = true file-engine.workspace = true diff --git a/src/index/Cargo.toml b/src/index/Cargo.toml index 4c0dc82b0296..082831b7315c 100644 --- a/src/index/Cargo.toml +++ b/src/index/Cargo.toml @@ -19,12 +19,12 @@ greptime-proto.workspace = true mockall.workspace = true pin-project.workspace = true prost.workspace = true -regex-automata.workspace = true regex.workspace = true +regex-automata.workspace = true snafu.workspace = true [dev-dependencies] rand.workspace = true tempfile.workspace = true -tokio-util.workspace = true tokio.workspace = true +tokio-util.workspace = true diff --git a/src/log-store/Cargo.toml b/src/log-store/Cargo.toml index 4f35fa19efb4..82d8c2a6ba01 100644 --- a/src/log-store/Cargo.toml +++ b/src/log-store/Cargo.toml @@ -25,8 +25,8 @@ common-telemetry.workspace = true common-time.workspace = true common-wal.workspace = true dashmap.workspace = true -futures-util.workspace = true futures.workspace = true +futures-util.workspace = true protobuf = { version = "2", features = ["bytes"] } raft-engine.workspace = true rskafka.workspace = true @@ -34,8 +34,8 @@ serde.workspace = true serde_json.workspace = true snafu.workspace = true store-api.workspace = true -tokio-util.workspace = true tokio.workspace = true +tokio-util.workspace = true [dev-dependencies] common-meta = { workspace = true, features = ["testing"] } diff --git a/src/meta-client/Cargo.toml b/src/meta-client/Cargo.toml index 56765db3337f..921fe610548f 100644 --- a/src/meta-client/Cargo.toml +++ b/src/meta-client/Cargo.toml @@ -20,8 +20,8 @@ serde.workspace = true serde_json.workspace = true snafu.workspace = true table.workspace = true -tokio-stream = { workspace = true, features = ["net"] } tokio.workspace = true +tokio-stream = { workspace = true, features = ["net"] } tonic.workspace = true [dev-dependencies] diff --git a/src/meta-srv/Cargo.toml b/src/meta-srv/Cargo.toml index dd1db0bf8b6f..1202514ac686 100644 --- a/src/meta-srv/Cargo.toml +++ b/src/meta-srv/Cargo.toml @@ -18,8 +18,8 @@ common-base.workspace = true common-catalog.workspace = true common-error.workspace = true common-greptimedb-telemetry.workspace = true -common-grpc-expr.workspace = true common-grpc.workspace = true +common-grpc-expr.workspace = true common-macro.workspace = true common-meta.workspace = true common-procedure.workspace = true @@ -51,8 +51,8 @@ snafu.workspace = true store-api.workspace = true strum.workspace = true table.workspace = true -tokio-stream = { workspace = true, features = ["net"] } tokio.workspace = true +tokio-stream = { workspace = true, features = ["net"] } toml.workspace = true tonic.workspace = true tower = "0.4" diff --git a/src/mito2/Cargo.toml b/src/mito2/Cargo.toml index 92f1c63525a0..947208c500b0 100644 --- a/src/mito2/Cargo.toml +++ b/src/mito2/Cargo.toml @@ -34,9 +34,9 @@ common-test-util = { workspace = true, optional = true } common-time.workspace = true common-wal.workspace = true dashmap.workspace = true +datafusion.workspace = true datafusion-common.workspace = true datafusion-expr.workspace = true -datafusion.workspace = true datatypes.workspace = true futures.workspace = true humantime-serde.workspace = true @@ -62,9 +62,9 @@ snafu.workspace = true store-api.workspace = true strum.workspace = true table.workspace = true +tokio.workspace = true tokio-stream.workspace = true tokio-util.workspace = true -tokio.workspace = true uuid.workspace = true [dev-dependencies] diff --git a/src/operator/Cargo.toml b/src/operator/Cargo.toml index 91a410997db6..0543604528f9 100644 --- a/src/operator/Cargo.toml +++ b/src/operator/Cargo.toml @@ -27,9 +27,9 @@ common-recordbatch.workspace = true common-runtime.workspace = true common-telemetry.workspace = true common-time.workspace = true +datafusion.workspace = true datafusion-common.workspace = true datafusion-expr.workspace = true -datafusion.workspace = true datatypes.workspace = true file-engine.workspace = true futures = "0.3" diff --git a/src/partition/Cargo.toml b/src/partition/Cargo.toml index cf9ba0a16f2f..d6a747db66ba 100644 --- a/src/partition/Cargo.toml +++ b/src/partition/Cargo.toml @@ -13,9 +13,9 @@ common-macro.workspace = true common-meta.workspace = true common-query.workspace = true common-telemetry.workspace = true +datafusion.workspace = true datafusion-common.workspace = true datafusion-expr.workspace = true -datafusion.workspace = true datatypes.workspace = true lazy_static.workspace = true meta-client.workspace = true diff --git a/src/puffin/Cargo.toml b/src/puffin/Cargo.toml index 55001b6b07de..0a42084e390a 100644 --- a/src/puffin/Cargo.toml +++ b/src/puffin/Cargo.toml @@ -17,5 +17,5 @@ serde_json.workspace = true snafu.workspace = true [dev-dependencies] -tokio-util.workspace = true tokio.workspace = true +tokio-util.workspace = true diff --git a/src/query/Cargo.toml b/src/query/Cargo.toml index 866eeaa8a905..a09eb7a9d2ac 100644 --- a/src/query/Cargo.toml +++ b/src/query/Cargo.toml @@ -8,8 +8,8 @@ license.workspace = true ahash.workspace = true api.workspace = true arc-swap = "1.0" -arrow-schema.workspace = true arrow.workspace = true +arrow-schema.workspace = true async-recursion = "1.0" async-stream.workspace = true async-trait = "0.1" @@ -27,12 +27,12 @@ common-query.workspace = true common-recordbatch.workspace = true common-telemetry.workspace = true common-time.workspace = true +datafusion.workspace = true datafusion-common.workspace = true datafusion-expr.workspace = true datafusion-optimizer.workspace = true datafusion-physical-expr.workspace = true datafusion-sql.workspace = true -datafusion.workspace = true datatypes.workspace = true futures = "0.3" futures-util.workspace = true @@ -45,8 +45,8 @@ object-store.workspace = true once_cell.workspace = true partition.workspace = true prometheus.workspace = true -promql-parser = "0.1.1" promql.workspace = true +promql-parser = "0.1.1" regex.workspace = true serde.workspace = true serde_json.workspace = true diff --git a/src/script/Cargo.toml b/src/script/Cargo.toml index a443faf219ba..825e36df99fa 100644 --- a/src/script/Cargo.toml +++ b/src/script/Cargo.toml @@ -45,8 +45,8 @@ datafusion-common = { workspace = true, optional = true } datafusion-expr = { workspace = true, optional = true } datafusion-physical-expr = { workspace = true, optional = true } datatypes.workspace = true -futures-util.workspace = true futures.workspace = true +futures-util.workspace = true lazy_static.workspace = true once_cell.workspace = true paste = { workspace = true, optional = true } diff --git a/src/servers/Cargo.toml b/src/servers/Cargo.toml index 1b4fb8db50f5..9a5ded127453 100644 --- a/src/servers/Cargo.toml +++ b/src/servers/Cargo.toml @@ -13,14 +13,14 @@ testing = [] [dependencies] aide = { version = "0.9", features = ["axum"] } api.workspace = true +arrow.workspace = true arrow-flight.workspace = true arrow-ipc.workspace = true arrow-schema.workspace = true -arrow.workspace = true async-trait = "0.1" auth.workspace = true -axum-macros = "0.3.8" axum.workspace = true +axum-macros = "0.3.8" base64.workspace = true bytes.workspace = true catalog.workspace = true @@ -28,8 +28,8 @@ chrono.workspace = true common-base.workspace = true common-catalog.workspace = true common-error.workspace = true -common-grpc-expr.workspace = true common-grpc.workspace = true +common-grpc-expr.workspace = true common-macro.workspace = true common-mem-prof = { workspace = true, optional = true } common-meta.workspace = true @@ -38,9 +38,9 @@ common-recordbatch.workspace = true common-runtime.workspace = true common-telemetry.workspace = true common-time.workspace = true +datafusion.workspace = true datafusion-common.workspace = true datafusion-expr.workspace = true -datafusion.workspace = true datatypes.workspace = true derive_builder.workspace = true digest = "0.10" @@ -91,11 +91,11 @@ snap = "1" sql.workspace = true strum.workspace = true table.workspace = true +tokio.workspace = true tokio-rustls = "0.25" tokio-stream = { workspace = true, features = ["net"] } -tokio.workspace = true -tonic-reflection = "0.10" tonic.workspace = true +tonic-reflection = "0.10" tower = { version = "0.4", features = ["full"] } tower-http = { version = "0.3", features = ["full"] } urlencoding = "2.1" @@ -123,4 +123,4 @@ tokio-postgres-rustls = "0.11" tokio-test = "0.4" [build-dependencies] -build-data = "0.1.4" +common-version.workspace = true diff --git a/src/servers/build.rs b/src/servers/build.rs index d6db46b5ae52..0b735a6800fb 100644 --- a/src/servers/build.rs +++ b/src/servers/build.rs @@ -13,11 +13,7 @@ // limitations under the License. fn main() { - build_data::set_RUSTC_VERSION(); - build_data::set_GIT_BRANCH(); - build_data::set_GIT_COMMIT(); - build_data::set_SOURCE_TIMESTAMP(); - + common_version::setup_build_info(); #[cfg(feature = "dashboard")] fetch_dashboard_assets(); } diff --git a/src/table/Cargo.toml b/src/table/Cargo.toml index 467bad1b1354..2fe1fb85bd2e 100644 --- a/src/table/Cargo.toml +++ b/src/table/Cargo.toml @@ -21,10 +21,10 @@ common-query.workspace = true common-recordbatch.workspace = true common-telemetry.workspace = true common-time.workspace = true +datafusion.workspace = true datafusion-common.workspace = true datafusion-expr.workspace = true datafusion-physical-expr.workspace = true -datafusion.workspace = true datatypes.workspace = true derive_builder.workspace = true futures.workspace = true diff --git a/tests-integration/Cargo.toml b/tests-integration/Cargo.toml index e94bf487f4ed..2ac802909fe6 100644 --- a/tests-integration/Cargo.toml +++ b/tests-integration/Cargo.toml @@ -12,8 +12,8 @@ api.workspace = true arrow-flight.workspace = true async-trait = "0.1" auth.workspace = true -axum-test-helper = { git = "https://github.com/sunng87/axum-test-helper.git", branch = "patch-1" } axum.workspace = true +axum-test-helper = { git = "https://github.com/sunng87/axum-test-helper.git", branch = "patch-1" } catalog.workspace = true chrono.workspace = true client = { workspace = true, features = ["testing"] } @@ -71,8 +71,8 @@ tower = "0.4" uuid.workspace = true [dev-dependencies] -datafusion-expr.workspace = true datafusion.workspace = true +datafusion-expr.workspace = true itertools.workspace = true opentelemetry-proto.workspace = true partition.workspace = true