Skip to content
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

Bug: When the value of the environment variable HOME is set to empty, a panic error will occur #595

Open
zong-zhe opened this issue Feb 6, 2025 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@zong-zhe
Copy link
Contributor

zong-zhe commented Feb 6, 2025

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

Prepare a kcl file main.k

a = 1

Set the environment variable HOME to empty.

export HOME=""

Compile the kcl file:

kcl run main.k

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

Compile successfully

a: 1

3. What did you see instead (Required)

An panic error:

 kcl run main.k
panic: failed to load config file '' for kpm.
        internal bugs, failed to load working directory
        could not access $KCL_PKG_PATH.
        internal bugs, failed to load user home directory
        $HOME is not defined

goroutine 1 [running]:
kcl-lang.io/cli/cmd/kcl/commands.NewModCmd()
        /Workspace/kcl/cli/cmd/kcl/commands/mod.go:50 +0x27c
kcl-lang.io/cli/cmd/kcl/commands.NewWithName({0x103bea758, 0x3})
        /Workspace/kcl/cli/cmd/kcl/commands/root.go:123 +0x214
kcl-lang.io/cli/cmd/kcl/commands.New(...)
        /Workspace/kcl/cli/cmd/kcl/commands/root.go:99
main.main()
        /Workspace/kcl/cli/cmd/kcl/main.go:14 +0x28

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

The main branch

@Rohanraj123
Copy link
Contributor

I am working on this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

2 participants