From 2885c9c58a2c96caa7d622d70b0e492cc4bcc781 Mon Sep 17 00:00:00 2001 From: peefy Date: Mon, 5 Aug 2024 17:01:54 +0800 Subject: [PATCH] fix: git2 in centos CI Signed-off-by: peefy --- .github/workflows/build-test-centos7-amd64.yaml | 2 +- kclvm/version/build.rs | 2 +- kclvm/version/src/lib.rs | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-test-centos7-amd64.yaml b/.github/workflows/build-test-centos7-amd64.yaml index faeec1a8f..e922eb118 100644 --- a/.github/workflows/build-test-centos7-amd64.yaml +++ b/.github/workflows/build-test-centos7-amd64.yaml @@ -30,7 +30,7 @@ jobs: docker run --rm \ -v ${{ github.workspace }}:/workspace -w /workspace \ kcllang/kcl-builder:centos7 \ - /bin/bash -c "yum-config-manager --disable updates && yum install -y epel-release curl-devel expat-devel gettext-devel openssl-devel perl-devel zlib-devel asciidoc xmlto docbook2X gcc && rpm --import https://opensource.wandisco.com/RPM-GPG-KEY-WANdisco && wget https://opensource.wandisco.com/centos/7/git/x86_64/wandisco-git-release-7-2.noarch.rpm && rpm -i wandisco-git-release-7-2.noarch.rpm && yum install git -y && source ~/.bash_profile && export PATH=$PATH:/opt/build/bin/ && sed -i 's/llvm12/llvm7/g' kclvm/compiler/Cargo.toml && git config --global --add safe.directory /workspace && git config --global user.name 'GitHub Action' && git config --global user.email 'action@github.com' && git add . && git commit -m 'chore: bump llvm version to 7.0' && make && make release" + /bin/bash -c "source ~/.bash_profile && export PATH=$PATH:/opt/build/bin/ && sed -i 's/llvm12/llvm7/g' kclvm/compiler/Cargo.toml && git config --global --add safe.directory /workspace && git config --global user.name 'GitHub Action' && git config --global user.email 'action@github.com' && git add . && git commit -m 'chore: bump llvm version to 7.0' && make && make release" - name: Show Artifact Version run: _build/dist/centos/kclvm/bin/kclvm_cli version diff --git a/kclvm/version/build.rs b/kclvm/version/build.rs index c714fc12f..93121abab 100644 --- a/kclvm/version/build.rs +++ b/kclvm/version/build.rs @@ -3,6 +3,6 @@ use vergen::EmitBuilder; fn main() -> Result<(), Box> { // Emit the instructions - EmitBuilder::builder().all_rustc().all_git().emit()?; + EmitBuilder::builder().all_rustc().git_sha(false).emit()?; Ok(()) } diff --git a/kclvm/version/src/lib.rs b/kclvm/version/src/lib.rs index 60afcb410..65d2de0c7 100644 --- a/kclvm/version/src/lib.rs +++ b/kclvm/version/src/lib.rs @@ -3,6 +3,7 @@ pub const VERSION: &str = include_str!("./../../../VERSION"); pub const CHECK_SUM: &str = "c020ab3eb4b9179219d6837a57f5d323"; pub const GIT_SHA: &str = env!("VERGEN_GIT_SHA"); +pub const HOST_TRIPLE: &str = env!("VERGEN_RUSTC_HOST_TRIPLE"); /// Get kCL full version string with the format `{version}-{check_sum}`. #[inline] @@ -16,7 +17,7 @@ pub fn get_version_info() -> String { format!( "Version: {}\r\nPlatform: {}\r\nGitCommit: {}", get_version_string(), - env!("VERGEN_RUSTC_HOST_TRIPLE"), - env!("VERGEN_GIT_SHA") + HOST_TRIPLE, + GIT_SHA, ) }