Unverified Commit 31ee0070 authored by Peder Bergebakken Sundt's avatar Peder Bergebakken Sundt Committed by GitHub
Browse files

kclvm: fix build (#439686)

parents 5b53d61d 85340141
Loading
Loading
Loading
Loading
+0 −46
Original line number Diff line number Diff line
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,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() {
-    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 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,12 +13,12 @@ use regex::Regex;
 
 fn main() {
     //hack: set protoc_bin_vendored::protoc_bin_path() to PROTOC
-    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);
 
+4309 −0

File added.

Preview size limit exceeded, changes collapsed.

+18 −14
Original line number Diff line number Diff line
@@ -7,20 +7,29 @@
  pkg-config,
  rustc,
}:
rustPlatform.buildRustPackage rec {
rustPlatform.buildRustPackage (finalAttrs: {
  pname = "kclvm";
  version = "0.11.2";

  src = fetchFromGitHub {
    owner = "kcl-lang";
    repo = "kcl";
    rev = "v${version}";
    rev = "v${finalAttrs.version}";
    hash = "sha256-6XDLxTpgENhP7F51kicAJB7BNMtX4cONKJApAhqgdno=";
  };

  sourceRoot = "${src.name}/kclvm";
  env = {
    PROTOC = "${protobuf}/bin/protoc";
    PROTOC_INCLUDE = "${protobuf}/include";
  };

  cargoHash = "sha256-eJ3Gh2l6T2DxJRQRHamPOr/ILtzsqFB497DdXVJ90RE=";
  cargoRoot = "kclvm";
  cargoHash = "sha256-kX+3wyeElKXUOIyD24X9jfvSzdtg3HFilkqlWulq4cc=";
  cargoPatches = [ ./fix-build.patch ];

  preBuild = ''
    cd kclvm
  '';

  buildInputs = [ rustc ];

@@ -33,19 +42,14 @@ rustPlatform.buildRustPackage rec {
    protobuf
  ];

  patches = [ ./enable_protoc_env.patch ];

  PROTOC = "${protobuf}/bin/protoc";
  PROTOC_INCLUDE = "${protobuf}/include";

  meta = with lib; {
  meta = {
    description = "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.darwin;
    maintainers = with maintainers; [
    license = lib.licenses.asl20;
    platforms = lib.platforms.unix;
    maintainers = with lib.maintainers; [
      selfuryon
      peefy
    ];
  };
}
})