Skip to content

Commit 9b6ab6a

Browse files
authored
fix: make dylib rpath available for all targets (#3590)
The dynamic library search path is defined relative to the executable location. Executables either reside under `target/<build_config>` or `target/<build_config>/deps`. Signed-off-by: Alexander Droste <[email protected]>
1 parent e79b230 commit 9b6ab6a

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

.cargo/config.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ rustflags = [
33
"-C", "force-frame-pointers=yes",
44
# Add dynamic DuckDB library directory to runtime search path.
55
"-C", "link-arg=-Wl,-rpath,$ORIGIN/../duckdb-v1.3.0",
6-
"-C", "link-arg=-Wl,-rpath,@executable_path/../duckdb-v1.3.0"
6+
"-C", "link-arg=-Wl,-rpath,$ORIGIN/../../duckdb-v1.3.0",
7+
"-C", "link-arg=-Wl,-rpath,@executable_path/../duckdb-v1.3.0",
8+
"-C", "link-arg=-Wl,-rpath,@executable_path/../../duckdb-v1.3.0"
79
]
810

911
[target.wasm32-unknown-unknown]

.github/workflows/bench-pr.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ jobs:
129129

130130
- name: Run ${{ matrix.benchmark.name }} benchmark
131131
shell: bash
132+
env:
133+
RUST_BACKTRACE: full
134+
LD_LIBRARY_PATH: target/duckdb-v1.3.0
132135
run: |
133136
target/release_debug/${{ matrix.benchmark.id }} -d gh-json | tee ${{ matrix.benchmark.id }}.json
134137

vortex-duckdb-ext/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ fn main() {
109109
// Link against DuckDB dylib.
110110
println!("cargo:rustc-link-search=native={}", lib_path.display());
111111
println!("cargo:rustc-link-lib=dylib=duckdb");
112+
println!("cargo:rustc-link-arg=-Wl,-rpath,{}", lib_path.display());
112113

113114
if env::var("TARGET").unwrap().contains("linux") {
114115
println!("cargo:rustc-link-lib=stdc++");

0 commit comments

Comments
 (0)