Add comprehensive git environment variables for build scripts
This commit is contained in:
@@ -57,7 +57,12 @@ build_rust_component() {
|
||||
. ~/.cargo/env
|
||||
|
||||
# Set git version for components that use git_version macro
|
||||
export GIT_DESCRIBE=$(cd "$COMPONENTS_DIR/$component_name" && git describe --tags --always --dirty=-modified 2>/dev/null || echo "unknown")
|
||||
# Many git_version crates check these environment variables first
|
||||
export VERGEN_GIT_DESCRIBE=$(cd "$COMPONENTS_DIR/$component_name" && git describe --tags --always --dirty=-modified 2>/dev/null || echo "unknown")
|
||||
export GIT_VERSION=$(cd "$COMPONENTS_DIR/$component_name" && git describe --tags --always --dirty=-modified 2>/dev/null || echo "unknown")
|
||||
export VERGEN_GIT_BRANCH=$(cd "$COMPONENTS_DIR/$component_name" && git branch --show-current 2>/dev/null || echo "main")
|
||||
export VERGEN_GIT_COMMIT_TIMESTAMP=$(cd "$COMPONENTS_DIR/$component_name" && git log -1 --format=%ct 2>/dev/null || echo "0")
|
||||
export VERGEN_GIT_SHA=$(cd "$COMPONENTS_DIR/$component_name" && git rev-parse HEAD 2>/dev/null || echo "unknown")
|
||||
|
||||
# Build with musl target for static linking
|
||||
cargo build --release --target x86_64-unknown-linux-musl
|
||||
|
||||
Reference in New Issue
Block a user