Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Feat : Support Call Kclvm Cli by C API #123

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/github-actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Install rust nightly toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
toolchain: 1.61
override: true
components: clippy, rustfmt
- name: Rust grammar test
Expand Down
2 changes: 1 addition & 1 deletion internal/kclvm_py/scripts/build-cpython.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ do
sslpath=$(brew --prefix openssl@1.1)
fi

if [ x"$(uname -m)" == x"arm64" ]; then
if [ x"$(uname -m)" == x"arm64" ] || [ x"$(uname -m)" == x"x86_64" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

U can rebase main branch to solve this

py_ver_major="3"
py_ver_minor="9"
py_ver_micro="12"
Expand Down
144 changes: 142 additions & 2 deletions kclvm/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion kclvm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ kclvm-sema = {path = "./sema", version = "0.1.0"}
kclvm-tools = {path = "./tools", version = "0.1.0"}
kclvm-version = {path = "./version", version = "0.1.0"}
kclvm-error = {path = "./error", version = "0.1.0"}
kclvm-api = {path = "./api" , version = "0.1.0"}

[profile.release]
rpath = true
panic = "unwind"
opt-level = "z" # Optimize for size.
lto = true

[workspace]
members = [
Expand All @@ -52,5 +59,6 @@ members = [
"sema",
"span",
"tools",
"version"
"version",
"api"
]
26 changes: 26 additions & 0 deletions kclvm/api/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[package]
name = "kclvm-api"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the comments?

#[lib]
#name = "kclvm_spec_cdylib"
#crate-type = ["rlib"]
#path = "src/lib.rs"


[dependencies]
protobuf = "3.1.0"
serde_json = "1.0"
serde_yaml = "0.8.26"
protobuf-json-mapping = "3.1.0"
serde = { version = "1", features = ["derive"] }

kclvm-runner = {path = "../runner" , version = "0.1.0"}
kclvm-parser = {path = "../parser" , version = "0.1.0"}
kclvm-ast = {path = "../ast" , version = "0.1.0"}

[build_dependencies]
protobuf-codegen= "3.1.0"
protoc-bin-vendored = "3.0.0"
10 changes: 10 additions & 0 deletions kclvm/api/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
fn main() {
protobuf_codegen::Codegen::new()
.protoc()
.protoc_path(&protoc_bin_vendored::protoc_bin_path().unwrap())
.out_dir("src/model")
.include(".")
.inputs(&["./gpyrpc.proto"])
.run()
.expect("Running protoc failed.");
}
Loading