Repository: kcl-lang/kcl (language: rust)

Issue:
[WIP] Feat : Support Call Kclvm Cli by C API
<!-- Thank you for contributing to KusionStack!

Note: 

1. With pull requests:

    - Open your pull request against "main"
    - Your pull request should have no more than two commits, if not you should squash them.
    - It should pass all tests in the available continuous integration systems such as GitHub Actions.
    - You should add/modify tests to cover your proposed code changes.
    - If your pull request contains a new feature, please document it on the README.

2. Please create an issue first to describe the problem.

    We recommend that link the issue with the PR in the following question.
    For more info, check https://kusionstack.io/docs/governance/contribute/
-->

#### 1. Does this PR affect any open issues?(Y/N) and add issue references (e.g. "fix #123", "re #123".):

- [ ] N
- [x] Y 
re #125 

#### 2. What is the scope of this PR (e.g. component or file name):

<!-- You can add the scope of this change here. 
-->
        KCLVM/kclvm/spec
        KCLVM/kclvm/src/lib.rs

#### 3. Provide a description of the PR(e.g. more details, effects, motivations or doc link):

<!-- You can choose a brief description here -->
- [ ] Affects user behaviors
- [ ] Contains syntax changes
- [ ] Contains variable changes
- [x] Contains experimental features
- [ ] Performance regression: Consumes more CPU
- [ ] Performance regression: Consumes more Memory
- [ ] Other

<!-- You can add more details here.
-->
    Support user to call kclvm_cli by c_api


#### 4. Are there any breaking changes?(Y/N) and describe the breaking changes(e.g. more details, motivations or doc link):

- [x] N
- [ ] Y 

<!-- You can add more details here.

-->

#### 5. Are there test cases for these changes?(Y/N) select and add more details, references or doc links:

<!-- You can choose a brief description here -->
- [x] Unit test
- [ ] Integration test
- [ ] Benchmark (add benchmark stats below)
- [ ] Manual test (add detailed scripts or steps below)
- [ ] Other

<!-- You can add more details here.
None
-->
KCLVM/kclvm/src/api_test.rs

#### 6. Release note

<!-- compatibility change, improvement, bugfix, and new feature need a release note -->

