-
Notifications
You must be signed in to change notification settings - Fork 10
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
Unable to run kcl
0.10.x on NixOS
#153
Comments
Thanks for the feedback. #154 Can this modification solve the problem of creating subfolders? |
Hey @Peefy your fix is only solving half of the issue, and I would like to reopen this issue. The application now tries to create a lockfile in the readonly directories:
IMHO the application should perform its "userspace business" wholly somewhere in Despite all that, thank you for your efforts! |
kcl
0.10.3 on NixOSkcl
0.10.x on NixOS
@Peefy I think the problem is related to the override of the In https://github.com/kcl-lang/lib/blob/main/go/native/loader.go#L31-L34 the |
The following patch will fix the issue for NixOS diff --git a/pkgs/by-name/kc/kcl/package.nix b/pkgs/by-name/kc/kcl/package.nix
index 0200265bb6d6..fe9d71af73f6 100644
--- a/pkgs/by-name/kc/kcl/package.nix
+++ b/pkgs/by-name/kc/kcl/package.nix
@@ -11,16 +11,16 @@
}:
buildGo123Module rec {
pname = "kcl";
- version = "0.10.0";
+ version = "0.10.6";
src = fetchFromGitHub {
owner = "kcl-lang";
repo = "cli";
rev = "v${version}";
- hash = "sha256-0KxT4t77EDB7Vr/cb+P20ARRR+7g5uZiF5QYOArUhgI=";
+ hash = "sha256-NyqiypzKjMcT61bEjUHa1QGyeoJtcx78qzch9sdgn2k=";
};
- vendorHash = "sha256-9APQDYCBvG38y0ZYuacfyUmjoEV9jGqRg7OZ7mArzIU=";
+ vendorHash = "sha256-uFtEKIPL052BwN7NdIvgoQWR4EbVMoMKkQ3cvd2S0Ww=";
# By default, libs and bins are stripped. KCL will crash on darwin if they are.
dontStrip = stdenv.isDarwin;
@@ -46,7 +46,6 @@ buildGo123Module rec {
postFixup = ''
wrapProgram $out/bin/kcl \
--prefix PATH : "${lib.makeBinPath [kclvm kclvm_cli]}" \
- --prefix KCL_LIB_HOME : "${lib.makeLibraryPath [kclvm]}" \
--prefix KCL_GO_DISABLE_INSTALL_ARTIFACT : false
''; While digging into the code I am also quite confident now, that the env vars for disabling certain installer features are not longer respected: https://github.com/kcl-lang/kcl-go/blob/main/pkg/env/env.go#L33-L34 see kcl-lang/kcl-go#259 |
Thanks for the feedback. This config will be deprecated in the next version. |
Bug Report
I am using NixOS, where the directories of packages are readonly.
The kcl installer v0.10.3 seems to try to create a directory
kcl
under$KCL_LIB_HOME
This commit was introducing it: 3c73ffd
1. Minimal reproduce step (Required)
build kcl v0.10.3 for nix and run it, so that the internal installer is called...
IMHO for NixOS the whole installer and caching thingy should be disabled since there is not much "dynamic" expected in terms of installing/downloading/caching the kclvm library... Or there should be some pre-fetch/prepare stage for this cache, which then gets commited into the nix package.
The text was updated successfully, but these errors were encountered: