Skip to content

Commit 40624b7

Browse files
committed
chore: bump kcl lib to 0.8.0-alpha.4
Signed-off-by: peefy <xpf6677@163.com>
1 parent 69fc5ce commit 40624b7

File tree

8 files changed

+25
-7
lines changed

8 files changed

+25
-7
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "kcl-lang"
3-
version = "0.8.0-alpha.3"
3+
version = "0.8.0-alpha.4"
44
edition = "2021"
55
readme = "README.md"
66
documentation = "kcl-lang.io"

install.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"runtime"
99
)
1010

11-
const KCLVM_VERSION = "v0.8.0-alpha.3"
11+
const KCLVM_VERSION = "v0.8.0-alpha.4"
1212

1313
func findPath(name string) string {
1414
if path, err := exec.LookPath(name); err == nil {

java/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.kcl</groupId>
88
<artifactId>kcl-lib</artifactId>
9-
<version>0.8.0-alpha.3</version>
9+
<version>0.8.0-alpha.4</version>
1010
<name>KCL Arifact Library for Java</name>
1111
<description>
1212
KCL is an open-source constraint-based record and functional language mainly

python/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ dist:
1212

1313
fmt:
1414
python3 -m black .
15+
16+
test:
17+
python3 -m pip install pytest && python3 -m pytest

python/kcl_lib/api/service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
lib_full_name,
99
install_kclvm,
1010
)
11+
from kcl_lib.bootstrap.artifact import lib_path
1112
from .spec_pb2 import *
1213
from ctypes import c_char_p, c_void_p
1314
from google.protobuf import message as _message
@@ -108,8 +109,7 @@ def __init__(self):
108109
install_kclvm(env_install_path)
109110
self.lib = ctypes.CDLL(os.path.join(env_install_path, lib_full_name()))
110111
else:
111-
install_kclvm(self._dir.name)
112-
self.lib = ctypes.CDLL(self._dir.name + "/bin/" + lib_full_name())
112+
self.lib = ctypes.CDLL(os.path.join(lib_path(), lib_full_name()))
113113
# Assuming the shared library exposes a function `kclvm_service_new`
114114
self.lib.kclvm_service_new.argtypes = [ctypes.c_uint64]
115115
self.lib.kclvm_service_new.restype = ctypes.c_void_p

python/kcl_lib/bootstrap/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import platform
44
from pathlib import Path
55

6-
KCLVM_VERSION = "0.8.0-alpha.3" # You should replace this with actual version
6+
KCLVM_VERSION = "0.8.0-alpha.4" # You should replace this with actual version
77
KCLVM_CLI_BIN_PATH_ENV_VAR = "KCLVM_CLI_BIN_PATH"
88
KCLVM_CLI_INSTALL_PATH_ENV_VAR = "KCLVM_CLI_INSTALL_PATH"
99
LIB_NAME = "kclvm_cli_cdylib"

python/kcl_lib/bootstrap/artifact.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ def is_amd64_arch():
2929
def cli_lib():
3030
return DARWIN_AMD64_CLI_LIB if is_amd64_arch() else DARWIN_ARM64_CLI_LIB
3131

32+
def lib_path() -> str:
33+
if is_amd64_arch():
34+
return str(LIB_ROOT.joinpath("lib").joinpath("darwin-amd64"))
35+
return str(LIB_ROOT.joinpath("lib").joinpath("darwin-arm64"))
36+
3237
elif sys.platform.startswith("linux"):
3338
if is_amd64_arch():
3439
with open(f"{LIB_ROOT}/lib/linux-amd64/libkclvm_cli_cdylib.so", "rb") as f:
@@ -40,6 +45,11 @@ def cli_lib():
4045
def cli_lib():
4146
return LINUX_AMD64_CLI_LIB if is_amd64_arch() else LINUX_ARM64_CLI_LIB
4247

48+
def lib_path() -> str:
49+
if is_amd64_arch():
50+
return str(LIB_ROOT.joinpath("lib").joinpath("linux-amd64"))
51+
return str(LIB_ROOT.joinpath("lib").joinpath("linux-arm64"))
52+
4353
elif sys.platform == "win32":
4454
if is_amd64_arch():
4555
with open(f"{LIB_ROOT}/lib/windows-amd64/kclvm_cli_cdylib.dll", "rb") as f:
@@ -58,5 +68,10 @@ def cli_lib():
5868
def export_lib():
5969
return WINDOWS_AMD64_EXPORT_LIB if is_amd64_arch() else WINDOWS_ARM64_EXPORT_LIB
6070

71+
def lib_path() -> str:
72+
if is_amd64_arch():
73+
return str(LIB_ROOT.joinpath("lib").joinpath("windows-amd64"))
74+
return str(LIB_ROOT.joinpath("lib").joinpath("windows-arm64"))
75+
6176
else:
6277
raise f"Unsupported platform {sys.platform}, expected win32, linux or darwin platform"

python/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def copy_libs():
121121
setup(
122122
name="kcl_lib",
123123
author="KCL Authors",
124-
version="0.8.0-alpha.3",
124+
version="0.8.0-alpha.4",
125125
license="Apache License 2.0",
126126
python_requires=">=3.7",
127127
description="KCL Artifact Library for Python",

0 commit comments

Comments
 (0)