Comments (4)
Hello @AdmiralNemo. Thank you for your feedback. This may be due to Rust FFI type of core::ffi::c_char
varies on different machines, and I will try using the generic fix later to address this issue. #983
from kcl.
Related Issue: kcl-lang/cli#31 and #985
from kcl.
Thanks for the quick response! With the latest commit, I'm seeing some different but related compilation errors:
error[E0308]: mismatched types
--> runtime/src/context/api.rs:93:50
|
93 | p.set_kcl_location_info(None, Some(c2str(filename)), Some(line), Some(col));
| ----- ^^^^^^^^ expected `*const u8`, found `*const i8`
| |
| arguments to this function are incorrect
|
= note: expected raw pointer `*const u8`
found raw pointer `*const i8`
note: function defined here
--> runtime/src/api/utils.rs:40:15
|
40 | pub(crate) fn c2str<'a>(s: *const c_char) -> &'a str {
| ^^^^^ ----------------
error[E0308]: mismatched types
--> runtime/src/context/api.rs:107:33
|
107 | p.set_kcl_pkgpath(c2str(pkgpath));
| ----- ^^^^^^^ expected `*const u8`, found `*const i8`
| |
| arguments to this function are incorrect
|
= note: expected raw pointer `*const u8`
found raw pointer `*const i8`
note: function defined here
--> runtime/src/api/utils.rs:40:15
|
40 | pub(crate) fn c2str<'a>(s: *const c_char) -> &'a str {
| ^^^^^ ----------------
error[E0308]: mismatched types
--> runtime/src/context/api.rs:119:36
|
119 | ctx.set_kcl_filename(c2str(filename));
| ----- ^^^^^^^^ expected `*const u8`, found `*const i8`
| |
| arguments to this function are incorrect
|
= note: expected raw pointer `*const u8`
found raw pointer `*const i8`
note: function defined here
--> runtime/src/api/utils.rs:40:15
|
40 | pub(crate) fn c2str<'a>(s: *const c_char) -> &'a str {
| ^^^^^ ----------------
error[E0308]: mismatched types
--> runtime/src/context/api.rs:208:5
|
193 | ) -> *const c_char {
| ------------- expected `*const u8` because of return type
...
208 | result_json
| ^^^^^^^^^^^ expected `*const u8`, found `*const i8`
|
= note: expected raw pointer `*const u8`
found raw pointer `*const i8`
error[E0308]: mismatched types
--> runtime/src/value/api.rs:196:33
|
196 | if v.is_null() || *v == '\0' as i8 {
| ^^^^^^^^^^ expected `u8`, found `i8`
error[E0277]: can't compare `u8` with `i8`
--> runtime/src/value/api.rs:196:30
|
196 | if v.is_null() || *v == '\0' as i8 {
| ^^ no implementation for `u8 == i8`
|
= help: the trait `PartialEq<i8>` is not implemented for `u8`
= help: the following other types implement trait `PartialEq<Rhs>`:
<u8 as PartialEq<serde_json::Value>>
<u8 as PartialEq>
error[E0308]: mismatched types
--> runtime/src/value/api.rs:546:36
|
543 | pub unsafe extern "C" fn kclvm_value_Str_ptr(p: *const kclvm_value_ref_t) -> *const kclvm_char_t {
| ------------------- expected `*const u8` because of return type
...
546 | Value::str_value(ref v) => v.as_ptr() as *const i8,
| ^^^^^^^^^^^^^^^^^^^^^^^ expected `*const u8`, found `*const i8`
|
= note: expected raw pointer `*const u8`
found raw pointer `*const i8`
error[E0308]: mismatched types
--> runtime/src/stdlib/builtin_api.rs:17:35
|
17 | ctx.builtin_option_init(c2str(key), c2str(value));
| ----- ^^^ expected `*const u8`, found `*const i8`
| |
| arguments to this function are incorrect
|
= note: expected raw pointer `*const u8`
found raw pointer `*const i8`
note: function defined here
--> runtime/src/api/utils.rs:40:15
|
40 | pub(crate) fn c2str<'a>(s: *const c_char) -> &'a str {
| ^^^^^ ----------------
error[E0308]: mismatched types
--> runtime/src/stdlib/builtin_api.rs:17:47
|
17 | ctx.builtin_option_init(c2str(key), c2str(value));
| ----- ^^^^^ expected `*const u8`, found `*const i8`
| |
| arguments to this function are incorrect
|
= note: expected raw pointer `*const u8`
found raw pointer `*const i8`
note: function defined here
--> runtime/src/api/utils.rs:40:15
|
40 | pub(crate) fn c2str<'a>(s: *const c_char) -> &'a str {
| ^^^^^ ----------------
error[E0308]: mismatched types
--> runtime/src/stdlib/plugin.rs:44:48
|
44 | let result_json = kclvm_plugin_invoke_json(method, args_json, kwargs_json);
| ------------------------ ^^^^^^ expected `*const u8`, found `*const i8`
| |
| arguments to this function are incorrect
|
= note: expected raw pointer `*const u8`
found raw pointer `*const i8`
note: function defined here
--> runtime/src/stdlib/plugin.rs:66:19
|
66 | pub extern "C" fn kclvm_plugin_invoke_json(
| ^^^^^^^^^^^^^^^^^^^^^^^^
67 | method: *const c_char,
| ---------------------
error[E0308]: mismatched types
--> runtime/src/_kcl_run.rs:190:34
|
190 | kclvm_value_Str(ctx, b"{}\0" as *const u8 as *const kclvm_char_t)
| --------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `*const u8`, found `*const i8`
| |
| arguments to this function are incorrect
|
= note: expected raw pointer `*const u8`
found raw pointer `*const i8`
note: function defined here
--> runtime/src/value/api.rs:190:26
|
190 | pub unsafe extern "C" fn kclvm_value_Str(
| ^^^^^^^^^^^^^^^
191 | ctx: *mut kclvm_context_t,
192 | v: *const kclvm_char_t,
| ----------------------
error[E0308]: mismatched types
--> runtime/src/_kcl_run.rs:203:39
|
203 | std::ptr::copy(c_str_ptr, result_buffer, return_len as usize);
| -------------- ^^^^^^^^^^^^^ expected `*mut u8`, found `*mut i8`
| |
| arguments to this function are incorrect
|
= note: expected raw pointer `*mut u8`
found raw pointer `*mut i8`
note: function defined here
--> /build/rustc-ZBSOmY/rustc-1.70.0+dfsg0ubuntu1~bpo2/library/core/src/intrinsics.rs:2710:21
from kcl.
@AdmiralNemo Sorry, see this PR: #986, it is merged. You can try it again. 🙏 Pls note the build deps. https://github.com/kcl-lang/kcl/blob/main/scripts/docker/kcl-builder-arm64/Dockerfile
from kcl.
Related Issues (20)
- Is there a function to remove duplicates from a list of strings HOT 2
- Option to not sort keys within a json object HOT 3
- [Bug] Importing Dynatrace Config schema ends abruptly without a complete schema HOT 3
- [Bug] Import of modules containing "-" fails HOT 7
- [feature] Support for type arguments for convenient factory functions HOT 3
- [Discussion] Issue with importing "-" packages either on the same level or nested. HOT 2
- Extend file module functions (for smoother GitOps) HOT 3
- kcl executable missing from github releases HOT 1
- [Enhancement] Proposal for new language feature for the short hand property HOT 1
- [Bug] Import JsonSchema: all props converted to snake case HOT 1
- [Enhancement] Create a Sublime Text file with language support
- [FAQ] Read a file and crossplane function kcl in kcl example HOT 5
- [bug] file mkdir and delete don't seem to work HOT 3
- YAML comments HOT 2
- [bug] lsp hover content error HOT 1
- [LFX PreTest] pretest for LFX LSP hover content HOT 6
- [Enhancement] Is there a way to read values from environment variables?
- [Bug] Compile Cache causes lsp falsely report errors
- System Functions disallow use of line wrapping (newlines around params)
- Support hyphen on attribute name HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kcl.