Skip to content

Commit 92e22b2

Browse files
committed
fix: Correct JAR filtering in both Docker and native builds
Two critical fixes for JAR exclusion based on jar_exclusions.txt: 1. **Docker build (Dockerfile.build)**: - python-builder stage was copying JARs from java-builder (unfiltered) - Changed to copy from jre-builder (already filtered in that stage) - Impact: Linux AMD64/ARM64 wheels now match Darwin/Windows sizes 2. **Native build (build-native.sh)**: - Added debug output to show which patterns are processed - Added nullglob to handle no-match cases gracefully - Added counter to show how many JARs were removed - Will help diagnose Windows-specific issues if any Expected impact: - Linux AMD64: 195.9M → ~157M (saves ~38M) - Linux ARM64: 195.0M → ~157M (saves ~38M) - Windows AMD64: 192.5M → ~157M (saves ~35M) - pending verification - Darwin wheels: Already correct at ~157M All platforms should now have consistent wheel sizes of ~157-158M.
1 parent 62f20d4 commit 92e22b2

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

bindings/python/Dockerfile.build

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,9 @@ ENV PATH=$PATH:$JAVA_HOME/bin
9292

9393
WORKDIR /build
9494

95-
# Copy compiled JARs from the prebuilt ArcadeDB image
96-
# The official image places JARs under /home/arcadedb/lib
95+
# Copy filtered JARs from jre-builder (already has exclusions applied)
9796
RUN mkdir -p /build/jars
98-
COPY --from=java-builder /home/arcadedb/lib /build/jars/
97+
COPY --from=jre-builder /build/jars /build/jars/
9998

10099
# Copy JRE from jre-builder stage
101100
COPY --from=jre-builder /build/jre /build/jre/

bindings/python/build-native.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,18 +117,26 @@ echo -e "${CYAN}📦 Preparing package...${NC}"
117117
EXCLUSIONS_FILE="$SCRIPT_DIR/jar_exclusions.txt"
118118
if [[ -f "$EXCLUSIONS_FILE" ]]; then
119119
echo -e "${YELLOW}🗑️ Removing excluded JARs from jar_exclusions.txt...${NC}"
120+
EXCLUSION_COUNT=0
120121
while IFS= read -r pattern || [[ -n "$pattern" ]]; do
121122
# Skip empty lines and comments
122123
if [[ -n "$pattern" ]] && [[ ! "$pattern" =~ ^# ]]; then
124+
echo -e "${CYAN} Processing pattern: $pattern${NC}"
123125
# Remove matching JARs
126+
shopt -s nullglob # Make glob expand to nothing if no matches
124127
for jar in "$JARS_DIR"/$pattern; do
125128
if [[ -f "$jar" ]]; then
126129
rm -f "$jar"
127130
echo -e "${YELLOW} - Removed: $(basename "$jar")${NC}"
131+
((EXCLUSION_COUNT++))
132+
else
133+
echo -e "${CYAN} - Pattern matched but not a file: $jar${NC}"
128134
fi
129135
done
136+
shopt -u nullglob
130137
fi
131138
done < "$EXCLUSIONS_FILE"
139+
echo -e "${GREEN}✅ Removed $EXCLUSION_COUNT JAR(s)${NC}"
132140
fi
133141

134142
# Build and copy JRE

0 commit comments

Comments
 (0)