You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datafusion.apache.org by gi...@apache.org on 2026/10/23 09:34:00 UTC

(datafusion) 01/01: chore: speedup semver check using shared target directory (#26598)

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

github-merge-queue[bot] pushed a commit to branch gh-readonly-queue/main/pr-26598-2a96d6d621de441d81604b7d99fd0145df3903c8
in repository https://gitbox.apache.org/repos/asf/datafusion.git

commit 209d852e5e010fab868e6f84095c82a4aec3ca19
Author: Neil Conway <ne...@gmail.com>
AuthorDate: Fri Oct 23 07:30:49 2026 +0000

    chore: speedup semver check using shared target directory (#26598)
    
    ## Which issue does this PR close?
    
    - N/A
    
    ## Rationale for this change
    
    For every changed crate, `cargo-semver-checks` compiles two versions of
    it (baseline version vs. PR version). By default, each build uses its
    own target directory. For example, a PR touching three crates will
    result in six from-scratch compilations.
    
    We can improve this by setting `CARGO_TARGET_DIR`, so that all of these
    builds use a shared target directory. This means that unmodified
    dependencies need only be built once.
    
    This improves semver check runtime by ~1.8-3x, depending on the nature
    of the PR, and also reduces disk space consumption.
    
    ## What changes are included in this PR?
    
    See above.
    
    ## What is the testing strategy for this PR?
    
    Tested locally, dev tooling change only.
    
    ## Are there any user-facing changes?
    
    No.
---
 ci/scripts/changed_crates.sh | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/ci/scripts/changed_crates.sh b/ci/scripts/changed_crates.sh
index be8c48b26e..96ca51b508 100755
--- a/ci/scripts/changed_crates.sh
+++ b/ci/scripts/changed_crates.sh
@@ -74,7 +74,15 @@ cmd_semver_check() {
     args+=(--package "$pkg")
   done
 
-  cargo semver-checks --baseline-rev "$base_ref" "${args[@]}"
+  # cargo-semver-checks builds the rustdoc for each crate, current and
+  # baseline, in a separate placeholder project. Each project has its own
+  # target directory unless CARGO_TARGET_DIR is set, so a shared directory
+  # lets those builds reuse the compiled dependencies.
+  local target_dir
+  target_dir=$(cargo metadata --no-deps --format-version 1 | jq -r .target_directory)
+
+  CARGO_TARGET_DIR="${target_dir}/semver-checks-shared" \
+    cargo semver-checks --baseline-rev "$base_ref" "${args[@]}"
 }
 
 # ── main ────────────────────────────────────────────────────────────


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org