-
Notifications
You must be signed in to change notification settings - Fork 120
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
Conversation
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
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pls add more comments on pub methods/functions/structs and unit/benchmark tests.
69feebd
to
41686fb
Compare
@@ -0,0 +1,25 @@ | |||
#pragma once | |||
#ifndef KCLVM_SERVICE_CALL | |||
#define KCLVM_SERVICE_CALL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#define __KCLVM_SERVICE_CALL_H__
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to create a new issue and then complete the comments and documentation of kclvm/api/gpyrpc.proto
, because this is an important user interface. cc @chai2010
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Benchmark and fatigue tests are required to test for memory leaks and performance issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
U can add --exclude kclvm/api/src/model/gpyrpc.rs
file in make codecov
and make codecov-lcov
at kclvm/makefile
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove the comments?
} | ||
} | ||
|
||
pub fn ping(serv: &mut KclvmService, args: &[u8]) -> *const c_char { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more documents on Rust public functions.
.into_raw() | ||
} | ||
|
||
pub fn exec_program(serv: &mut KclvmService, args: &[u8]) -> *const c_char { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more documents on Rust public functions.
} | ||
} | ||
|
||
pub fn exec_program(&self, args: &ExecProgram_Args) -> ExecProgram_Result { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exec_program
API and CLI implementation and error handling need to be considered uniformly,
result.yaml_result = yaml_result; | ||
} | ||
} | ||
result |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put error message in result.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering the python agent registering cc @chai2010
@@ -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 |
There was a problem hiding this comment.
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
1. Does this PR affect any open issues?(Y/N) and add issue references (e.g. "fix #123", "re #123".):
re Feature : C API for Kclvm Cli #125
2. What is the scope of this PR (e.g. component or file name):
3. Provide a description of the PR(e.g. more details, effects, motivations or doc link):
4. Are there any breaking changes?(Y/N) and describe the breaking changes(e.g. more details, motivations or doc link):
5. Are there test cases for these changes?(Y/N) select and add more details, references or doc links:
KCLVM/kclvm/src/api_test.rs
6. Release note
Please refer to Release Notes Language Style Guide to write a quality release note.