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/VERSION b/VERSION
index 142464bf2..027934ea1 100644
--- a/VERSION
+++ b/VERSION
@@ -1,1 +1,1 @@
-0.11.0
\ No newline at end of file
+0.11.1
\ No newline at end of file
diff --git a/cli/Cargo.toml b/cli/Cargo.toml
index 30ea22483..836626f1a 100644
--- a/cli/Cargo.toml
+++ b/cli/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "kclvm_cli"
-version = "0.11.0"
+version = "0.11.1"
 edition = "2021"
 
 [[bin]]
diff --git a/kclvm/Cargo.lock b/kclvm/Cargo.lock
index 28d20ba40..182c3547b 100644
--- a/kclvm/Cargo.lock
+++ b/kclvm/Cargo.lock
@@ -1847,7 +1847,7 @@ dependencies = [
 
 [[package]]
 name = "kcl-language-server"
-version = "0.11.0"
+version = "0.11.1"
 dependencies = [
  "anyhow",
  "chrono",
@@ -1892,7 +1892,7 @@ dependencies = [
 
 [[package]]
 name = "kclvm"
-version = "0.11.0"
+version = "0.11.1"
 dependencies = [
  "kclvm-api",
  "kclvm-ast",
@@ -1914,7 +1914,7 @@ dependencies = [
 
 [[package]]
 name = "kclvm-api"
-version = "0.11.0"
+version = "0.11.1"
 dependencies = [
  "anyhow",
  "criterion",
@@ -1954,7 +1954,7 @@ dependencies = [
 
 [[package]]
 name = "kclvm-ast"
-version = "0.11.0"
+version = "0.11.1"
 dependencies = [
  "anyhow",
  "compiler_base_span",
@@ -1970,7 +1970,7 @@ dependencies = [
 
 [[package]]
 name = "kclvm-ast-pretty"
-version = "0.11.0"
+version = "0.11.1"
 dependencies = [
  "compiler_base_macros",
  "compiler_base_session",
@@ -1984,7 +1984,7 @@ dependencies = [
 
 [[package]]
 name = "kclvm-cmd"
-version = "0.11.0"
+version = "0.11.1"
 dependencies = [
  "anyhow",
  "clap",
@@ -2002,7 +2002,7 @@ dependencies = [
 
 [[package]]
 name = "kclvm-compiler"
-version = "0.11.0"
+version = "0.11.1"
 dependencies = [
  "ahash",
  "bit-set",
@@ -2022,7 +2022,7 @@ dependencies = [
 
 [[package]]
 name = "kclvm-config"
-version = "0.11.0"
+version = "0.11.1"
 dependencies = [
  "ahash",
  "anyhow",
@@ -2046,7 +2046,7 @@ dependencies = [
 
 [[package]]
 name = "kclvm-driver"
-version = "0.11.0"
+version = "0.11.1"
 dependencies = [
  "anyhow",
  "flate2",
@@ -2068,7 +2068,7 @@ dependencies = [
 
 [[package]]
 name = "kclvm-error"
-version = "0.11.0"
+version = "0.11.1"
 dependencies = [
  "annotate-snippets",
  "anyhow",
@@ -2089,7 +2089,7 @@ dependencies = [
 
 [[package]]
 name = "kclvm-evaluator"
-version = "0.11.0"
+version = "0.11.1"
 dependencies = [
  "anyhow",
  "generational-arena",
@@ -2106,7 +2106,7 @@ dependencies = [
 
 [[package]]
 name = "kclvm-lexer"
-version = "0.11.0"
+version = "0.11.1"
 dependencies = [
  "expect-test",
  "kclvm-error",
@@ -2116,7 +2116,7 @@ dependencies = [
 
 [[package]]
 name = "kclvm-loader"
-version = "0.11.0"
+version = "0.11.1"
 dependencies = [
  "anyhow",
  "indexmap 1.9.3",
@@ -2133,7 +2133,7 @@ dependencies = [
 
 [[package]]
 name = "kclvm-macros"
-version = "0.11.0"
+version = "0.11.1"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -2143,7 +2143,7 @@ dependencies = [
 
 [[package]]
 name = "kclvm-parser"
-version = "0.11.0"
+version = "0.11.1"
 dependencies = [
  "anyhow",
  "bstr",
@@ -2178,7 +2178,7 @@ dependencies = [
 
 [[package]]
 name = "kclvm-query"
-version = "0.11.0"
+version = "0.11.1"
 dependencies = [
  "anyhow",
  "compiler_base_macros",
@@ -2200,7 +2200,7 @@ dependencies = [
 
 [[package]]
 name = "kclvm-runner"
-version = "0.11.0"
+version = "0.11.1"
 dependencies = [
  "anyhow",
  "cc",
@@ -2235,7 +2235,7 @@ dependencies = [
 
 [[package]]
 name = "kclvm-runtime"
-version = "0.11.0"
+version = "0.11.1"
 dependencies = [
  "ahash",
  "anyhow",
@@ -2273,7 +2273,7 @@ dependencies = [
 
 [[package]]
 name = "kclvm-sema"
-version = "0.11.0"
+version = "0.11.1"
 dependencies = [
  "ahash",
  "anyhow",
@@ -2308,7 +2308,7 @@ dependencies = [
 
 [[package]]
 name = "kclvm-span"
-version = "0.11.0"
+version = "0.11.1"
 dependencies = [
  "compiler_base_span",
  "kclvm-macros",
@@ -2318,7 +2318,7 @@ dependencies = [
 
 [[package]]
 name = "kclvm-tools"
-version = "0.11.0"
+version = "0.11.1"
 dependencies = [
  "anyhow",
  "compiler_base_session",
@@ -2351,7 +2351,7 @@ dependencies = [
 
 [[package]]
 name = "kclvm-utils"
-version = "0.11.0"
+version = "0.11.1"
 dependencies = [
  "anyhow",
  "fslock",
@@ -2360,7 +2360,7 @@ dependencies = [
 
 [[package]]
 name = "kclvm-version"
-version = "0.11.0"
+version = "0.11.1"
 dependencies = [
  "vergen-gitcl",
 ]
diff --git a/kclvm/Cargo.toml b/kclvm/Cargo.toml
index f2cf647a5..0e47d5dd9 100644
--- a/kclvm/Cargo.toml
+++ b/kclvm/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "kclvm"
-version = "0.11.0"
+version = "0.11.1"
 edition = "2021"
 
 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
diff --git a/kclvm/api/Cargo.toml b/kclvm/api/Cargo.toml
index 4d4ab7953..a55442f8f 100644
--- a/kclvm/api/Cargo.toml
+++ b/kclvm/api/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "kclvm-api"
-version = "0.11.0"
+version = "0.11.1"
 edition = "2021"
 
 [dependencies]
diff --git a/kclvm/ast/Cargo.toml b/kclvm/ast/Cargo.toml
index 732749011..142165479 100644
--- a/kclvm/ast/Cargo.toml
+++ b/kclvm/ast/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "kclvm-ast"
-version = "0.11.0"
+version = "0.11.1"
 edition = "2021"
 
 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
diff --git a/kclvm/ast_pretty/Cargo.toml b/kclvm/ast_pretty/Cargo.toml
index eacb583f8..dc5d53546 100644
--- a/kclvm/ast_pretty/Cargo.toml
+++ b/kclvm/ast_pretty/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "kclvm-ast-pretty"
-version = "0.11.0"
+version = "0.11.1"
 edition = "2021"
 
 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
diff --git a/kclvm/cmd/Cargo.toml b/kclvm/cmd/Cargo.toml
index 5aa586ae3..157cbd9e5 100644
--- a/kclvm/cmd/Cargo.toml
+++ b/kclvm/cmd/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "kclvm-cmd"
-version = "0.11.0"
+version = "0.11.1"
 edition = "2021"
 
 [dependencies]
diff --git a/kclvm/compiler/Cargo.toml b/kclvm/compiler/Cargo.toml
index c646865c4..08ec96bd3 100644
--- a/kclvm/compiler/Cargo.toml
+++ b/kclvm/compiler/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "kclvm-compiler"
-version = "0.11.0"
+version = "0.11.1"
 edition = "2021"
 
 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
diff --git a/kclvm/config/Cargo.toml b/kclvm/config/Cargo.toml
index 0da52d958..a29c0c6f9 100644
--- a/kclvm/config/Cargo.toml
+++ b/kclvm/config/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "kclvm-config"
-version = "0.11.0"
+version = "0.11.1"
 edition = "2021"
 
 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
diff --git a/kclvm/driver/Cargo.toml b/kclvm/driver/Cargo.toml
index 66497d578..7b990d2d0 100644
--- a/kclvm/driver/Cargo.toml
+++ b/kclvm/driver/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "kclvm-driver"
-version = "0.11.0"
+version = "0.11.1"
 edition = "2021"
 
 # # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
diff --git a/kclvm/error/Cargo.toml b/kclvm/error/Cargo.toml
index 8ce827d03..c6ca27b2a 100644
--- a/kclvm/error/Cargo.toml
+++ b/kclvm/error/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "kclvm-error"
-version = "0.11.0"
+version = "0.11.1"
 edition = "2021"
 
 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
diff --git a/kclvm/evaluator/Cargo.toml b/kclvm/evaluator/Cargo.toml
index d4338b1cf..20d8d2fa1 100644
--- a/kclvm/evaluator/Cargo.toml
+++ b/kclvm/evaluator/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "kclvm-evaluator"
-version = "0.11.0"
+version = "0.11.1"
 edition = "2021"
 
 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
diff --git a/kclvm/lexer/Cargo.toml b/kclvm/lexer/Cargo.toml
index e4b147304..575273a1a 100644
--- a/kclvm/lexer/Cargo.toml
+++ b/kclvm/lexer/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "kclvm-lexer"
-version = "0.11.0"
+version = "0.11.1"
 edition = "2021"
 
 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
diff --git a/kclvm/loader/Cargo.toml b/kclvm/loader/Cargo.toml
index b89dd0079..52e3a4112 100644
--- a/kclvm/loader/Cargo.toml
+++ b/kclvm/loader/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "kclvm-loader"
-version = "0.11.0"
+version = "0.11.1"
 edition = "2021"
 
 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
diff --git a/kclvm/macros/Cargo.toml b/kclvm/macros/Cargo.toml
index 273f91274..140db390c 100644
--- a/kclvm/macros/Cargo.toml
+++ b/kclvm/macros/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "kclvm-macros"
-version = "0.11.0"
+version = "0.11.1"
 edition = "2021"
 
 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
diff --git a/kclvm/parser/Cargo.toml b/kclvm/parser/Cargo.toml
index ed82afe41..2f8ef7015 100644
--- a/kclvm/parser/Cargo.toml
+++ b/kclvm/parser/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "kclvm-parser"
-version = "0.11.0"
+version = "0.11.1"
 edition = "2021"
 
 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
diff --git a/kclvm/query/Cargo.toml b/kclvm/query/Cargo.toml
index eb5bc552c..02f538053 100644
--- a/kclvm/query/Cargo.toml
+++ b/kclvm/query/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "kclvm-query"
-version = "0.11.0"
+version = "0.11.1"
 edition = "2021"
 
 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
diff --git a/kclvm/runner/Cargo.toml b/kclvm/runner/Cargo.toml
index 9cfe718ab..3f31f9042 100644
--- a/kclvm/runner/Cargo.toml
+++ b/kclvm/runner/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "kclvm-runner"
-version = "0.11.0"
+version = "0.11.1"
 edition = "2021"
 
 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
diff --git a/kclvm/runtime/Cargo.toml b/kclvm/runtime/Cargo.toml
index f0e4d1024..a5ea2c818 100644
--- a/kclvm/runtime/Cargo.toml
+++ b/kclvm/runtime/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "kclvm-runtime"
-version = "0.11.0"
+version = "0.11.1"
 edition = "2021"
 
 [dependencies]
diff --git a/kclvm/runtime/src/_kcl_run.rs b/kclvm/runtime/src/_kcl_run.rs
index 4eba2cfff..729a51cbc 100644
--- a/kclvm/runtime/src/_kcl_run.rs
+++ b/kclvm/runtime/src/_kcl_run.rs
@@ -40,7 +40,7 @@ type kclvm_int_t = i64;
 #[allow(dead_code, non_camel_case_types)]
 type kclvm_float_t = f64;
 
-#[derive(Debug, Default)]
+#[derive(Debug, Default, Clone)]
 pub struct RuntimePanicRecord {
     pub kcl_panic_info: bool,
     pub message: String,
diff --git a/kclvm/sema/Cargo.toml b/kclvm/sema/Cargo.toml
index 966215911..126df806e 100644
--- a/kclvm/sema/Cargo.toml
+++ b/kclvm/sema/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "kclvm-sema"
-version = "0.11.0"
+version = "0.11.1"
 edition = "2021"
 
 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
diff --git a/kclvm/span/Cargo.toml b/kclvm/span/Cargo.toml
index 8c7ef5611..103ee7bfe 100644
--- a/kclvm/span/Cargo.toml
+++ b/kclvm/span/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "kclvm-span"
-version = "0.11.0"
+version = "0.11.1"
 edition = "2021"
 
 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
diff --git a/kclvm/tools/Cargo.toml b/kclvm/tools/Cargo.toml
index 9c09941e3..45844854d 100644
--- a/kclvm/tools/Cargo.toml
+++ b/kclvm/tools/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "kclvm-tools"
-version = "0.11.0"
+version = "0.11.1"
 edition = "2021"
 
 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
diff --git a/kclvm/tools/src/LSP/Cargo.toml b/kclvm/tools/src/LSP/Cargo.toml
index e3967bb50..db74b593d 100644
--- a/kclvm/tools/src/LSP/Cargo.toml
+++ b/kclvm/tools/src/LSP/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "kcl-language-server"
-version = "0.11.0"
+version = "0.11.1"
 edition = "2021"
 
 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
diff --git a/kclvm/utils/Cargo.toml b/kclvm/utils/Cargo.toml
index 7337f69b0..fc76823c0 100644
--- a/kclvm/utils/Cargo.toml
+++ b/kclvm/utils/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "kclvm-utils"
-version = "0.11.0"
+version = "0.11.1"
 edition = "2021"
 
 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
diff --git a/kclvm/version/Cargo.toml b/kclvm/version/Cargo.toml
index 925d9b7d3..1546bde14 100644
--- a/kclvm/version/Cargo.toml
+++ b/kclvm/version/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "kclvm-version"
-version = "0.11.0"
+version = "0.11.1"
 edition = "2021"
 
 [build-dependencies]


Test patch: