Skip to content

Commit

Permalink
feat: set fast eval mode as default
Browse files Browse the repository at this point in the history
Signed-off-by: peefy <[email protected]>
  • Loading branch information
Peefy committed Jul 26, 2024
1 parent f1610dd commit 7706921
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 21 deletions.
11 changes: 4 additions & 7 deletions pkg/kcl/native_service.go → pkg/kcl/rpc_service.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
//go:build !rpc
// +build !rpc
//go:build rpc
// +build rpc

package kcl

import (
"kcl-lang.io/kcl-go/pkg/native"
"kcl-lang.io/kcl-go/pkg/service"
)
import "kcl-lang.io/kcl-go/pkg/service"

// Service returns the interaction interface between KCL Go SDK and KCL Rust core.
// When `go build tags=native` is opened, use CGO and dynamic libraries to interact.
// When closed, use the default RPC interaction logic to avoid CGO usage.
func Service() service.KclvmService {
return native.NewNativeServiceClient()
return service.NewKclvmServiceClient()
}
11 changes: 7 additions & 4 deletions pkg/kcl/service.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
//go:build rpc
// +build rpc
//go:build !rpc
// +build !rpc

package kcl

import "kcl-lang.io/kcl-go/pkg/service"
import (
"kcl-lang.io/kcl-go/pkg/native"
"kcl-lang.io/kcl-go/pkg/service"
)

// Service returns the interaction interface between KCL Go SDK and KCL Rust core.
// When `go build tags=native` is opened, use CGO and dynamic libraries to interact.
// When closed, use the default RPC interaction logic to avoid CGO usage.
func Service() service.KclvmService {
return service.NewKclvmServiceClient()
return native.NewNativeServiceClient()
}
10 changes: 0 additions & 10 deletions pkg/plugin/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,10 @@
package plugin

import (
"os"
"strings"
"sync"
)

// Debug flag for kcl-plugin
var DebugMode = false

func init() {
if s := strings.ToLower(os.Getenv("KCLVM_PLUGIN_DEBUG")); s != "" && s != "false" && s != "0" {
DebugMode = true
}
}

var pluginManager struct {
allPlugin map[string]Plugin
allMethodSpec map[string]MethodSpec
Expand Down
1 change: 1 addition & 0 deletions pkg/runtime/kclvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
)

func init() {
env.EnableFastEvalMode()
if !env.GetDisableInstallArtifact() {
installKclArtifact()
}
Expand Down

0 comments on commit 7706921

Please sign in to comment.