cloud-fan opened a new pull request, #55564:
URL: https://github.com/apache/spark/pull/55564

   ### What changes were proposed in this pull request?
   
   Followup to https://github.com/apache/spark/pull/55218.
   
   When `createJarWithScalaSources` (introduced in #55218) is invoked in a 
process whose `java.class.path` is a single "pathing JAR" — a JAR with no class 
entries whose manifest `Class-Path` attribute lists the real dependencies — 
`scala.tools.nsc.Main` does not resolve the manifest entries. The compiler 
therefore cannot see `scala-library.jar`, and compilation fails with `object 
scala in compiler mirror not found`.
   
   This PR adds an `expandManifestClasspath` helper that detects such JARs and 
resolves their manifest `Class-Path` entries (relative to the JAR's parent 
directory) before passing the classpath to scalac.
   
   ### Why are the changes needed?
   
   Pathing JARs are commonly emitted to work around platform-specific 
command-line length limits — most notably on Windows, where CMD's command-line 
limit forces tools to produce a single classpath JAR rather than a long `-cp` 
string. Some build/CI tooling does the same. Without this fix, 
`createJarWithScalaSources` is silently broken in those environments, even 
though a regular file-listing classpath continues to work.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No. Only test-utility code is affected.
   
   ### How was this patch tested?
   
   Verified that `createJarWithScalaSources` still succeeds with a normal 
classpath, and now also succeeds when invoked with a classpath consisting of a 
single pathing JAR whose manifest `Class-Path` lists the real dependencies. The 
expansion is a no-op for non-JAR URLs and for JARs that have no manifest 
`Class-Path` attribute, so the existing OSS test paths are unaffected.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Opus 4.7
   


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