Skip to content

Commit 82346d2

Browse files
committed
ci: force GNU ld on Linux to fix -ljvm linker error
Recent Rust stable defaults to rust-lld as the linker on x86_64-unknown-linux-gnu. rust-lld cannot resolve -ljvm against the Zulu JDK layout installed by actions/setup-java, producing: rust-lld: error: unable to find library -ljvm GNU ld resolves it fine. Add -Clink-arg=-fuse-ld=bfd via workflow-level RUSTFLAGS so every cargo invocation in Linux CI picks GNU ld, and extend the per-step RUSTFLAGS values that already set -Ctarget-cpu to include the same flag (step-level env overrides workflow-level).
1 parent ee140c7 commit 82346d2

3 files changed

Lines changed: 15 additions & 3 deletions

File tree

.github/workflows/iceberg_spark_test.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ on:
5555
env:
5656
RUST_VERSION: stable
5757
RUST_BACKTRACE: 1
58+
# Force GNU ld on Linux: recent Rust stable defaults to rust-lld on
59+
# x86_64-unknown-linux-gnu, and rust-lld cannot resolve -ljvm against the
60+
# Zulu JDK layout installed by setup-java. Keep bfd for all cargo invocations.
61+
RUSTFLAGS: "-Clink-arg=-fuse-ld=bfd"
5862

5963
jobs:
6064
# Build native library once and share with all test jobs
@@ -88,7 +92,7 @@ jobs:
8892
run: |
8993
cd native && cargo build --profile ci
9094
env:
91-
RUSTFLAGS: "-Ctarget-cpu=x86-64-v3"
95+
RUSTFLAGS: "-Ctarget-cpu=x86-64-v3 -Clink-arg=-fuse-ld=bfd"
9296

9397
- name: Save Cargo cache
9498
uses: actions/cache/save@v5

.github/workflows/pr_build_linux.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ on:
4949
env:
5050
RUST_VERSION: stable
5151
RUST_BACKTRACE: 1
52+
# Force GNU ld on Linux: recent Rust stable defaults to rust-lld on
53+
# x86_64-unknown-linux-gnu, and rust-lld cannot resolve -ljvm against the
54+
# Zulu JDK layout installed by setup-java. Keep bfd for all cargo invocations.
55+
RUSTFLAGS: "-Clink-arg=-fuse-ld=bfd"
5256

5357
jobs:
5458

@@ -166,7 +170,7 @@ jobs:
166170
# (no LTO, parallel codegen)
167171
cargo build --profile ci
168172
env:
169-
RUSTFLAGS: "-Ctarget-cpu=x86-64-v3"
173+
RUSTFLAGS: "-Ctarget-cpu=x86-64-v3 -Clink-arg=-fuse-ld=bfd"
170174

171175
- name: Upload native library
172176
uses: actions/upload-artifact@v7

.github/workflows/spark_sql_test.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ on:
6161
env:
6262
RUST_VERSION: stable
6363
RUST_BACKTRACE: 1
64+
# Force GNU ld on Linux: recent Rust stable defaults to rust-lld on
65+
# x86_64-unknown-linux-gnu, and rust-lld cannot resolve -ljvm against the
66+
# Zulu JDK layout installed by setup-java. Keep bfd for all cargo invocations.
67+
RUSTFLAGS: "-Clink-arg=-fuse-ld=bfd"
6468

6569
jobs:
6670

@@ -95,7 +99,7 @@ jobs:
9599
cd native
96100
cargo build --profile ci
97101
env:
98-
RUSTFLAGS: "-Ctarget-cpu=x86-64-v3"
102+
RUSTFLAGS: "-Ctarget-cpu=x86-64-v3 -Clink-arg=-fuse-ld=bfd"
99103

100104
- name: Upload native library
101105
uses: actions/upload-artifact@v7

0 commit comments

Comments
 (0)