-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Enhancement] Nix package of KCL CLI and Language Server #1169
Comments
Hello @vfarcic Thank you for your feedback. That's a very good suggestion. |
The KCL Nix Package PR: NixOS/nixpkgs#302285 |
The KCL CLI Nix Package PR has been merged 🎉 NixOS/nixpkgs#302488 Note that the Nix community suggests that we use the |
Thank you @diefans for the kcl-nix package: https://github.com/diefans/kcl-nix |
Hi, thanks for this! |
Hello @sanzoghenzo, we have plans to support this, and prior to that, we have done some refactoring and pre work on the kcl-language-server rust project. It is expected that we can provide nix package soon. |
I've opened the kcl-language-server nix package PR at NixOS/nixpkgs#306538 |
Hey! I tried to use $ nix shell nixpkgs#kcl-cli
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish
$ cat main.k
hello = "KCL"
$ kcl run main.k
Init kcl runtime failed, path: /home/syakovlev/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 /home/syakovlev/go/bin` to fix this issue
panic: unexpected EOF: stderr = Could not start dynamically linked executable: kclvm_cli
NixOS cannot run dynamically linked executables intended for generic
linux environments out of the box. For more information, see:
https://nix.dev/permalink/stub-ld
goroutine 1 [running]:
kcl-lang.io/kcl-go/pkg/runtime.initRuntime(0xc00093f6d8?)
kcl-lang.io/[email protected]/pkg/runtime/init.go:62 +0x42f
kcl-lang.io/kcl-go/pkg/runtime.GetRuntime.func1()
kcl-lang.io/[email protected]/pkg/runtime/init.go:26 +0x15
sync.(*Once).doSlow(0x0?, 0x0?)
sync/once.go:74 +0xc2
sync.(*Once).Do(...)
sync/once.go:65
kcl-lang.io/kcl-go/pkg/runtime.GetRuntime()
kcl-lang.io/[email protected]/pkg/runtime/init.go:26 +0x2c
kcl-lang.io/kcl-go/pkg/service.NewKclvmServiceClient()
kcl-lang.io/[email protected]/pkg/service/client_kclvm_service.go:21 +0x13
kcl-lang.io/kcl-go/pkg/kcl.runWithHooks({0xc00093f890, 0x0, 0x0}, {0x5cae350, 0x1, 0x1}, {0xc00093faa8, 0x1, 0x1})
kcl-lang.io/[email protected]/pkg/kcl/api.go:477 +0x16e
kcl-lang.io/kcl-go/pkg/kcl.run(...)
kcl-lang.io/[email protected]/pkg/kcl/api.go:486
kcl-lang.io/kcl-go/pkg/kcl.RunWithOpts({0xc00093faa8?, 0xc00093faa8?, 0xc00093fa58?})
kcl-lang.io/[email protected]/pkg/kcl/api.go:373 +0x45
kcl-lang.io/kpm/pkg/api.RunWithOpt(0xc000b87200)
kcl-lang.io/[email protected]/pkg/api/kpm_run.go:89 +0x36a
kcl-lang.io/cli/pkg/options.(*RunOptions).Run(0xc0008f80e0)
kcl-lang.io/cli/pkg/options/run.go:126 +0x1e9
kcl-lang.io/cli/cmd/kcl/commands.NewRunCmd.func1(0xc00058c400?, {0xc0005a8990?, 0x4?, 0x2263e4c?})
kcl-lang.io/cli/cmd/kcl/commands/run.go:49 +0x5a
github.com/spf13/cobra.(*Command).execute(0xc00015e908, {0xc0005a8950, 0x1, 0x1})
github.com/spf13/[email protected]/command.go:983 +0xaca
github.com/spf13/cobra.(*Command).ExecuteC(0xc00015e608)
github.com/spf13/[email protected]/command.go:1115 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
github.com/spf13/[email protected]/command.go:1039
main.main()
kcl-lang.io/cli/cmd/kcl/main.go:14 +0x1c
$ kcl version
0.8.6-linux-amd64 That means it isn't a full package of all needed binaries for using kcl, right? I also need I'm a newbie at KCL, just wanted to compare it with CUE, but can't get it work on NixOS still. |
Oh, it seems to conflict with the running mode of nix package management. You can use the download script to get the kcl cli. I will fix it later.
|
@selfuryon you may try https://github.com/diefans/kcl-nix at least I fixed my problems... |
We also need to provide the LSP, after PR nixpkgs#31827 is merged a separate PR will be prepared for tackling that. |
@aldoborrero I had problems building the LSP... I was pointing
so to me it seems, that the build process wants to modify a "higher" directory, which nix prevents.... IMHO I am wondering, why you have all that tools not in separate repos/crates... |
@diefans have you tried using |
@diefans apologies for my late reply, but I have successfully compiled @selfuryon I'm pinging you as well as you might be interested too. |
@aldoborrero I am also late ...swept away by too many projects, duties, life, etc... :) I was able to compile with your |
Feature Request
Is your feature request related to a problem? Please describe:
I tend to use
nix-shell
for all the projects I work on. That way I create ephemeral environments with all the tools I need without installing any of them permanently on my laptop.kcl
CLI is not available as a Nix package.Describe the feature you'd like:
Make
kcl
available as a Nix package.Describe alternatives you've considered:
Installing it permanently on my laptop.
Teachability, Documentation, Adoption, Migration Strategy:
Users can start a session with
nix-shell
ordevbox shell
and get the tools they need to work on a project, includingkcl
.The text was updated successfully, but these errors were encountered: