Open yonas opened 9 months ago
Hello @yonas. KCL currently does not have a FreeBSD distribution package? Are you willing to contribute it?
Hello @yonas. KCL currently does not have a FreeBSD distribution package? Are you willing to contribute it?
@Peefy Yes, if we can get it to compile. Any idea what might be causing this?
@yonas This is because KCL lacks dynamic library files for FreeBSD, so there is no conditional compilation for configuring the kcl-lang/lib
library. Currently, only Windows, Linux, and macos are available. See here: https://github.com/kcl-lang/lib
I see KCL has been completely rewritten in Rust! :+1: I'm getting this error now:
Compiling prost-wkt v0.4.1 (/git/kcl/kclvm/third-party/prost-wkt)
error: failed to run custom build command for `prost-wkt-types v0.4.1 (/git/kcl/kclvm/third-party/prost-wkt/wkt-types)`
Caused by:
process didn't exit successfully: `/git/kcl/kclvm/target/release/build/prost-wkt-types-4463054462d69585/build-script-build` (exit status: 101)
--- stderr
thread 'main' panicked at third-party/prost-wkt/wkt-types/build.rs:19:52:
called `Result::unwrap()` on an `Err` value: Error { os: "freebsd", arch: "x86_64" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
gmake: *** [Makefile:26: build] Error 101
We need a way to detect the location of protoc
on FreeBSD. Changing these lines resolved the issue:
--- a/kclvm/api/build.rs
+++ b/kclvm/api/build.rs
@@ -8,7 +8,7 @@ fn main() {
if env::var("PROTOC").is_err() {
env::set_var(
"PROTOC",
- protoc_bin_vendored::protoc_bin_path().unwrap().as_os_str(),
+ "/usr/local/bin/protoc"
);
}
diff --git a/kclvm/third-party/prost-wkt/wkt-types/build.rs b/kclvm/third-party/prost-wkt/wkt-types/build.rs
index 620c759..f7850d8 100644
--- a/kclvm/third-party/prost-wkt/wkt-types/build.rs
+++ b/kclvm/third-party/prost-wkt/wkt-types/build.rs
@@ -16,7 +16,7 @@ fn main() {
if env::var("PROTOC").is_err() {
env::set_var(
"PROTOC",
- protoc_bin_vendored::protoc_bin_path().unwrap().as_os_str(),
+ "/usr/local/bin/protoc"
);
}
let dir = PathBuf::from(env::var("OUT_DIR").unwrap());
@yonas I see. You can push the vendored protoc binary here https://github.com/kcl-lang/rust-protoc-bin-vendored or set the PROTOC
env
Bug Report
1. Minimal reproduce step (Required)
Run
$ go install kcl-lang.io/cli/cmd/kcl@latest
on FreeBSD. Works for me in Ubuntu 23.2. What did you expect to see? (Required)
3. What did you see instead (Required)
4. What is your KCL components version? (Required)
Using '@latest' as of Feb 4, 2024.
OS:
FreeBSD 14