fix: cargo clean before release build to avoid stale native libs#4257
Open
andygrove wants to merge 1 commit intoapache:mainfrom
Open
fix: cargo clean before release build to avoid stale native libs#4257andygrove wants to merge 1 commit intoapache:mainfrom
andygrove wants to merge 1 commit intoapache:mainfrom
Conversation
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 apache#2232
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes #2232
Rationale for this change
Issue #2232 reported that the 0.9.1 jars were nearly twice the size of 0.9.0. Investigation showed that a stale
org/apache/comet/darwin/aarch64/libcomet.dylib(227MB uncompressed) was bundled into the release jar, even though the release script hadHAS_MACOS_SDK=false(the default) and was not asked to ship a darwin/aarch64 binary.Root cause:
common/pom.xmldeclares two unconditional resource entries that always bundlelibcomet.dylibfromnative/target/{x86_64,aarch64}-apple-darwin/releasewhenever those files exist on disk. The release script runs./mvnw clean, but Maven only cleanscommon/target, not Cargo'snative/target. If the release manager has previously runmake release-linux(or otherwise cross-compiled to apple-darwin) in their working tree, those stale dylibs silently leak into the release jars produced bybuild-release-comet.sh.What changes are included in this PR?
dev/release/build-release-comet.sh: runcargo cleanaftermvnw cleanso stale cross-compiled artifacts are removed before the release build.docs/source/contributor-guide/release_process.md: add a note explaining the leakage risk and recommending release managers run from a fresh clone as a defense-in-depth measure.How are these changes tested?
Manual review only. The release script is exercised by release managers ahead of each release; no automated test exists for this code path.