You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: implement ABI-compatible library download system (#27)
* feat: implement ABI-compatible library download system (#26)
This commit introduces comprehensive ABI version management to ensure
compatibility between the Rust tokenizer library and Go bindings.
Key changes:
- Add dedicated get_abi_version() FFI function in Rust library
- Update Go bindings to prefer ABI version over package version
- Enhance error messages with clear resolution guidance
- Add ABI compatibility checks in download system
- Update CI workflows to verify ABI compatibility
- Add comprehensive test coverage for ABI checking
The system now:
1. Separates ABI versioning from package versioning
2. Provides fallback for backward compatibility
3. Validates ABI compatibility before library loading
4. Offers clear error messages when versions mismatch
This addresses all issues identified in #26 and prevents runtime
failures from version mismatches.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: apply Rust formatting to fix CI checks
Applied cargo fmt to fix formatting issues in src/lib.rs that were
causing CI checks to fail.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* refactor: simplify ABI version management
Remove separate ABI version constant and function in favor of using the
Cargo package version as the single source of truth for ABI compatibility.
Changes:
- Remove get_abi_version() function and ABI_VERSION constant from Rust
- Simplify Go code to only use get_version() for compatibility checks
- Update tests to reflect the simplified approach
- Document the version management strategy in CLAUDE.md
This makes the codebase simpler and reduces maintenance burden by having
only one version to manage (Cargo.toml version).
---------
Co-authored-by: Claude <noreply@anthropic.com>
-**ABI Compatibility**: The library version from `Cargo.toml` is used for compatibility checking (`AbiCompatibilityConstraint = "^0.1.x"`). The `get_version()` FFI function returns this version.
166
173
-**Memory Safety**: Proper cleanup of FFI resources with defer statements
167
174
-**Buffer Management**: Zero-copy where possible, explicit memory management for C strings
168
-
-**Cross-platform**: Uses runtime detection for platform-specific library names and paths
175
+
-**Cross-platform**: Uses runtime detection for platform-specific library names and paths
176
+
- Always lint both golang and rust before commiting or pushing code
0 commit comments