kclvm: 0.8.7 -> 0.9.3

Also adds support to macos aarch64 platform
This commit is contained in:
Yvan da Silva
2024-07-25 17:37:49 +02:00
parent 92f3ec3b8b
commit fdb4310a60
3 changed files with 855 additions and 273 deletions
+803 -246
View File
File diff suppressed because it is too large Load Diff
+33 -24
View File
@@ -1,37 +1,46 @@
diff --git a/api/build.rs b/api/build.rs
index 617c1b9a..20d728e3 100644
diff --git a/kclvm/api/build.rs b/kclvm/api/build.rs
index 7d1c39b7..0104bb6f 100644
--- a/api/build.rs
+++ b/api/build.rs
@@ -5,10 +5,10 @@ use prost_wkt_build::{FileDescriptorSet, Message};
@@ -5,12 +5,12 @@ use prost_wkt_build::{FileDescriptorSet, Message};
/// According to the file kclvm/spec/gpyrpc/gpyrpc.proto, automatically generate
/// the corresponding rust source file to the directory src/model
fn main() {
- std::env::set_var(
- "PROTOC",
- protoc_bin_vendored::protoc_bin_path().unwrap().as_os_str(),
- );
+ // std::env::set_var(
+ // "PROTOC",
+ // protoc_bin_vendored::protoc_bin_path().unwrap().as_os_str(),
+ // );
- if env::var("PROTOC").is_err() {
- env::set_var(
- "PROTOC",
- protoc_bin_vendored::protoc_bin_path().unwrap().as_os_str(),
- );
- }
+ //if env::var("PROTOC").is_err() {
+ // env::set_var(
+ // "PROTOC",
+ // protoc_bin_vendored::protoc_bin_path().unwrap().as_os_str(),
+ // );
+ //}
let out = PathBuf::from(env::var("OUT_DIR").unwrap());
let descriptor_file = out.join("kclvm_service_descriptor.bin");
diff --git b/third-party/prost-wkt/wkt-types/build.rs a/third-party/prost-wkt/wkt-types/build.rs
index e49222d5..a933ddf4 100644
diff --git a/kclvm/third-party/prost-wkt/wkt-types/build.rs b/kclvm/third-party/prost-wkt/wkt-types/build.rs
index 620c759a..7f77e1b1 100644
--- a/third-party/prost-wkt/wkt-types/build.rs
+++ b/third-party/prost-wkt/wkt-types/build.rs
@@ -13,10 +13,10 @@ use regex::Regex;
@@ -13,12 +13,12 @@ use regex::Regex;
fn main() {
//hack: set protoc_bin_vendored::protoc_bin_path() to PROTOC
- std::env::set_var(
- "PROTOC",
- protoc_bin_vendored::protoc_bin_path().unwrap().as_os_str(),
- );
+ // std::env::set_var(
+ // "PROTOC",
+ // protoc_bin_vendored::protoc_bin_path().unwrap().as_os_str(),
+ // );
- if env::var("PROTOC").is_err() {
- env::set_var(
- "PROTOC",
- protoc_bin_vendored::protoc_bin_path().unwrap().as_os_str(),
- );
- }
+ //if env::var("PROTOC").is_err() {
+ // env::set_var(
+ // "PROTOC",
+ // protoc_bin_vendored::protoc_bin_path().unwrap().as_os_str(),
+ // );
+ //}
let dir = PathBuf::from(env::var("OUT_DIR").unwrap());
process_prost_pbtime(&dir);
+19 -3
View File
@@ -1,19 +1,22 @@
{ lib
, stdenv
, rustPlatform
, fetchFromGitHub
, protobuf
, pkg-config
, darwin
, rustc
,
}:
rustPlatform.buildRustPackage rec {
pname = "kclvm";
version = "0.8.7";
version = "0.9.3";
src = fetchFromGitHub {
owner = "kcl-lang";
repo = "kcl";
rev = "v${version}";
hash = "sha256-ieGpuNkzT6AODZYUcEanb7Jpb+PXclnQ9KkdmlehK0o=";
hash = "sha256-nk5oJRTBRj0LE2URJqno8AoZ+/342C2tEt8d6k2MAc8=";
};
sourceRoot = "source/kclvm";
@@ -21,9 +24,22 @@ rustPlatform.buildRustPackage rec {
lockFile = ./Cargo.lock;
outputHashes = {
"inkwell-0.2.0" = "sha256-JxSlhShb3JPhsXK8nGFi2uGPp8XqZUSiqniLBrhr+sM=";
"protoc-bin-vendored-3.1.0" = "sha256-RRqpPMJygpKGG5NYzD93iy4htpVqFhYMmfPgbRtpUqg=";
};
};
buildInputs = [ rustc ] ++ lib.optionals stdenv.isDarwin [
darwin.cctools
darwin.apple_sdk.frameworks.Security
darwin.apple_sdk.frameworks.CoreServices
darwin.apple_sdk.frameworks.SystemConfiguration
];
postInstall = lib.optionalString stdenv.isDarwin ''
install_name_tool -id $out/lib/libkclvm_cli_cdylib.dylib $out/lib/libkclvm_cli_cdylib.dylib
'';
nativeBuildInputs = [ pkg-config protobuf ];
patches = [ ./enable_protoc_env.patch ];
@@ -35,7 +51,7 @@ rustPlatform.buildRustPackage rec {
description = "A high-performance implementation of KCL written in Rust that uses LLVM as the compiler backend";
homepage = "https://github.com/kcl-lang/kcl";
license = licenses.asl20;
platforms = platforms.linux;
platforms = platforms.linux ++ platforms.darwin;
maintainers = with maintainers; [ selfuryon peefy ];
};
}