Skip to content

Commit

Permalink
feat: impl KCL_GO_DISABLE_ARTIFACT flag.
Browse files Browse the repository at this point in the history
  • Loading branch information
Peefy committed Jul 27, 2023
1 parent af789cd commit 9708a2d
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions pkg/kclvm_runtime/kclvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"context"
_ "embed"
"errors"
"os"
"os/exec"
"path/filepath"
"runtime"
Expand All @@ -17,7 +18,18 @@ import (
"kcl-lang.io/kcl-go/pkg/path"
)

const (
DisableArtifactEnvVar = "KCL_GO_DISABLE_ARTIFACT"
)

func init() {
if os.Getenv(DisableArtifactEnvVar) == "" {
installKclArtifact()
}
g_KclvmRoot = findKclvmRoot()
}

func installKclArtifact() {
// Get the install lib path.
path := path.LibPath()
// Acquire a file lock for process synchronization
Expand All @@ -38,8 +50,6 @@ func init() {
logger.GetLogger().Warningf("install kclvm failed: %s", err.Error())
}
artifact.CleanInstall()

g_KclvmRoot = findKclvmRoot()
}

var (
Expand Down

0 comments on commit 9708a2d

Please sign in to comment.