diff --git a/.github/workflows/build-test-centos7-amd64.yaml b/.github/workflows/build-test-centos7-amd64.yaml new file mode 100644 index 000000000..baa704623 --- /dev/null +++ b/.github/workflows/build-test-centos7-amd64.yaml @@ -0,0 +1,39 @@ +name: Build and Test on centos7 amd64 + +on: ["push", "pull_request"] + +jobs: + build-and-test-centos7: + name: Build and Test on centos7 amd64 + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v3 + with: + submodules: "true" + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + with: + platforms: linux/amd64 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Pull custom centos7 Docker image + run: | + docker pull kcllang/kcl-builder:centos7 + + # Use llvm7 to build kcl in centos7 + - name: Release + run: | + docker run --rm \ + -v ${{ github.workspace }}:/workspace -w /workspace \ + kcllang/kcl-builder:centos7 \ + /bin/bash -c "source ~/.bash_profile && export PATH=$PATH:/opt/build/bin/ && sed -i 's/llvm12/llvm7/g' kclvm/compiler/Cargo.toml && make && make release" + + - name: Upload Artifact + uses: actions/upload-artifact@v3 + with: + name: kcl-centos7-amd64 + path: _build/dist/centos/kclvm diff --git a/.github/workflows/build-test-linux-arm64.yml b/.github/workflows/build-test-ubuntu-arm64.yml similarity index 61% rename from .github/workflows/build-test-linux-arm64.yml rename to .github/workflows/build-test-ubuntu-arm64.yml index 7f74d3fd6..e29df46ae 100644 --- a/.github/workflows/build-test-linux-arm64.yml +++ b/.github/workflows/build-test-ubuntu-arm64.yml @@ -1,12 +1,6 @@ name: Build and Test on Linux ARCH64 -on: - push: - branches: - - main - pull_request: - branches: - - main +on: ["push", "pull_request"] jobs: build-and-test-arm64: @@ -17,33 +11,15 @@ jobs: uses: actions/checkout@v3 with: submodules: "true" - - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: 1.21 - - - name: Install prerequisites - run: | - sudo apt-get update - sudo apt-get install -y git wget curl make python3 python3-pip clang-12 lld-12 - sudo ln -sf /usr/bin/clang-12 /usr/bin/clang - - name: Install rust nightly toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.76 - override: true - components: clippy, rustfmt - - name: Set up QEMU uses: docker/setup-qemu-action@v2 with: platforms: linux/amd64,linux/arm64 - + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - + - name: Pull custom ARM64 Docker image run: | docker pull --platform linux/arm64 kcllang/kcl-builder-arm64 diff --git a/kclvm/compiler/src/codegen/llvm/context.rs b/kclvm/compiler/src/codegen/llvm/context.rs index 663fe01b9..dd1077aeb 100644 --- a/kclvm/compiler/src/codegen/llvm/context.rs +++ b/kclvm/compiler/src/codegen/llvm/context.rs @@ -4,7 +4,6 @@ use indexmap::{IndexMap, IndexSet}; use inkwell::basic_block::BasicBlock; use inkwell::builder::Builder; use inkwell::context::Context; -use inkwell::debug_info::{DICompileUnit, DebugInfoBuilder}; use inkwell::memory_buffer::MemoryBuffer; use inkwell::module::{Linkage, Module}; use inkwell::support::LLVMString; @@ -137,8 +136,6 @@ pub struct LLVMCodeGenContext<'ctx> { /// LLVM module with debug info builder and compile unit. pub struct DebugModule<'ctx> { pub inner: Module<'ctx>, - pub dibuilder: DebugInfoBuilder<'ctx>, - pub compile_unit: DICompileUnit<'ctx>, } impl<'ctx> CodeGenObject for BasicValueEnum<'ctx> {} diff --git a/kclvm/compiler/src/codegen/llvm/metadata.rs b/kclvm/compiler/src/codegen/llvm/metadata.rs index 82a2bda5d..1aadda9ed 100644 --- a/kclvm/compiler/src/codegen/llvm/metadata.rs +++ b/kclvm/compiler/src/codegen/llvm/metadata.rs @@ -1,38 +1,10 @@ // Copyright The KCL Authors. All rights reserved. use super::context::{DebugModule, LLVMCodeGenContext}; -use crate::codegen::traits::ProgramCodeGen; use inkwell::module::Module; impl<'ctx> LLVMCodeGenContext<'ctx> { pub(crate) fn create_debug_module(&self, module: Module<'ctx>) -> DebugModule<'ctx> { - let (dibuilder, compile_unit) = module.create_debug_info_builder( - true, - /* language */ inkwell::debug_info::DWARFSourceLanguage::C, - /* filename */ &self.current_pkgpath(), - /* directory */ ".", - /* producer */ "kcl", - /* is_optimized */ false, - /* compiler command line flags */ "", - /* runtime_ver */ 0, - /* split_name */ "", - /* kind */ inkwell::debug_info::DWARFEmissionKind::Full, - /* dwo_id */ 0, - /* split_debug_inling */ false, - /* debug_info_for_profiling */ false, - /* sys_root */ ".", - "", - ); - let debug_metadata_version = self.context.i32_type().const_int(3, false); - module.add_basic_value_flag( - "Debug Info Version", - inkwell::module::FlagBehavior::Warning, - debug_metadata_version, - ); - DebugModule { - inner: module, - dibuilder, - compile_unit, - } + DebugModule { inner: module } } }