Skip to content

fix: change crate name from kclvm to kcl in kclvm and its subfolders #1964

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

devc007
Copy link

@devc007 devc007 commented Jun 4, 2025

Fixes #1957

1. Does this PR affect any open issues?(Y/N) and add issue references (e.g. "fix #123", "re #123".):

  • N
  • Y

2. What is the scope of this PR (e.g. component or file name):

3. Provide a description of the PR(e.g. more details, effects, motivations or doc link):

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Other

4. Are there any breaking changes?(Y/N) and describe the breaking changes(e.g. more details, motivations or doc link):

  • N
  • Y

5. Are there test cases for these changes?(Y/N) select and add more details, references or doc links:

  • Unit test
  • Integration test
  • Benchmark (add benchmark stats below)
  • Manual test (add detailed scripts or steps below)
  • Other

@devc007
Copy link
Author

devc007 commented Jun 6, 2025

@Peefy can I do something to clear all those unsuccessful checks?

@Peefy
Copy link
Contributor

Peefy commented Jun 6, 2025

You need to make it compile success in your local machine and CI

@devc007
Copy link
Author

devc007 commented Jun 12, 2025

Hi @Peefy,

I’ve been working on the crate rename (from kclvm to kcl) for several days. I updated the [package] name in all relevant Cargo.toml files and used a command like:

find kclvm/sema/src/resolver -type f -exec sed -i 's/kclvm/kcl/g' {} +

to update import statements and usages.

However, when I try to build, I get errors like:

error[E0433]: failed to resolve: use of undeclared type `Type`
  --> runtime/src/types/str.rs:17:13
   |
17 |             Type::List(ref v) => format!("[{}]", v.elem_type.type_str()),
   |             ^^^^ use of undeclared type `Type`

I realized that after the rename, some types (like : ValueRef) are not in scope, so I started re-exporting them in the relevant mod.rs files. This fixes some errors, but it feels like an endless process and I’m not sure if this is the right approach.

Am I missing a more systematic or recommended way to handle crate renames and re-exports in a large Rust workspace? Is there a best practice for making sure all types are available after such a change?

Any guidance would be greatly appreciated!

@Peefy
Copy link
Contributor

Peefy commented Jun 13, 2025

You need to use tools such as IDE refactor or rename instead of simply replacing names.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enhancement] Change all crate name prefix kclvm to kcl
2 participants