Files
bun.sh/test/js
Claude Bot d77565074a Fix FFI cc to resolve relative paths from calling module directory
Previously, when using bun:ffi's cc function with relative source paths,
the paths would be incorrectly resolved, resulting in errors like
"file '/test.c' not found" instead of properly resolving relative to
the calling module's directory or current working directory.

This fix:
- Gets the caller's source location using callframe.getCallerSrcLoc()
- Falls back to current working directory if caller location is unavailable
- Uses the proper directory to resolve relative source paths
- Adds comprehensive tests for both absolute and relative path scenarios

Fixes the issue where FFI cc with relative paths would fail when the
code is bundled or inlined, as the relative paths now correctly resolve
relative to the appropriate directory context.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-20 01:56:58 +00:00
..