fix: Use explicit path for Cargo.toml in hashFiles#17
Merged
Conversation
Replace the glob pattern '**/Cargo.toml' with explicit path 'native/ecto_libsql/Cargo.toml' in all GitHub Actions cache keys. The glob pattern was causing workflow validation failures on GitHub Actions. Using an explicit path is more reliable and matches the actual location of the Rust crate dependencies. Fixes hashFiles validation error in ci.yml at line 88 and other cache key locations.
Update all hashFiles() calls to include both the workspace Cargo.toml and the crate Cargo.toml. This ensures more reliable hashing across different OS runners (especially macOS) and properly invalidates cache when either the workspace or crate dependencies change. Changes: - Cargo cache keys: Now hash both Cargo.toml files - Mix cache keys: Include workspace Cargo.toml alongside crate Cargo.toml
Switch from using Cargo.toml files to Cargo.lock for all Rust dependency cache keys. This is the standard approach for Rust caching and should resolve the macOS-specific hashFiles failures. Benefits: - Single file at known location (no multi-file path issues) - Contains exact resolved dependencies - More reliable across different OS runners - Follows Rust caching best practices Fixes the template validation error on macOS runners.
Replace glob patterns with explicit paths in all hashFiles calls: - Use 'mix.exs' instead of '**/mix.exs' - Use 'native/ecto_libsql/Cargo.toml' for Cargo dependencies - Avoid mixing glob and explicit paths in same hashFiles call This should resolve macOS-specific hashFiles failures while avoiding the cache bloat issues caused by lock files changing frequently.
Remove the Rust dependency caching from elixir-tests-latest and elixir-tests-compatibility jobs. These jobs only need Rust to build the NIF, and the compiled artifacts are already cached by the Mix cache in _build. The Rust cache remains in: - rust-checks job (where Rust tooling is primary) - integration-test and turso-remote-tests jobs This resolves the macOS-specific hashFiles error on line 88 while maintaining efficient caching through the Mix cache.
Remove manual 'cargo build --release' commands from Elixir test jobs. The Rustler integration in mix.exs automatically handles Rust compilation when running 'mix compile', placing the compiled .so file in the correct location for the current MIX_ENV. The issue was: - Manual cargo build puts .so in: target/release/libecto_libsql.so - Mix+Rustler expects it in: _build/test/lib/ecto_libsql/priv/native/ecto_libsql.so By letting mix compile handle it, Rustler will: 1. Compile the Rust code with the correct profile 2. Copy the .so to the expected location for MIX_ENV=test 3. Ensure the NIF loads correctly during tests Also removed debug find commands since issue is now resolved.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.