diff --git a/.github/workflows/iceberg_spark_test.yml b/.github/workflows/iceberg_spark_test.yml index 4d6200c7ad..67fe2eea55 100644 --- a/.github/workflows/iceberg_spark_test.yml +++ b/.github/workflows/iceberg_spark_test.yml @@ -55,6 +55,10 @@ on: env: RUST_VERSION: stable RUST_BACKTRACE: 1 + # Force GNU ld on Linux: recent Rust stable defaults to rust-lld on + # x86_64-unknown-linux-gnu, and rust-lld cannot resolve -ljvm against the + # Zulu JDK layout installed by setup-java. Keep bfd for all cargo invocations. + RUSTFLAGS: "-Clink-arg=-fuse-ld=bfd" jobs: # Build native library once and share with all test jobs @@ -88,7 +92,7 @@ jobs: run: | cd native && cargo build --profile ci env: - RUSTFLAGS: "-Ctarget-cpu=x86-64-v3" + RUSTFLAGS: "-Ctarget-cpu=x86-64-v3 -Clink-arg=-fuse-ld=bfd" - name: Save Cargo cache uses: actions/cache/save@v5 diff --git a/.github/workflows/pr_build_linux.yml b/.github/workflows/pr_build_linux.yml index d93f85c0fc..4823153f7b 100644 --- a/.github/workflows/pr_build_linux.yml +++ b/.github/workflows/pr_build_linux.yml @@ -49,6 +49,10 @@ on: env: RUST_VERSION: stable RUST_BACKTRACE: 1 + # Force GNU ld on Linux: recent Rust stable defaults to rust-lld on + # x86_64-unknown-linux-gnu, and rust-lld cannot resolve -ljvm against the + # Zulu JDK layout installed by setup-java. Keep bfd for all cargo invocations. + RUSTFLAGS: "-Clink-arg=-fuse-ld=bfd" jobs: @@ -166,7 +170,7 @@ jobs: # (no LTO, parallel codegen) cargo build --profile ci env: - RUSTFLAGS: "-Ctarget-cpu=x86-64-v3" + RUSTFLAGS: "-Ctarget-cpu=x86-64-v3 -Clink-arg=-fuse-ld=bfd" - name: Upload native library uses: actions/upload-artifact@v7 diff --git a/.github/workflows/pr_build_macos.yml b/.github/workflows/pr_build_macos.yml index deaf595604..6d6ac14ec9 100644 --- a/.github/workflows/pr_build_macos.yml +++ b/.github/workflows/pr_build_macos.yml @@ -89,9 +89,9 @@ jobs: ~/.cargo/registry ~/.cargo/git native/target - key: ${{ runner.os }}-cargo-ci-${{ hashFiles('native/**/Cargo.lock', 'native/**/Cargo.toml') }}-${{ hashFiles('native/**/*.rs') }} + key: ${{ runner.os }}-cargo-ci-v2-${{ hashFiles('native/**/Cargo.lock', 'native/**/Cargo.toml') }}-${{ hashFiles('native/**/*.rs') }} restore-keys: | - ${{ runner.os }}-cargo-ci-${{ hashFiles('native/**/Cargo.lock', 'native/**/Cargo.toml') }}- + ${{ runner.os }}-cargo-ci-v2-${{ hashFiles('native/**/Cargo.lock', 'native/**/Cargo.toml') }}- - name: Build native library (CI profile) run: | @@ -117,7 +117,7 @@ jobs: ~/.cargo/registry ~/.cargo/git native/target - key: ${{ runner.os }}-cargo-ci-${{ hashFiles('native/**/Cargo.lock', 'native/**/Cargo.toml') }}-${{ hashFiles('native/**/*.rs') }} + key: ${{ runner.os }}-cargo-ci-v2-${{ hashFiles('native/**/Cargo.lock', 'native/**/Cargo.toml') }}-${{ hashFiles('native/**/*.rs') }} macos-aarch64-test: needs: build-native diff --git a/.github/workflows/spark_sql_test.yml b/.github/workflows/spark_sql_test.yml index e1fddda9b0..44780a42bc 100644 --- a/.github/workflows/spark_sql_test.yml +++ b/.github/workflows/spark_sql_test.yml @@ -61,6 +61,10 @@ on: env: RUST_VERSION: stable RUST_BACKTRACE: 1 + # Force GNU ld on Linux: recent Rust stable defaults to rust-lld on + # x86_64-unknown-linux-gnu, and rust-lld cannot resolve -ljvm against the + # Zulu JDK layout installed by setup-java. Keep bfd for all cargo invocations. + RUSTFLAGS: "-Clink-arg=-fuse-ld=bfd" jobs: @@ -95,7 +99,7 @@ jobs: cd native cargo build --profile ci env: - RUSTFLAGS: "-Ctarget-cpu=x86-64-v3" + RUSTFLAGS: "-Ctarget-cpu=x86-64-v3 -Clink-arg=-fuse-ld=bfd" - name: Upload native library uses: actions/upload-artifact@v7 diff --git a/native/fs-hdfs/build.rs b/native/fs-hdfs/build.rs index 23f93b7114..73b75e5c74 100644 --- a/native/fs-hdfs/build.rs +++ b/native/fs-hdfs/build.rs @@ -120,6 +120,12 @@ fn get_build_flags() -> Vec { fn get_java_dependency() -> Vec { let mut result = vec![]; + // Re-run when the JDK changes. The resolved jvm_lib_location below is + // baked into the crate's link args, so a cache restored against a previous + // JDK install (e.g. CI runners where setup-java floats Zulu patch + // versions) would otherwise hand the linker -L paths that no longer exist. + println!("cargo:rerun-if-env-changed=JAVA_HOME"); + // Include directories let java_home = java_locator::locate_java_home() .expect("JAVA_HOME could not be found, trying setting the variable manually");