This is an automated email from the ASF dual-hosted git repository.

lidavidm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-adbc.git


The following commit(s) were added to refs/heads/main by this push:
     new 54c26cca8f ci(rust): build before testing so the dummy driver can be 
loaded (#5030)
54c26cca8f is described below

commit 54c26cca8f37562e790b7b0d3ce39b42c6f46c79
Author: Edgar Ramírez Mondragón 
<[email protected]>
AuthorDate: Mon Nov 16 01:46:37 2026 -0600

    ci(rust): build before testing so the dummy driver can be loaded (#5030)
    
    Cargo 1.100's new build directory layout no longer places cdylibs on the
    library search path during `cargo test`, so the exported dummy driver
    tests fail to find libadbc_dummy. Running `cargo build` first uplifts
    the cdylib into the target directory, which is on the search path
    (https://github.com/rust-lang/cargo/issues/8311). For context, from the
    1.100 release notes[^1]:
    
    > Cargo now uses a new directory layout for intermediate build
    artifacts. Tools that inspect the build directory may need to use
    [Cargo’s JSON
    
messages](https://doc.rust-lang.org/stable/cargo/reference/external-tools.html#json-messages)
    to locate build artifacts instead of relying on the build directory
    layout. The layout is not a stable interface and is subject to change.
    ([build cache
    doc](https://doc.rust-lang.org/stable/cargo/reference/build-cache.html))
    [#17354](https://github.com/rust-lang/cargo/pull/17354)
    
    [^1]:
    
https://doc.rust-lang.org/stable/releases.html#:~:text=Cargo%20now%20uses%20a%20new%20directory
    
    Assisted-by: Claude Opus 5.5 <[email protected]>
---
 .github/workflows/rust.yml | 10 ++++++++--
 CONTRIBUTING.md            |  1 +
 ci/scripts/rust_test.sh    |  3 +++
 rust/README.md             |  2 ++
 4 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
index 8d2ad318b6..2fbedab327 100644
--- a/.github/workflows/rust.yml
+++ b/.github/workflows/rust.yml
@@ -231,13 +231,19 @@ jobs:
         env:
           RUST_BACKTRACE: "1"
         working-directory: rust
-        run: >
+        run: |
+          # cargo test does not put cdylibs where tests can load them
+          # (https://github.com/rust-lang/cargo/issues/8311)
+          cargo build --workspace
           cargo test --all-targets --workspace
       - name: Test (All Features)
         env:
           RUST_BACKTRACE: "1"
         working-directory: rust
-        run: >
+        run: |
+          # cargo test does not put cdylibs where tests can load them
+          # (https://github.com/rust-lang/cargo/issues/8311)
+          cargo build --all-features --workspace
           cargo test --all-targets --all-features --workspace
       - name: Doctests
         env:
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index f50480598e..ea0e2858f0 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -464,6 +464,7 @@ The Rust components are a standard Rust project.
 ```shell
 $ pushd rust
 # Build and run tests
+$ cargo build
 $ cargo test
 ```
 
diff --git a/ci/scripts/rust_test.sh b/ci/scripts/rust_test.sh
index 7b304279a9..1a99d87359 100755
--- a/ci/scripts/rust_test.sh
+++ b/ci/scripts/rust_test.sh
@@ -32,5 +32,8 @@ case "$(uname)" in
     MINGW*|MSYS*) EXT="dll" ;;
 esac
 export 
ADBC_DRIVER_MANAGER_TEST_LIB="${cpp_libs_dir}/lib/libadbc_driver_sqlite.${EXT:-}"
+# cargo test does not put cdylibs where tests can load them
+# (https://github.com/rust-lang/cargo/issues/8311)
+cargo build --all-features --workspace
 cargo test --all-features --workspace
 popd
diff --git a/rust/README.md b/rust/README.md
index 1ef55713e8..814d75fb19 100644
--- a/rust/README.md
+++ b/rust/README.md
@@ -39,6 +39,8 @@ To run the integration tests you must:
 1. Build the official ADBC SQLite driver by following the 
[documentation](../CONTRIBUTING.md).
 1. Place the resulting object file into your dynamic loader path or set
    `LD_LIBRARY_PATH/DYLD_LIBRARY_PATH` appropriately.
+1. Run `cargo build --all-features --workspace` (to build the dummy driver's
+   shared library, which `cargo test` alone does not place on the library path)
 1. Run `cargo test --all-features --workspace`
 
 ## Writing Drivers

Reply via email to