From 79544b401d7dfd9303df4bbfea25bab402821c14 Mon Sep 17 00:00:00 2001 From: Taewoon Kim Date: Sat, 24 Oct 2026 23:48:31 +0900 Subject: [PATCH] build.sh: follow a symlinked JAR_LIB_DIR The jar check used `find "$JAR_LIB_DIR"`, which does not follow a symlinked starting point, so a build with a symlinked lib directory failed with "No JAR files found". The check now uses `find -H`, and the staging copy uses `cp -aL` so a jar that is itself a symlink is staged as a real file (a copied link would dangle in the Docker build context and be skipped by the `find -type f` hash). One line added to CLAUDE.md. Port of humemai/arcadedb-embedded-python#463. Co-Authored-By: Claude Sonnet 5.5 --- CLAUDE.md | 1 + scripts/build.sh | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 88d68193..f96a86fb 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -25,6 +25,7 @@ ARCADEDB_TAG=26.11.1-SNAPSHOT ./scripts/build.sh # pin the arcadedata/arcaded - Linux builds use `scripts/Dockerfile.build`; macOS/Windows use `scripts/build-native.sh` with a native JDK 25+ (jlink). - Jars come from the `arcadedata/arcadedb` Docker image, filtered by `scripts/jar_exclusions.txt`, staged by `scripts/stage_jars.sh` (always re-pulled; stale jars from a previous build are removed). +- `JAR_LIB_DIR` (third argument) may be a symlink, and so may any jar in it: `build.sh` follows both and stages real files into `local-jars/`. - The package version is derived from the `arcadedb-engine-.jar` (`scripts/extract_version.py`): `26.11.1-SNAPSHOT` → `26.11.1.devN`. The `version = "0.0.0"` in `pyproject.toml` is a placeholder overwritten at build time. - `src/java/com/arcadedb/python/*.java` is compiled during the build into `arcadedb-python-bridge.jar` (both in `Dockerfile.build` and `build-native.sh`). Changing Java code requires a rebuild. - Output: `dist/*.whl`. `setup.py` only exists to force a platform-specific wheel tag. diff --git a/scripts/build.sh b/scripts/build.sh index 407f0c58..f2542ec5 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -168,7 +168,9 @@ if [[ -n "$JAR_LIB_DIR" ]]; then exit 1 fi - if ! find "$JAR_LIB_DIR" -maxdepth 1 -name "*.jar" -print -quit | grep -q .; then + # -H: find does not follow a symlinked starting point on its own, so a JAR_LIB_DIR that is + # a symlink to a directory looked empty and failed with "No JAR files found". + if ! find -H "$JAR_LIB_DIR" -maxdepth 1 -name "*.jar" -print -quit | grep -q .; then echo -e "${RED}❌ No JAR files found in: ${JAR_LIB_DIR}${NC}" exit 1 fi @@ -183,7 +185,9 @@ if [[ -n "$JAR_LIB_DIR" ]]; then echo -e "${CYAN}📦 Using provided JAR directory: ${YELLOW}${JAR_LIB_DIR}${NC}" rm -rf "$LOCAL_JARS_DIR" mkdir -p "$LOCAL_JARS_DIR" - cp -a "$JAR_LIB_DIR"/*.jar "$LOCAL_JARS_DIR"/ + # -L: a jar that is itself a symlink is staged as a file. A copied link would dangle in the + # Docker build context and the hash below (find -type f) would skip it. + cp -aL "$JAR_LIB_DIR"/*.jar "$LOCAL_JARS_DIR"/ JAR_SOURCE_DESC="${JAR_LIB_DIR} (staged into local-jars)" fi