From 83a05b00fc404ce11a37fa6717fba5c5819f4154 Mon Sep 17 00:00:00 2001 From: Andy Grove Date: Thu, 7 May 2026 07:51:50 -0600 Subject: [PATCH] fix: cargo clean before release build to avoid stale native libs The common/pom.xml resource configuration unconditionally bundles libcomet.dylib from native/target/{x86_64,aarch64}-apple-darwin/release into the common jar. Maven's clean does not touch Cargo's native/target, so stale dylibs from a prior local cross-compile on the release manager's workstation could silently leak into release jars. Run cargo clean in build-release-comet.sh before the docker builds, and document the issue in the release process guide. Refs #2232 --- dev/release/build-release-comet.sh | 7 +++++++ docs/source/contributor-guide/release_process.md | 15 +++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/dev/release/build-release-comet.sh b/dev/release/build-release-comet.sh index 91d02885af..d0171eb98f 100755 --- a/dev/release/build-release-comet.sh +++ b/dev/release/build-release-comet.sh @@ -125,6 +125,13 @@ docker build --no-cache \ # Clean previous Java build pushd $COMET_HOME_DIR && ./mvnw clean && popd +# Clean previous native build. This is required because common/pom.xml has +# unconditional resource entries that bundle libcomet.dylib from +# native/target/{x86_64,aarch64}-apple-darwin/release. If a release manager +# previously cross-compiled those targets locally, stale dylibs would leak +# into the release jars. See https://github.com/apache/datafusion-comet/issues/2232 +pushd $COMET_HOME_DIR/native && cargo clean && popd + # Run the builder container for each architecture. The entrypoint script will build the binaries # AMD64 diff --git a/docs/source/contributor-guide/release_process.md b/docs/source/contributor-guide/release_process.md index 2a3c07adb7..23d2b91105 100644 --- a/docs/source/contributor-guide/release_process.md +++ b/docs/source/contributor-guide/release_process.md @@ -158,6 +158,21 @@ commit into the release branch. ### Build the jars +#### A note on workspace cleanliness + +The `common/pom.xml` resource configuration unconditionally bundles +`native/target/{x86_64,aarch64}-apple-darwin/release/libcomet.dylib` into the +`common` jar when those files exist on disk. Maven's `clean` removes +`common/target` but does not touch Cargo's `native/target` directory, so a +stale dylib left over from a prior local `make release` or `make release-linux` +on the release manager's workstation can silently end up in a release jar +(see [#2232](https://github.com/apache/datafusion-comet/issues/2232) for the +incident in 0.9.1). + +The `build-release-comet.sh` script now runs `cargo clean` for you, but as a +defensive measure, prefer running the release build from a fresh clone of the +repository rather than your day-to-day working tree. + #### Setup to do the build The build process requires Docker. Download the latest Docker Desktop from https://www.docker.com/products/docker-desktop/.