From 2e3b52c88d23fe437417ea6e9a8dd0f641aae8a0 Mon Sep 17 00:00:00 2001 From: Shreyesh Arangath Date: Mon, 10 Aug 2026 05:12:17 +0000 Subject: [PATCH 1/2] [AURON #2460] Add --mvn, --goal and -- passthrough to auron-build.sh auron-build.sh always builds through build/mvn, which downloads Maven and so fails in an offline or airgapped build, always runs the install goal, and cannot forward Maven options other than -D. That makes it hard to call from a wrapper script. Add --mvn to build with an already installed Maven, accepting either a path or a command on PATH. Add --goal, defaulting to install so existing callers are unaffected, so a caller can run package and leave the local repository alone. Accept -- as an end-of-options marker so options such as -P, -B and --no-transfer-progress reach Maven, alongside the existing -D handling from #2227. --- auron-build.sh | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/auron-build.sh b/auron-build.sh index 2fffcabf5..74bdd06af 100755 --- a/auron-build.sh +++ b/auron-build.sh @@ -46,9 +46,11 @@ SUPPORTED_HUDI_VERSIONS=("0.15") # Print script usage information, supported options, and example commands. # ----------------------------------------------------------------------------- print_help() { - echo "Usage: $0 [OPTIONS] " + echo "Usage: $0 [OPTIONS] [--] " echo "Build Auron project with specified Maven profiles" echo + echo "Any arguments after -- are passed to Maven unchanged." + echo echo "Options:" echo " --pre Activate pre-release profile" echo " --release Activate release profile" @@ -57,6 +59,8 @@ print_help() { echo " --sparktests Run spark tests (default: false)" echo " --docker Build in Docker environment (default: false)" echo " --threads Maven build threads (e.g. 1, 4, 1C). Default: local unset, docker 8" + echo " --mvn Maven executable to build with (default: build/mvn, which downloads Maven)" + echo " --goal Maven goal to run, e.g. package or install (default: install)" IFS=','; echo " --image Docker image to use (e.g. ${SUPPORTED_OS_IMAGES[*]}, default: ${SUPPORTED_OS_IMAGES[*]:0:1})"; unset IFS IFS=','; echo " --sparkver Specify Spark version (e.g. ${SUPPORTED_SPARK_VERSIONS[*]})"; unset IFS IFS=','; echo " --flinkver Specify Flink version (e.g. ${SUPPORTED_FLINK_VERSIONS[*]})"; unset IFS @@ -163,6 +167,7 @@ PRE_PROFILE=false RELEASE_PROFILE=false CLEAN=true SKIP_TESTS=true +MVN_GOAL="install" SPARK_TESTS=false THREADS="" SPARK_VER="" @@ -375,9 +380,34 @@ while [[ $# -gt 0 ]]; do exit 1 fi ;; + --mvn) + if [[ -n "$2" && "$2" != -* ]]; then + if ! MVN_CMD="$(command -v "$2")"; then + echo "ERROR: --mvn '$2' is not an executable or a command on PATH" >&2 + exit 1 + fi + shift 2 + else + echo "ERROR: Missing argument for --mvn, specify a path to a Maven executable" >&2 + exit 1 + fi + ;; + --goal) + if [[ -n "$2" && "$2" != -* ]]; then + MVN_GOAL="$2" + shift 2 + else + echo "ERROR: Missing argument for --goal, specify a Maven goal such as package or install" >&2 + exit 1 + fi + ;; -h|--help) print_help ;; + --) + shift + break + ;; --*) echo "ERROR: Unknown option '$1'" >&2 echo "Use '$0 --help' for usage information" >&2 @@ -467,9 +497,9 @@ fi BUILD_ARGS=() if [[ "$SKIP_TESTS" == true ]]; then - BUILD_ARGS+=("install" "-DskipTests") + BUILD_ARGS+=("$MVN_GOAL" "-DskipTests") else - BUILD_ARGS+=("install") + BUILD_ARGS+=("$MVN_GOAL") fi if [[ "$SPARK_TESTS" == true ]]; then From 07968ec9c780bb9d4a8bc991e09cb718fac0482b Mon Sep 17 00:00:00 2001 From: ShreyeshArangath Date: Sun, 16 Aug 2026 17:44:01 -0700 Subject: [PATCH 2/2] [AURON #2460] Address review: honor --mvn for version resolution, forward passthrough args in Docker Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- auron-build.sh | 18 +++++++++++++++--- dev/docker-build/docker-compose.yml | 2 +- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/auron-build.sh b/auron-build.sh index 74bdd06af..89eec895f 100755 --- a/auron-build.sh +++ b/auron-build.sh @@ -59,7 +59,8 @@ print_help() { echo " --sparktests Run spark tests (default: false)" echo " --docker Build in Docker environment (default: false)" echo " --threads Maven build threads (e.g. 1, 4, 1C). Default: local unset, docker 8" - echo " --mvn Maven executable to build with (default: build/mvn, which downloads Maven)" + echo " --mvn Maven executable to build with, local builds only" + echo " (default: build/mvn, which downloads Maven)" echo " --goal Maven goal to run, e.g. package or install (default: install)" IFS=','; echo " --image Docker image to use (e.g. ${SUPPORTED_OS_IMAGES[*]}, default: ${SUPPORTED_OS_IMAGES[*]:0:1})"; unset IFS IFS=','; echo " --sparkver Specify Spark version (e.g. ${SUPPORTED_SPARK_VERSIONS[*]})"; unset IFS @@ -155,6 +156,7 @@ run_docker_compose_up() { } MVN_CMD="$(dirname "$0")/build/mvn" +MVN_CMD_OVERRIDDEN=false # ----------------------------------------------------------------------------- # Section: Initialize Variables @@ -382,6 +384,7 @@ while [[ $# -gt 0 ]]; do ;; --mvn) if [[ -n "$2" && "$2" != -* ]]; then + MVN_CMD_OVERRIDDEN=true if ! MVN_CMD="$(command -v "$2")"; then echo "ERROR: --mvn '$2' is not an executable or a command on PATH" >&2 exit 1 @@ -557,7 +560,7 @@ BUILD_INFO_FILE="common/src/main/resources/auron-build-info.properties" mkdir -p "$(dirname "$BUILD_INFO_FILE")" JAVA_VERSION=$(java -version 2>&1 | head -n 1 | awk '{print $3}' | tr -d '"') -PROJECT_VERSION=$(./build/mvn help:evaluate -N -Dexpression=project.version -Pspark-${SPARK_VER} -q -DforceStdout 2>/dev/null) +PROJECT_VERSION=$("$MVN_CMD" help:evaluate -N -Dexpression=project.version -Pspark-${SPARK_VER} -q -DforceStdout 2>/dev/null) RUST_VERSION=$(rustc --version | awk '{print $2}') get_build_info() { @@ -621,6 +624,9 @@ fi # ----------------------------------------------------------------------------- if [[ "$USE_DOCKER" == true ]]; then echo "[INFO] Compiling inside Docker container using image: $IMAGE_NAME" + if [[ "$MVN_CMD_OVERRIDDEN" == true ]]; then + echo "[WARN] --mvn only applies to local builds; the container always uses ./build/mvn" + fi if [[ "$CLEAN" == true ]]; then # Clean the host-side directory that is mounted into the Docker container. # This avoids "device or resource busy" errors when running `mvn clean` inside the container. @@ -629,7 +635,13 @@ if [[ "$USE_DOCKER" == true ]]; then fi echo "[INFO] Compiling inside Docker container..." - export AURON_BUILD_ARGS="${BUILD_ARGS[*]}" + # Forward -D arguments and everything after `--` into the container. + DOCKER_MVN_ARGS=("${BUILD_ARGS[@]}" "${MVN_D_ARGS[@]}" "$@") + AURON_BUILD_ARGS="" + for arg in "${DOCKER_MVN_ARGS[@]}"; do + AURON_BUILD_ARGS+="$(printf '%q' "$arg") " + done + export AURON_BUILD_ARGS="${AURON_BUILD_ARGS% }" export BUILD_CONTEXT="./${IMAGE_NAME}" # Spark 4.x requires JDK 17+, auto-set if not specified if [[ -z "$AURON_JAVA_VERSION" && "$SPARK_VER" == 4.* ]]; then diff --git a/dev/docker-build/docker-compose.yml b/dev/docker-build/docker-compose.yml index e8e938f37..f5c8f2fef 100644 --- a/dev/docker-build/docker-compose.yml +++ b/dev/docker-build/docker-compose.yml @@ -39,5 +39,5 @@ services: source ~/.bashrc && cd /auron && echo "[DOCKER] Running: ./build/mvn $AURON_BUILD_ARGS" && - ./build/mvn $AURON_BUILD_ARGS + eval "./build/mvn $AURON_BUILD_ARGS" '