Skip to content
Snippets Groups Projects
Commit f82f3ced authored by Вартан Бабаян's avatar Вартан Бабаян :dart:
Browse files

feat: improve verbosity of picodata version

parent 1616b02c
No related branches found
No related tags found
1 merge request!1477Improve verbosity of picodata version output
Pipeline #57262 failed
......@@ -16,6 +16,8 @@ with the `YY.MINOR.MICRO` scheme.
- String cells are now output without double quotes during SELECT.
- `picodata --version` now provides verbose output, including the build type (static or dynamic) and the build configuration (release or debug)
### Compatibility
- Added unique index on column `uuid` for `_pico_instance` table. IDs
......
......@@ -19,6 +19,8 @@ fn main() {
let build_root = cargo::get_build_root();
let use_static_build = !cargo::get_feature("dynamic_build");
insert_build_metadata(use_static_build);
// Build and link all the relevant tarantool libraries.
// For more info, read the comments in tarantool-build.
TarantoolBuildRoot::new(&build_root, use_static_build)
......@@ -34,6 +36,34 @@ fn main() {
}
}
fn insert_build_metadata(use_static_build: bool) {
rustc::env(
"BUILD_TYPE",
if use_static_build {
"static"
} else {
"dynamic"
},
);
rustc::env(
"BUILD_MODE",
if cfg!(debug_assertions) {
"debug"
} else {
"release"
},
);
let os_version = std::process::Command::new("uname")
.args(["-srmo"])
.output()
.map(|output| String::from_utf8_lossy(&output.stdout).trim().to_string())
.unwrap_or_else(|_| "unknown".to_string());
rustc::env("OS_VERSION", os_version);
}
fn generate_git_version() {
rustc::env(
"GIT_DESCRIBE",
......
use crate::address::{HttpAddress, IprotoAddress};
use crate::config::{ByteSize, DEFAULT_USERNAME};
use crate::info::PICODATA_VERSION;
use crate::info::FULL_PICODATA_VERSION;
use crate::util::Uppercase;
use clap::Parser;
use std::borrow::Cow;
......@@ -11,7 +11,7 @@ use tarantool::log::SayLevel;
use tarantool::tlua;
#[derive(Debug, Parser)]
#[clap(name = "picodata", version = PICODATA_VERSION)]
#[clap(name = "picodata", version = FULL_PICODATA_VERSION)]
pub enum Picodata {
Run(Box<Run>),
#[clap(hide = true)]
......
......@@ -13,6 +13,16 @@ use std::borrow::Cow;
use tarantool::proc;
use tarantool::tuple::RawByteBuf;
pub const FULL_PICODATA_VERSION: &'static str = concat!(
env!("GIT_DESCRIBE"),
", ",
env!("BUILD_TYPE"),
", ",
env!("BUILD_MODE"),
"\n",
env!("OS_VERSION")
);
pub const PICODATA_VERSION: &'static str = std::env!("GIT_DESCRIBE");
pub const RPC_API_VERSION: &'static str = "1.0.0";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment