Skip to content

[AURON #2459] Resolve build info paths relative to auron-build.sh - #2461

Draft
ShreyeshArangath wants to merge 1 commit into
apache:masterfrom
ShreyeshArangath:auron-2459-build-info-paths
Draft

[AURON #2459] Resolve build info paths relative to auron-build.sh#2461
ShreyeshArangath wants to merge 1 commit into
apache:masterfrom
ShreyeshArangath:auron-2459-build-info-paths

Conversation

@ShreyeshArangath

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Fixes #2459.

auron-build.sh resolved both the build info file and the Maven used to look up project.version relative to the caller's working directory. Run from anywhere other than the project root, it wrote auron-build-info.properties outside the project so the build never picked it up, and left project.version out of the file entirely because the lookup failed into /dev/null and empty values are skipped by the writing loop.

Three changes:

  • Resolve SCRIPT_DIR from BASH_SOURCE and use it for BUILD_INFO_FILE, so the file always lands in the project.
  • Use the already resolved MVN_CMD instead of a hardcoded ./build/mvn.
  • Pass -f "$SCRIPT_DIR/pom.xml" so Maven reads the project pom, and fail with the captured Maven output when the version cannot be resolved.

The -f part is worth calling out. Without it, help:evaluate run from another directory does not fail; Maven falls back to its synthetic standalone pom and reports version 1, so the jar gets a plausible but wrong version. Pinning the pom and validating the result covers that.

How was this patch tested?

Manually, on Spark 3.1 / Scala 2.12.

Before, from a directory outside the project, project.version is missing and the file is written to the wrong place:

$ cd /tmp/elsewhere && bash /path/to/auron/auron-build.sh --release --sparkver 3.1 --scalaver 2.12
[INFO] Build configuration (from common/src/main/resources/auron-build-info.properties):
[INFO]   spark.version : 3.1
[INFO]   scala.version : 2.12
[INFO]   build.timestamp : 2026-08-08T23:32:59Z
auron-build.sh: line 611: /tmp/elsewhere/build/mvn: No such file or directory

After, from the same directory:

[INFO] Build configuration (from /path/to/auron/common/src/main/resources/auron-build-info.properties):
[INFO]   spark.version : 3.1
[INFO]   rust.version : 1.97.1
[INFO]   java.version : 17.0.19
[INFO]   project.version : 9.0.0-SNAPSHOT
[INFO]   scala.version : 2.12
[INFO]   build.timestamp : 2026-08-10T05:07:19Z

Also checked:

  • Running from the project root is unchanged.
  • Nothing is written into the caller's directory any more.
  • With an unresolvable Maven the script now exits 1 and prints the Maven output, instead of continuing and producing a jar with no version.

auron-build.sh resolved both the build info file and the Maven used to
look up project.version relative to the caller's working directory. Run
from anywhere other than the project root it wrote
auron-build-info.properties outside the project, so the build never
picked it up, and project.version was dropped from the file because the
lookup failed into /dev/null and empty values are skipped.

Resolve SCRIPT_DIR from BASH_SOURCE and use it for the build info file,
reuse the already resolved MVN_CMD instead of a hardcoded ./build/mvn,
and pass -f so Maven reads the project pom rather than falling back to
its standalone pom, which reports version 1. Fail with the captured
Maven output when the version cannot be resolved, rather than shipping a
jar with no version in it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUILD] auron-build.sh writes build info to the caller's directory and silently drops project.version

1 participant