HyukjinKwon opened a new pull request, #57106:
URL: https://github.com/apache/spark/pull/57106

   ### What changes were proposed in this pull request?
   
   `build/mvn`'s `install_mvn` prints `"Falling back to archive.apache.org to 
download Maven"` to **stdout** when the primary Maven mirror is unreachable, 
unlike every other diagnostic echo in the script which goes to stderr (`1>&2`). 
This redirects that message (and two adjacent error/checksum messages) to 
stderr.
   
   ### Why are the changes needed?
   
   Several scripts capture `build/mvn` stdout to read a value, e.g. 
`dev/test-dependencies.sh`:
   
   ```
   GUAVA_VERSION=$(build/mvn help:evaluate -Dexpression=guava.version -q 
-DforceStdout | grep -E "^[0-9.]+$")
   ```
   
   When the mirror `curl --head` check fails during the one-time Maven 
bootstrap, the fallback line lands on stdout and is captured together with (or 
instead of) the intended value. A downstream capture then resolves to the word 
`Falling`, producing failures like:
   
   ```
   [ERROR] ... The following artifacts could not be resolved:
   commons-cli:commons-cli:jar:Falling (absent): Could not find artifact
   commons-cli:commons-cli:jar:Falling in gcs-maven-central-mirror ...
   ```
   
   observed intermittently on scheduled `build_main` runs. It is intermittent 
because the fallback only triggers when the primary mirror momentarily fails 
the check. Sending the message to stderr keeps it visible in logs without 
polluting stdout captures.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No. Build-tooling only.
   
   ### How was this patch tested?
   
   Reproduced the capture corruption with a minimal harness: with the echo on 
stdout, a `$(...)` capture returns `"Falling back ...\n<value>"`; with `1>&2` 
the capture returns only `<value>` while the message still prints to stderr. 
`bash -n build/mvn` passes.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Opus 4.8)
   


-- 
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