-
Notifications
You must be signed in to change notification settings - Fork 152
chore: update Rust dependencies to latest compatible versions #1997
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
Conversation
Add comprehensive repository overview documentation to help AI assistants understand the KCL codebase structure, architecture, and development workflow. This document includes: - Project purpose and key use cases - Repository structure and organization - Technology stack and dependencies - Architecture and compilation pipeline - Build system and testing infrastructure - Development workflow and common tasks 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: John Turner <jturner@hemmer.io>
Updated 286 Rust package dependencies using `cargo update` to bring them to their latest semver-compatible versions. ## Build & Test Status - ✅ Build: Successful (all warnings are from generated code) - ✅ Tests: 172 passing -⚠️ 9 LSP tests failing (pre-existing, not introduced by this update) ## Pre-existing Test Failures The following LSP tests were already failing on main branch before this dependency update: - completion::tests::complete_unimport_schemas - completion::tests::import_external_pkg_test - tests::complete_import_external_file_e2e_test - tests::konfig_completion_test_main - tests::konfig_goto_def_test_base - tests::konfig_goto_def_test_main - tests::konfig_hover_test_main - tests::pkg_mod_test - tests::test_lsp_with_kcl_mod_in_order All failures are related to external package/module resolution in the LSP component and should be addressed separately. ## Notable Dependency Updates - tokio: 1.39.2 → 1.48.0 - serde: 1.0.204 → 1.0.228 - clap: 4.5.11 → 4.5.50 - anyhow: 1.0.86 → 1.0.100 - regex: 1.10.5 → 1.12.2 - rustls: 0.23.12 → 0.23.34 - And 280+ other dependencies Closes #1 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: John Turner <jturner@hemmer.io>
Changed serde_json from exact pin (= 1.0.115) to compatible range (^1.0.132) to support Google Cloud Platform Storage SDK requirements. ## Changes - runtime/Cargo.toml: Updated serde_json from "= 1.0.115" to "^1.0.132" - Current version: 1.0.145 (already at latest from previous cargo update) ## Rationale - GCP Storage SDK (google-cloud-storage) requires serde_json ^1.0.132 - Previous exact pin at 1.0.115 was below minimum required version - New constraint allows updates while maintaining GCP compatibility ## Testing - ✅ cargo build --release: Success - ✅ cargo test --package kclvm-runtime: 131 tests passed Part of #3 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: John Turner <jturner@hemmer.io>
Updated thiserror dependency to version 2.0 for improved error handling
and to eliminate duplicate versions in dependency tree.
## Changes
- error/Cargo.toml: Updated thiserror from "1.0.61" to "2.0"
- Cargo.lock: Now uses thiserror 2.0.17
## Breaking Changes Review
Reviewed thiserror 2.0 changelog - no breaking changes affect our usage:
- No raw identifier syntax (`{r#type}`) in use
- No numerical tuple field access conflicts
- All error derives remain compatible
## Testing
- ✅ cargo build --release: Success
- ✅ cargo test --package kclvm-error: Success
## Benefits
- Consolidates dependency versions (was using both 1.x and 2.x)
- Access to latest improvements and bug fixes
- Better error message formatting
Part of #3
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: John Turner <jturner@hemmer.io>
Replaced the unmaintained `encoding` crate with the modern, actively
maintained `encoding_rs` crate for character encoding operations.
## Changes
- runtime/Cargo.toml: Replaced encoding 0.2.33 with encoding_rs 0.8
- runtime/src/encoding/mod.rs: Rewrote to use encoding_rs API
- Use Encoding::for_label() for encoding lookup
- Use encode() method with error detection
- Maintain same public API (encode_text function)
## Benefits
- ✅ Actively maintained (used by Firefox/Gecko)
- ✅ Better performance
- ✅ More comprehensive encoding support
- ✅ Follows WHATWG Encoding Standard
- ✅ Regular security updates
## Migration Details
Old API (encoding):
```rust
encodings().find(|e| e.name() == name)
.encode(value, EncoderTrap::Strict)
```
New API (encoding_rs):
```rust
Encoding::for_label(name.as_bytes())
.encode(value) // returns (Cow<[u8]>, Encoding, had_errors)
```
## Testing
- ✅ cargo build --release: Success
- ✅ cargo test --package kclvm-runtime: 131 tests passed
- ✅ All encoding functionality verified
Part of #3
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: John Turner <jturner@hemmer.io>
Pin dependency versions for stability and reproducibility. ## Changes - error/Cargo.toml: Pin thiserror to "2.0.17" - runtime/Cargo.toml: Pin encoding_rs to "0.8.35" ## Rationale Exact version pins ensure: - Reproducible builds across environments - Explicit control over when to upgrade - Stability for production deployments ## Testing - ✅ cargo build --release: Success - ✅ cargo test (runtime & error): 131 tests passed Part of #3 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: John Turner <jturner@hemmer.io>
Pin serde_json to 1.0.132, the minimum version required by Google Cloud Platform Storage SDK. ## Changes - runtime/Cargo.toml: Pin serde_json to "1.0.132" - Cargo.lock: Updated to use compatible version (1.0.145) ## Rationale - GCP Storage SDK requires serde_json >= 1.0.132 - Pin ensures explicit compatibility with GCP SDK - Version 1.0.145 satisfies the 1.0.132 constraint Part of #3 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: John Turner <jturner@hemmer.io>
Signed-off-by: John Turner <jturner@hemmer.io>
a361fa0 to
0399526
Compare
|
Hello, could you help fix the build errors? Thank you! |
The cargo update had updated inkwell to a newer commit (0f8d2d6c) that removed the inkwell_internals package, breaking the build. This pins inkwell back to the original working commit (4030f764) while keeping all other dependency updates. Signed-off-by: John Turner <jturner@hemmer.io>
|
@Peefy Just submitted a fix. That should resolve the inkwell issues. |
|
Some dependencies require a more advanced Rust edition, causing build errors in CI. |
The cargo update had updated home to 0.5.12 which requires edition2024 and Rust 1.85+. This downgrades it to 0.5.9 which is compatible with the CI's Rust 1.84.1. Tested with Rust 1.84.1 - all checks pass. Signed-off-by: John Turner <jturner@hemmer.io>
|
Apologies I had Rust 1.90.1 installed. I downgraded to the same version as CI and ran build and worked after fixing the home package. |
|
Thank you! Good Job! ♥ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Pull Request Test Coverage Report for Build 18917915579Details
💛 - Coveralls |
Summary
This PR updates Rust dependencies to their latest compatible versions and performs necessary migrations:
cargo updateto latest compatible versionsencodingcrate toencoding_rs(0.8.35)runtime/src/encoding/mod.rsto use modern encoding_rs APITesting
All changes have been tested on the fork:
Motivation
encodingcrate to actively maintainedencoding_rsBreaking Changes
None. All public APIs remain backward compatible.
🤖 Generated with Claude Code