kcl-lang / cli

The KCL Command Line Interface (CLI).
https://kcl-lang.io
Apache License 2.0
19 stars 14 forks source link

[ bug ] panic: Undefined symbol "kclvm_service_new" on FreeBSD #147

Open yonas opened 1 month ago

yonas commented 1 month ago
$ go build -v ./cmd/kcl
$ ./kcl run
panic: Undefined symbol "kclvm_service_new"

goroutine 1 [running]:
github.com/ebitengine/purego.RegisterLibFunc({0x2fcc60, 0x3a200c8}, 0x0?, {0x74dd9d?, 0x8740061c0?})
        /home/yonas/go/pkg/mod/github.com/ebitengine/purego@v0.7.1/func.go:23 +0x5c
kcl-lang.io/lib/go/native.initClient.func1()
        /home/yonas/go/pkg/mod/kcl-lang.io/lib@v0.10.1-rc.3/go/native/client.go:40 +0x4e
sync.(*Once).doSlow(0x251db48?, 0x3948bd0?)
        /usr/local/go123/src/sync/once.go:76 +0xb4
sync.(*Once).Do(...)
        /usr/local/go123/src/sync/once.go:67
kcl-lang.io/lib/go/native.initClient(0x3948b20?)
        /home/yonas/go/pkg/mod/kcl-lang.io/lib@v0.10.1-rc.3/go/native/client.go:38 +0x3a
kcl-lang.io/lib/go/native.NewNativeServiceClientWithPluginAgent(...)
        /home/yonas/go/pkg/mod/kcl-lang.io/lib@v0.10.1-rc.3/go/native/client.go:59
kcl-lang.io/lib/go/native.NewNativeServiceClient()
        /home/yonas/go/pkg/mod/kcl-lang.io/lib@v0.10.1-rc.3/go/native/client.go:55 +0x29
kcl-lang.io/kcl-go/pkg/kcl.Service(...)
        /home/yonas/go/pkg/mod/kcl-lang.io/kcl-go@v0.10.2-0.20240918105252-6fc919ce5b6d/pkg/kcl/service.go:10
kcl-lang.io/kcl-go/pkg/kcl.runWithHooks({0x8748c9520, 0x0, 0x0}, {0x394d5f0, 0x1, 0x1}, {0x8748c95f0, 0x1, 0x1})
        /home/yonas/go/pkg/mod/kcl-lang.io/kcl-go@v0.10.2-0.20240918105252-6fc919ce5b6d/pkg/kcl/api.go:436 +0x15f
kcl-lang.io/kcl-go/pkg/kcl.run(...)
        /home/yonas/go/pkg/mod/kcl-lang.io/kcl-go@v0.10.2-0.20240918105252-6fc919ce5b6d/pkg/kcl/api.go:445
kcl-lang.io/kcl-go/pkg/kcl.RunWithOpts({0x8748c95f0?, 0x874001140?, 0x0?})
        /home/yonas/go/pkg/mod/kcl-lang.io/kcl-go@v0.10.2-0.20240918105252-6fc919ce5b6d/pkg/kcl/api.go:372 +0x45
kcl-lang.io/kpm/pkg/client.(*KpmClient).Run.func1(0x874001140)
        /home/yonas/go/pkg/mod/kcl-lang.io/kpm@v0.10.0/pkg/client/run.go:599 +0x3aa
kcl-lang.io/kpm/pkg/client.(*VirtualPkgVisitor).Visit(0x0?, 0x0?, 0x8748f6900)
        /home/yonas/go/pkg/mod/kcl-lang.io/kpm@v0.10.0/pkg/client/visitor.go:87 +0x3ca
kcl-lang.io/kpm/pkg/client.(*KpmClient).Run(0x8748fa780, {0x8748c9bc0, 0xe, 0x0?})
        /home/yonas/go/pkg/mod/kcl-lang.io/kpm@v0.10.0/pkg/client/run.go:574 +0x20d
kcl-lang.io/cli/pkg/options.(*RunOptions).Run(0x8740e7cc0)
        /home/yonas/git/cli/pkg/options/run.go:128 +0x6a5
kcl-lang.io/cli/cmd/kcl/commands.NewRunCmd.func1(0x874116400?, {0x3a62ec0?, 0x4?, 0x7339f8?})
        /home/yonas/git/cli/cmd/kcl/commands/run.go:61 +0x49
github.com/spf13/cobra.(*Command).execute(0x874451b08, {0x3a62ec0, 0x0, 0x0})
        /home/yonas/go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:985 +0xaaa
github.com/spf13/cobra.(*Command).ExecuteC(0x874451808)
        /home/yonas/go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:1117 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
        /home/yonas/go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:1041
main.main()
        /home/yonas/git/cli/cmd/kcl/main.go:14 +0x2a
$ ldd ./kcl
./kcl:
        libthr.so.3 => /lib/libthr.so.3 (0x191a4a171000)
        libdl.so.1 => /usr/lib/libdl.so.1 (0x191a4985e000)
        libc.so.7 => /lib/libc.so.7 (0x191a4ae72000)
        [vdso] (0x191a48e4b000)

I built the Rust library without any issues. It's installed at /usr/local/lib/libkclvm_cli_cdylib.so

KCL e3ab00dd OS: FreeBSD 14

Peefy commented 1 month ago

Related issue: https://github.com/kcl-lang/kcl/issues/1029