Skip to content

Commit a2fd51b

Browse files
authored
fix: cargo clean before release build to avoid stale native libs (#4257)
1 parent 6f50ccf commit a2fd51b

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

dev/release/build-release-comet.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,13 @@ docker build --no-cache \
125125
# Clean previous Java build
126126
pushd $COMET_HOME_DIR && ./mvnw clean && popd
127127

128+
# Clean previous native build. This is required because common/pom.xml has
129+
# unconditional resource entries that bundle libcomet.dylib from
130+
# native/target/{x86_64,aarch64}-apple-darwin/release. If a release manager
131+
# previously cross-compiled those targets locally, stale dylibs would leak
132+
# into the release jars. See https://github.com/apache/datafusion-comet/issues/2232
133+
pushd $COMET_HOME_DIR/native && cargo clean && popd
134+
128135
# Run the builder container for each architecture. The entrypoint script will build the binaries
129136

130137
# AMD64

docs/source/contributor-guide/release_process.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,21 @@ commit into the release branch.
158158

159159
### Build the jars
160160

161+
#### A note on workspace cleanliness
162+
163+
The `common/pom.xml` resource configuration unconditionally bundles
164+
`native/target/{x86_64,aarch64}-apple-darwin/release/libcomet.dylib` into the
165+
`common` jar when those files exist on disk. Maven's `clean` removes
166+
`common/target` but does not touch Cargo's `native/target` directory, so a
167+
stale dylib left over from a prior local `make release` or `make release-linux`
168+
on the release manager's workstation can silently end up in a release jar
169+
(see [#2232](https://github.com/apache/datafusion-comet/issues/2232) for the
170+
incident in 0.9.1).
171+
172+
The `build-release-comet.sh` script now runs `cargo clean` for you, but as a
173+
defensive measure, prefer running the release build from a fresh clone of the
174+
repository rather than your day-to-day working tree.
175+
161176
#### Setup to do the build
162177

163178
The build process requires Docker. Download the latest Docker Desktop from https://www.docker.com/products/docker-desktop/.

0 commit comments

Comments
 (0)