Skip to content

Commit c8a2207

Browse files
sayrerclaude
andcommitted
Fix run_tests.sh: use find -L to follow runfiles symlinks.
Bazel runfiles directories for external repos are symlinks that find doesn't traverse without -L. Also use $TEST_SRCDIR for the search root. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6839fc1 commit c8a2207

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

rust/swift-bindings/run_tests.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/bin/bash
22
# Wrapper script to run Swift tests on Linux via bazel test
3-
# Dynamically find the Swift runtime libs directory in the runfiles tree
4-
SWIFT_RUNTIME_DIR=$(dirname "$(find . -path '*/usr/lib/swift/linux/libswiftCore.so' -print -quit 2>/dev/null)")
5-
FFI_DIR=$(dirname "$(find . -name 'libtwitter_text_ffi.so' -print -quit 2>/dev/null)")
3+
# Dynamically find the Swift runtime libs directory in the runfiles tree.
4+
# -L is required because Bazel runfiles uses symlinks for external repo directories.
5+
RUNFILES="${TEST_SRCDIR:-.}"
6+
SWIFT_RUNTIME_DIR=$(dirname "$(find -L "$RUNFILES" -path '*/usr/lib/swift/linux/libswiftCore.so' -print -quit 2>/dev/null)")
7+
FFI_DIR=$(dirname "$(find -L "$RUNFILES" -name 'libtwitter_text_ffi.so' -print -quit 2>/dev/null)")
68
export LD_LIBRARY_PATH="${SWIFT_RUNTIME_DIR}:${FFI_DIR}:${LD_LIBRARY_PATH}"
79
exec "$1"

0 commit comments

Comments
 (0)