kcl-lang / cli

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

KCL CLI using deleted items (from cache?) #129

Closed juanzolotoochin closed 2 months ago

juanzolotoochin commented 2 months ago

Bug Report

Sometimes when I run kcl path/to/my/file.k it will resolve module imports from files that do not (longer) exist.

1. Minimal reproduce step (Required)

I don't know how to repro this from scratch but this is what I'm observing:

import my_config

debugging

print(my_config.labels) # debugging by print

test

assert len(my_config.labels) > 0, "labels can't be empty" # use len() to get list length assert "env" in my_config.labels, "env label is a must" assert my_config.cpu >= 256, "cpu cannot be less than256


I can still build it even though the imported `my_config` is not there:

$ kcl ./examples/kcl/my_config_test.k {'run': 'my-nginx', 'env': 'pre-prod2'} {}



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

An error about a missing imported module.

### 3. What did you see instead (Required)

The config builds and shows data from an old file that no longer exists.

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

v.0.9.7 from https://github.com/kcl-lang/cli/releases/download/v0.9.7/kcl-v0.9.7-linux-amd64.tar.gz

Here's a recording of the terminal with the repro: https://asciinema.org/a/jDn28ok1KIWBABvppAWpkolb8
Peefy commented 2 months ago

You can set the env KCL_FAST_EVAL=1 to prevent the error

Peefy commented 2 months ago

Released v0.10.0-beta.1 and close it.