cloud-fan commented on code in PR #55238:
URL: https://github.com/apache/spark/pull/55238#discussion_r3049250544


##########
build/sbt-launch-lib.bash:
##########
@@ -182,6 +183,18 @@ run() {
   set -- "${residual_args[@]}"
   argumentCount=$#
 
+  # If MAVEN_MIRROR_URL is set, generate a repositories config so the SBT 
launcher
+  # resolves SBT and Scala through the mirror during the boot phase.
+  if [[ -n "$MAVEN_MIRROR_URL" ]]; then
+    local sbt_repo_config="$(mktemp /tmp/sbt-repositories.XXXXXX)"

Review Comment:
   The SBT bootstrap phase only downloads SBT itself and Scala — a single 
mirror should be sufficient for that. This is just to make `MAVEN_MIRROR_URL` 
work end-to-end consistently with the existing support in `pom.xml` and 
`SparkBuild.scala`.
   
   For more complex multi-repo setups, users can still configure 
`~/.sbt/repositories` or `-Dsbt.repository.config` directly.



##########
build/sbt-launch-lib.bash:
##########
@@ -182,6 +183,18 @@ run() {
   set -- "${residual_args[@]}"
   argumentCount=$#
 
+  # If MAVEN_MIRROR_URL is set, generate a repositories config so the SBT 
launcher
+  # resolves SBT and Scala through the mirror during the boot phase.
+  if [[ -n "$MAVEN_MIRROR_URL" ]]; then
+    local sbt_repo_config="$(mktemp /tmp/sbt-repositories.XXXXXX)"
+    cat > "$sbt_repo_config" <<EOF
+[repositories]
+  local
+  maven-mirror: ${MAVEN_MIRROR_URL}
+EOF
+    addJava "-Dsbt.repository.config=$sbt_repo_config"

Review Comment:
   Good points. I'll add a guard to skip if `-Dsbt.repository.config` is 
already in `SBT_OPTS`, and add a trap to clean up the temp file.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to