Repository navigation
Conversation
Signed-off-by: Som Samantray <[email protected]>
|
/review |
yili-db
left a comment
There was a problem hiding this comment.
[AI Assisted] The direction is right: a stale or POM-only ~/.m2 shouldn't break default builds. But as written, this also cuts off UC's own source-build CI path (see inline).
nit: Under build/sbt the change that matters is the repositories file. -Dsbt.override.build.repos=true already makes the launcher ignore the build.sbt resolver, so that removal only affects a system sbt or an IDE import. Worth saying in the description.
| @@ -1,6 +1,5 @@ | |||
| [repositories] | |||
| local | |||
| maven-local: file://${user.home}/.m2/repository | |||
There was a problem hiding this comment.
[AI Assisted] UC's own build/sbt still needs ~/.m2 after this. Source-built Spark only lands there (build_spark.sh), and build_delta.sh only does publishM2, so integrationTests/test:compile / spark/jacoco with -DdeltaVersion=<SNAPSHOT> can't resolve. Can we mirror Delta's opt-in block from its build/sbt into ours and export the flag from prepare-spark-env and for the master-SNAPSHOT rows? Those rows are non-blocking, so please link a passing run of one source-Spark row and one Delta-SNAPSHOT row.
Also, the Delta-SNAPSHOT rows with released Spark need the opt-in too, so a name scoped to source-built Spark (USE_MAVEN_LOCAL_FOR_SOURCE_SPARK) would be misleading there. Maybe a more general name?
| found_jars.add(jar_file.name) | ||
| return found_jars | ||
|
|
||
| def test_default_resolvers_exclude_maven_local(self) -> bool: |
There was a problem hiding this comment.
[AI Assisted] What is this actually testing? It's a substring grep. It passes while the source-build path is broken, ignores build/sbt, and a comment containing maven-local: would fail it. Can we assert the resolvers sbt really uses (build/sbt "export fullResolvers"), once without the flag (no .m2) and once with it? Also, is the cross-Spark publish test the right place for this?
| # filters them via pomPostProcess. USE_MAVEN_LOCAL_FOR_SOURCE_SPARK enables the | ||
| # local Maven resolver when a source-built Spark needs those artifacts. |
There was a problem hiding this comment.
[AI Assisted] This variable is read by Delta's build/sbt, not ours, since we've already cd'd into $DELTA_DIR. Can the comment say so? It's also only set for source-built Spark, so the "UC jars are already in ~/.m2" line above is no longer how Delta finds UC jars with released Spark.
Signed-off-by: Som Samantray <[email protected]>
Signed-off-by: Som Samantray <[email protected]>
Signed-off-by: Som Samantray <[email protected]>
|
/review |
yili-db
left a comment
There was a problem hiding this comment.
[AI Assisted] Thanks, the opt-in and the effective-resolver test address my earlier comments. Two things left, inline.
| env["USE_MAVEN_LOCAL"] = "true" | ||
|
|
||
| result = subprocess.run( | ||
| [str(UC_ROOT / "build/sbt"), "-batch", "show fullResolvers"], |
There was a problem hiding this comment.
[AI Assisted] This fails in CI ("Build Test": sbt did not print any fullResolvers task results). With CI=true sbt colors its output, so the fullmatch never hits. Passing -no-colors fixes it (checked locally with CI=true). Can we also print sbt's stdout/stderr when this fails? The CI log had nothing to go on.
There was a problem hiding this comment.
I added -no-colors, strip ANSI escapes before matching, and include the command plus sbt stdout/stderr in failure messages. The resolver test passed locally with and without CI=true in commit 7ce1ad30845077debafee0c5a2be5c90825d9f57.
| cp "$SBT_REPOSITORIES_CONFIG" "$UC_SBT_TEMP_REPOSITORIES_CONFIG" | ||
| SBT_REPOSITORIES_CONFIG="$UC_SBT_TEMP_REPOSITORIES_CONFIG" | ||
| fi | ||
| MAVEN_LOCAL_REPO="${MAVEN_LOCAL_REPO:-${HOME}/.m2/repository}" |
There was a problem hiding this comment.
[AI Assisted] Who sets MAVEN_LOCAL_REPO? Nothing in CI does, and the test pops it. Can we drop it until someone needs it? It's also unvalidated: a relative path gives file://tmp/m2, which sbt reads as a host.
There was a problem hiding this comment.
I removed MAVEN_LOCAL_REPO support. USE_MAVEN_LOCAL=true now uses ~/.m2/repository directly, and the regression test confirms that behavior. This is in commit 7ce1ad30845077debafee0c5a2be5c90825d9f57.
Signed-off-by: Som Samantray <[email protected]>
|
I clarified that |
|
/review |
Description of changes
Default builds launched with the bundled
build/sbtno longer resolve dependencies from~/.m2/repository. The bundled launcher passes-Dsbt.override.build.repos=true, so its resolver chain comes frombuild/sbt-config/repositories; this prevents stale or POM-only local artifacts from breaking normal builds.The
Resolver.mavenLocalremoval frombuild.sbtonly affects a systemsbtor IDE import. It does not control resolver selection for the bundled launcher.Local Maven resolution remains available when needed: set
USE_MAVEN_LOCAL=trueto append Maven local after the configured repositories. It uses~/.m2/repository. For example:USE_MAVEN_LOCAL=true build/sbt "spark/compile"CI enables this flag for source-built Spark rows and for every
master-SNAPSHOTDelta row. The Delta source build has its own launcher, soproject/scripts/build_delta.shsets Delta'sUSE_MAVEN_LOCAL_FOR_SOURCE_SPARK=truewhile Delta publishes against UC's Maven artifacts and, when applicable, source-built Spark artifacts.The resolver regression test lives in
project/tests/test_sbt_resolvers.pybecause it checks the effective resolver chain produced by UC's bundled launcher.cross-spark-build.ymlruns it separately fromtest_cross_spark_publish.py; the old substring grep was removed. The test disables sbt colors, strips ANSI escape codes before matching, and prints the command and captured output if sbt fails or the expected task output is missing.Closes #1874.
Validation:
python3 project/tests/test_sbt_resolvers.pypassed with JDK 17 for default and opted-in resolver behavior.CI=true python3 project/tests/test_sbt_resolvers.pypassed with JDK 17.build/sbt -batch -J-Xmx1G "hadoop/compile" "spark/compile"passed.bash -n build/sbt project/scripts/build_delta.sh, Python syntax compilation, andgit diff --checkpassed.The informational Spark 4.3.0-SNAPSHOT / Delta master-SNAPSHOT job's Delta initializer failure is also present on main and is unrelated to this change; it was left unchanged.
GitHub Actions runs for this pushed head are currently
action_requiredpending maintainer approval; the DCO check passed.AI disclosure: Codex assisted with investigation, implementation, testing, and review. The final diff was reviewed against the repository guidance.