Skip to content

fix: Use explicit path for Cargo.toml in hashFiles#17

Merged
ocean merged 15 commits into
mainfrom
claude/fix-latest-main-0134zC7hvWC6oQqJX8vdspAc
Nov 25, 2025
Merged

fix: Use explicit path for Cargo.toml in hashFiles#17
ocean merged 15 commits into
mainfrom
claude/fix-latest-main-0134zC7hvWC6oQqJX8vdspAc

Conversation

@ocean

@ocean ocean commented Nov 23, 2025

Copy link
Copy Markdown
Owner

No description provided.

claude and others added 15 commits November 23, 2025 03:58
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.
@ocean ocean merged commit 5350240 into main Nov 25, 2025
12 checks passed
@ocean ocean deleted the claude/fix-latest-main-0134zC7hvWC6oQqJX8vdspAc branch November 25, 2025 04:58
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.

2 participants