mirror of
https://github.com/oven-sh/bun
synced 2026-02-15 13:22:07 +00:00
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>