Skip to content

Commit df4e7fb

Browse files
rholshausenclaude
andcommitted
fix(c examples): point loader at the build dir so pact_ffi's dylib is found
Since the C examples now link pact_ffi's cdylib (needed to pull in vendored Lua), the loader must be able to find libpact_ffi.so/.dylib/.dll at runtime. pact_ffi's build.rs intentionally gives the macOS dylib a bare install name (for discovery via a well-known system path like /usr/local/lib), so it isn't found relative to the executable; on Windows, corrosion copies the DLL to the top-level build dir while multi-config generators place the .exe in build/Release. Point LD_LIBRARY_PATH/DYLD_LIBRARY_PATH/PATH at ./build when running the examples so the loader finds it on all three platforms. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent 4e98bad commit df4e7fb

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

c/consumer/justfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ clean:
1616

1717
[unix]
1818
run: build
19-
./build/pact-consumer
19+
LD_LIBRARY_PATH="./build:${LD_LIBRARY_PATH:-}" DYLD_LIBRARY_PATH="./build:${DYLD_LIBRARY_PATH:-}" ./build/pact-consumer
2020

2121
[windows]
2222
run: build
23-
./build/Release/pact-consumer.exe
23+
PATH="./build:${PATH:-}" ./build/Release/pact-consumer.exe

c/provider/justfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ clean:
1616

1717
[unix]
1818
run: build
19-
./build/pact-provider
19+
LD_LIBRARY_PATH="./build:${LD_LIBRARY_PATH:-}" DYLD_LIBRARY_PATH="./build:${DYLD_LIBRARY_PATH:-}" ./build/pact-provider
2020

2121
[windows]
2222
run: build
23-
./build/Release/pact-provider.exe
23+
PATH="./build:${PATH:-}" ./build/Release/pact-provider.exe

0 commit comments

Comments
 (0)