Please refer to [Release Notes Language Style Guide](https://kusionstack.io/docs/governance/release-policy/) to write a quality release note.

```release-note
None
```



Discussion / hints:
****CLA Assistant Lite bot**** All contributors have signed the CLA  ✍️ ✅
I have read the CLA Document and I hereby sign the CLA
## Pull Request Test Coverage Report for [Build 2744948016](https://coveralls.io/builds/51191024)

* **2** of **5523**   **(0.04%)**  changed or added relevant lines in **6** files are covered.
* No unchanged relevant lines lost coverage.
* Overall coverage decreased (**-7.6%**) to **51.731%**

---

|  Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
| :-----|--------------|--------|---: |
| [kclvm/spec/src/main.rs](https://coveralls.io/builds/51191024/source?filename=kclvm%2Fspec%2Fsrc%2Fmain.rs#L2) | 1 | 3 | 33.33%
| [kclvm/spec/src/service/util.rs](https://coveralls.io/builds/51191024/source?filename=kclvm%2Fspec%2Fsrc%2Fservice%2Futil.rs#L2) | 0 | 25 | 0.0%
| [kclvm/spec/src/service/service.rs](https://coveralls.io/builds/51191024/source?filename=kclvm%2Fspec%2Fsrc%2Fservice%2Fservice.rs#L10) | 0 | 109 | 0.0%
| [kclvm/spec/src/service/api.rs](https://coveralls.io/builds/51191024/source?filename=kclvm%2Fspec%2Fsrc%2Fservice%2Fapi.rs#L10) | 0 | 153 | 0.0%
| [kclvm/spec/src/model/gpyrpc.rs](https://coveralls.io/builds/51191024/source?filename=kclvm%2Fspec%2Fsrc%2Fmodel%2Fgpyrpc.rs#L28) | 0 | 5232 | 0.0%
<!-- | **Total:** | **2** | **5523** | **0.04%** | -->


|  Totals | [![Coverage Status](https://coveralls.io/builds/51191024/badge)](https://coveralls.io/builds/51191024) |
| :-- | --: |
| Change from base [Build 2743999583](https://coveralls.io/builds/51186839): |  -7.6% |
| Covered Lines: | 22244 |
| Relevant Lines: | 42999 |

---
##### 💛  - [Coveralls](https://coveralls.io)


Fix patch:
diff --git a/docs/dev_guide/2.quick_start.md b/docs/dev_guide/2.quick_start.md
index b62d75739..6507de639 100644
--- a/docs/dev_guide/2.quick_start.md
+++ b/docs/dev_guide/2.quick_start.md
@@ -42,7 +42,7 @@ Using a docker image is our recommended way, of course, you can also configure y
 #### macOS and OS X
 
 - `git`
-- `Rust 1.83+`
+- `Rust 1.84+`
 - `LLVM 12` (Optional, only for the LLVM backend and release)
 - `Python 3.7+` (Optional, only for integration tests)
 
@@ -63,7 +63,7 @@ export PATH=<your LLVM 12 install location>/bin:$PATH
 #### Linux
 
 - `git`
-- `Rust 1.83+`
+- `Rust 1.84+`
 - `LLVM 12` (Optional, only for the LLVM backend and release)
 - `Python3 Building Dependencies` (Optional, only for integration tests)
 
@@ -106,7 +106,7 @@ ln -sf /usr/bin/wasm-ld-12 /usr/bin/wasm-ld
 #### Windows
 
 - `git`
-- `Rust 1.83+`
+- `Rust 1.84+`
 - `LLVM 12` (Optional, only for the LLVM backend and release)
 - `Python 3.7+` (Only for integration tests)
 
diff --git a/scripts/docker/kcl-builder-alpine/Dockerfile b/scripts/docker/kcl-builder-alpine/Dockerfile
index 08c85f69e..de36fdca0 100644
--- a/scripts/docker/kcl-builder-alpine/Dockerfile
+++ b/scripts/docker/kcl-builder-alpine/Dockerfile
@@ -28,7 +28,7 @@ ENV GOPATH=/go \
     CARGO_NET_GIT_FETCH_WITH_CLI=true
 
 # install rust and cargo
-RUN wget -qO- https://sh.rustup.rs | bash -s -- -y --default-toolchain 1.83.0 \
+RUN wget -qO- https://sh.rustup.rs | bash -s -- -y --default-toolchain 1.84.1 \
     && echo 'source $HOME/.cargo/env' >> $HOME/.ashrc \
     && . $HOME/.cargo/env \
     && cargo version \
diff --git a/scripts/docker/kcl-builder-arm64/Dockerfile b/scripts/docker/kcl-builder-arm64/Dockerfile
index 640e70244..5caf70256 100644
--- a/scripts/docker/kcl-builder-arm64/Dockerfile
+++ b/scripts/docker/kcl-builder-arm64/Dockerfile
@@ -12,7 +12,7 @@ RUN apt-get install -y curl make gcc git zlib1g-dev
 RUN apt install -y pkg-config libssl-dev
 
 # rust
-RUN curl https://sh.rustup.rs -sSf | bash -s -- -y --default-toolchain 1.83.0
+RUN curl https://sh.rustup.rs -sSf | bash -s -- -y --default-toolchain 1.84.1
 ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
 
 RUN cargo version
diff --git a/scripts/docker/kcl-builder-centos7/Dockerfile b/scripts/docker/kcl-builder-centos7/Dockerfile
index bf5ed977b..d3c456124 100644
--- a/scripts/docker/kcl-builder-centos7/Dockerfile
+++ b/scripts/docker/kcl-builder-centos7/Dockerfile
@@ -44,7 +44,7 @@ RUN yum install -y wget
 
 # rust
 # https://www.rust-lang.org/tools/install
-RUN curl https://sh.rustup.rs -sSf | bash -s -- -y --default-toolchain 1.83.0
+RUN curl https://sh.rustup.rs -sSf | bash -s -- -y --default-toolchain 1.84.1
 ENV PATH="/root/.cargo/bin:${PATH}"
 ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
 
diff --git a/scripts/docker/kcl-builder-centos8/Dockerfile b/scripts/docker/kcl-builder-centos8/Dockerfile
index 72e0125b5..dfb51eef9 100644
--- a/scripts/docker/kcl-builder-centos8/Dockerfile
+++ b/scripts/docker/kcl-builder-centos8/Dockerfile
@@ -23,7 +23,7 @@ RUN yum -y install ca-certificates
 # rust-1.54.0
 # cargo 1.54.0
 # RUN yum -y install rust cargo rustfmt
-RUN curl https://sh.rustup.rs -sSf | bash -s -- -y --default-toolchain 1.83.0
+RUN curl https://sh.rustup.rs -sSf | bash -s -- -y --default-toolchain 1.84.1
 RUN echo 'source $HOME/.cargo/env' >> $HOME/.bashrc
 
 ENV PATH="/root/.cargo/bin:${PATH}"
diff --git a/scripts/docker/kcl-builder-fedora39/Dockerfile b/scripts/docker/kcl-builder-fedora39/Dockerfile
index 2d1e52c2e..ccf3a9be8 100644
--- a/scripts/docker/kcl-builder-fedora39/Dockerfile
+++ b/scripts/docker/kcl-builder-fedora39/Dockerfile
@@ -13,7 +13,7 @@ RUN sed -i -e "s|#baseurl=http://download.example/pub/fedora/linux|baseurl=https
 RUN dnf -y install make which wget git ca-certificates clang llvm-devel libffi-devel python3-devel
 
 # rust
-RUN curl https://sh.rustup.rs -sSf | bash -s -- -y --default-toolchain 1.83.0
+RUN curl https://sh.rustup.rs -sSf | bash -s -- -y --default-toolchain 1.84.0
     echo 'source $HOME/.cargo/env' >> $HOME/.bashrc
 ENV PATH="/root/.cargo/bin:${PATH}"
 ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
diff --git a/scripts/docker/kcl-builder/Dockerfile b/scripts/docker/kcl-builder/Dockerfile
index c5223cd49..422ed5d6a 100644
--- a/scripts/docker/kcl-builder/Dockerfile
+++ b/scripts/docker/kcl-builder/Dockerfile
@@ -28,7 +28,7 @@ RUN ln -sf /usr/local/python3.9/bin/python3.9 /usr/bin/python3.9
 
 # rust
 # https://www.rust-lang.org/tools/install
-RUN curl https://sh.rustup.rs -sSf | bash -s -- -y --default-toolchain 1.83.0
+RUN curl https://sh.rustup.rs -sSf | bash -s -- -y --default-toolchain 1.84.1
 ENV PATH="/root/.cargo/bin:${PATH}"
 ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
 


Test patch:
diff --git a/.github/workflows/compiler_base_test.yaml b/.github/workflows/compiler_base_test.yaml
index 303de1bb8..cab4fe12d 100644
--- a/.github/workflows/compiler_base_test.yaml
+++ b/.github/workflows/compiler_base_test.yaml
@@ -22,7 +22,7 @@ jobs:
       - name: Install rust nightly toolchain
         uses: actions-rs/toolchain@v1
         with:
-          toolchain: 1.83
+          toolchain: 1.84.1
           override: true
           components: clippy, rustfmt
       - name: Rust code format check
@@ -43,7 +43,7 @@ jobs:
       - name: Install rust nightly toolchain
         uses: actions-rs/toolchain@v1
         with:
-          toolchain: 1.83
+          toolchain: 1.84.1
           override: true
           components: clippy, rustfmt
       - name: Compiler_base rust unit test
diff --git a/.github/workflows/macos_arm_test.yaml b/.github/workflows/macos_arm_test.yaml
index 0fe587251..93e4a0831 100644
--- a/.github/workflows/macos_arm_test.yaml
+++ b/.github/workflows/macos_arm_test.yaml
@@ -32,7 +32,7 @@ jobs:
       - name: Install rust nightly toolchain
         uses: actions-rs/toolchain@v1
         with:
-          toolchain: 1.83
+          toolchain: 1.84.1
           override: true
           components: clippy, rustfmt
       - name: Set up python
diff --git a/.github/workflows/macos_test.yaml b/.github/workflows/macos_test.yaml
index 65e334b31..b5ff67b08 100644
--- a/.github/workflows/macos_test.yaml
+++ b/.github/workflows/macos_test.yaml
@@ -47,7 +47,7 @@ jobs:
       - name: Install rust nightly toolchain
         uses: actions-rs/toolchain@v1
         with:
-          toolchain: 1.83
+          toolchain: 1.84.1
           override: true
           components: clippy, rustfmt
       - name: Code format check
diff --git a/.github/workflows/ubuntu_arm_test.yaml b/.github/workflows/ubuntu_arm_test.yaml
index 8960a1406..784898190 100644
--- a/.github/workflows/ubuntu_arm_test.yaml
+++ b/.github/workflows/ubuntu_arm_test.yaml
@@ -32,7 +32,7 @@ jobs:
       - name: Install rust nightly toolchain
         uses: actions-rs/toolchain@v1
         with:
-          toolchain: 1.83
+          toolchain: 1.84.1
           override: true
           components: clippy, rustfmt
       - name: Code format check
diff --git a/.github/workflows/ubuntu_test.yaml b/.github/workflows/ubuntu_test.yaml
index 60c55ba71..b58806489 100644
--- a/.github/workflows/ubuntu_test.yaml
+++ b/.github/workflows/ubuntu_test.yaml
@@ -32,7 +32,7 @@ jobs:
       - name: Install rust nightly toolchain
         uses: actions-rs/toolchain@v1
         with:
-          toolchain: 1.83
+          toolchain: 1.84.1
           override: true
           components: clippy, rustfmt
       - name: Code format check
diff --git a/.github/workflows/windows_mingw_test.yaml b/.github/workflows/windows_mingw_test.yaml
index 0bdcdcbc0..ebd38babd 100644
--- a/.github/workflows/windows_mingw_test.yaml
+++ b/.github/workflows/windows_mingw_test.yaml
@@ -19,7 +19,7 @@ jobs:
       - name: Install rust nightly toolchain
         uses: actions-rs/toolchain@v1
         with:
-          toolchain: 1.83
+          toolchain: 1.84.1
           override: true
           components: clippy, rustfmt
 
diff --git a/.github/workflows/windows_test.yaml b/.github/workflows/windows_test.yaml
index f82a48147..cc34af67f 100644
--- a/.github/workflows/windows_test.yaml
+++ b/.github/workflows/windows_test.yaml
@@ -22,7 +22,7 @@ jobs:
       - name: Install rust nightly toolchain
         uses: actions-rs/toolchain@v1
         with:
-          toolchain: 1.83
+          toolchain: 1.84.1
           override: true
           components: clippy, rustfmt