kcl-lang / cli

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

kcl installs the incorrect build of kclvm_cli/libkclvm_cli_cdylib.so #31

Closed AdmiralNemo closed 9 months ago

AdmiralNemo commented 9 months ago

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

  1. On a non-x86_64 system (e.g. Raspberry Pi), install kcl via go install or downloading a release archive from GitHub.
  2. Run echo a = 1 | kcl -

2. What did you expect to see? (Required)

kcl should compile the program and produce YAML output

a: 1

3. What did you see instead (Required)

Init kcl runtime failed, path:  /root/go
Tip: Have you used a binary version of KCL in your PATH that is not consistent with the KCL Go SDK? You can upgrade or reduce the KCL version or delete the KCL in your PATH
If not, you can run `rm -r /root/go/bin` to fix this issue
panic: unexpected EOF: stderr = qemu-x86_64-static: Could not open '/lib64/ld-linux-x86-64.so.2': No such file or directory

goroutine 1 [running]:
kcl-lang.io/kcl-go/pkg/kclvm_runtime.initRuntime(0x40001c5668?)
    /home/runner/go/pkg/mod/kcl-lang.io/kcl-go@v0.7.1/pkg/kclvm_runtime/init.go:72 +0x640
kcl-lang.io/kcl-go/pkg/kclvm_runtime.GetRuntime.func1()
    /home/runner/go/pkg/mod/kcl-lang.io/kcl-go@v0.7.1/pkg/kclvm_runtime/init.go:29 +0x20
sync.(*Once).doSlow(0x40001c5788?, 0x1c554?)
    /opt/hostedtoolcache/go/1.19.13/x64/src/sync/once.go:74 +0x104
sync.(*Once).Do(...)
    /opt/hostedtoolcache/go/1.19.13/x64/src/sync/once.go:65
kcl-lang.io/kcl-go/pkg/kclvm_runtime.GetRuntime()
    /home/runner/go/pkg/mod/kcl-lang.io/kcl-go@v0.7.1/pkg/kclvm_runtime/init.go:29 +0x3c
kcl-lang.io/kcl-go/pkg/service.NewKclvmServiceClient()
    /home/runner/go/pkg/mod/kcl-lang.io/kcl-go@v0.7.1/pkg/service/client_kclvm_service.go:21 +0x1c
kcl-lang.io/kcl-go/pkg/kcl.run({0x40001c5868?, 0x40001c5a60?, 0x1?}, {0x40001c5998?, 0x40003c8360?, 0x0?})
    /home/runner/go/pkg/mod/kcl-lang.io/kcl-go@v0.7.1/pkg/kcl/api.go:242 +0x6c
kcl-lang.io/kcl-go/pkg/kcl.RunWithOpts(...)
    /home/runner/go/pkg/mod/kcl-lang.io/kcl-go@v0.7.1/pkg/kcl/api.go:181
kcl-lang.io/kpm/pkg/api.RunWithOpt(0x40000ba880)
    /home/runner/go/pkg/mod/kcl-lang.io/kpm@v0.4.4/pkg/api/kpm_run.go:84 +0x29c
kcl-lang.io/cli/pkg/options.(*RunOptions).Run(0x40003c42a0)
    /home/runner/work/cli/cli/pkg/options/run.go:102 +0x210
kcl-lang.io/cli/cmd/kcl/commands.NewRunCmd.func1(0x40003fcc00?, {0x40002b83f0?, 0x1?, 0x1?})
    /home/runner/work/cli/cli/cmd/kcl/commands/run.go:46 +0x70
github.com/spf13/cobra.(*Command).execute(0x40003fcc00, {0x400004c070, 0x1, 0x1})
    /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:940 +0x5e0
github.com/spf13/cobra.(*Command).ExecuteC(0x40003fcc00)
    /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:1068 +0x368
github.com/spf13/cobra.(*Command).Execute(...)
    /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:992
kcl-lang.io/cli/cmd/kcl/commands.executeRunCmd({0x400004c070, 0x1, 0x1})
    /home/runner/work/cli/cli/cmd/kcl/commands/plugin.go:17 +0x68
kcl-lang.io/cli/cmd/kcl/commands.bootstrapCmdPlugin(0x40003c2000?, {0x1cbafb8, 0x40000c10c8})
    /home/runner/work/cli/cli/cmd/kcl/commands/plugin.go:38 +0x148
kcl-lang.io/cli/cmd/kcl/commands.New()
    /home/runner/work/cli/cli/cmd/kcl/commands/root.go:126 +0x2c8
main.main()
    /home/runner/work/cli/cli/cmd/kcl/main.go:14 +0x1c

4. What is your KCL components version? (Required)

kcl version 0.7.2

[root@caf32d738cd0 /]# readelf -h /root/go/bin/kcl | grep Machine
  Machine:                           AArch64
[root@caf32d738cd0 /]# readelf -h /root/go/bin/kclvm_cli | grep Machine
  Machine:                           Advanced Micro Devices X86-64
[root@caf32d738cd0 /]# readelf -h /root/go/bin/libkclvm_cli_cdylib.so | grep Machine
  Machine:                           Advanced Micro Devices X86-64
Peefy commented 9 months ago

I've released kcl-lang/cli v0.7.4 and tested in the arm64v8/ubuntu:20.04 image, it works well. Thank you for your feedback.