Closed Fdall closed 3 months ago
cc @zong-zhe Could you help check this break?
Hi @Fdall π
This issue was a bug that incorrectly set the current working directory to the location of the settings.yaml
file, which we fixed in https://github.com/kcl-lang/kcl-go/pull/314.
more details: https://github.com/kcl-lang/kpm/issues/320#issuecomment-2125362110
Hi @zong-zhe,
Thank you for the quick answer :+1:
We are currently only using the kcl CLI component, is there a way to make the compilation process "workdir independant" at the moment using some options or other kcl related components?
We have different internal config repositories managed by kcl and each can be generated in different "flavors" based on settings file. To illustrate, the structure looks like this:
βββ kcl
βΒ Β βββ moduleA
βΒ Β βββ moduleB
βΒ Β βββ moduleC
βββ targets
βββ settings1.yaml # refering to several files in the kcl folder + CLI options
βββ settings2.yaml
Having to strictly ensure the shell workdir from which the run command is executed is manageable but a bit bothersome.
Closed by https://github.com/kcl-lang/kpm/pull/440 and released in KCL CLI v0.9.7
Awesome :+1: Just tested it, it works as I expected it to in my initial post. You can close the issue
Bug Report
1. Minimal reproduce step (Required)
Use the documentation example in https://www.kcl-lang.io/docs/user_docs/support/faq-cli#2-how-to-input-dynamic-options-how-to-get-dynamic-options-in-code
kcl_bug/file1.k
kcl_bug/settings.yaml
While inside the directory
kcl_bug
, the following command succeeds:But if run using the absolute path of the settings file, from a directory that is not
kcl_bug
the command fails with:2. What did you expect to see? (Required)
The same setup works with any KCL release prior to the 0.9.X. The relative path of files listed in the settings file should be resolved from the settings file and not from the user shell workdir.
3. What did you see instead (Required)
But if run using the absolute path of the settings file, from a directory that is not
kcl_bug
the command fails with:It seems that the files listed in the settings file are resolved from the workdir of the shell and not from the the settings file itself. I could not find any CLI option to configure the 'root' folder from which the paths are resolved.
4. What is your KCL components version? (Required)
kcl version 0.9.1 -> not working kcl version 0.8.9 -> working