[SPARK-56364][BUILD][TESTS][FOLLOWUP] Expand pathing JARs in createJarWithScalaSources#55564
Closed
cloud-fan wants to merge 1 commit into
Closed
[SPARK-56364][BUILD][TESTS][FOLLOWUP] Expand pathing JARs in createJarWithScalaSources#55564cloud-fan wants to merge 1 commit into
cloud-fan wants to merge 1 commit into
Conversation
…rWithScalaSources Followup to apache#55218. When createJarWithScalaSources 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 and the compiler cannot see scala-library.jar, failing with 'object scala in compiler mirror not found'. Pathing JARs are emitted to work around platform-specific command-line length limits, most notably on Windows. Add an expandManifestClasspath helper that detects such JARs and resolves their manifest Class-Path entries before passing the classpath to scalac.
Contributor
Author
HyukjinKwon
approved these changes
Apr 27, 2026
Contributor
Author
|
thanks for the review, merging to master! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Followup to #55218.
When
createJarWithScalaSources(introduced in #55218) is invoked in a process whosejava.class.pathis a single "pathing JAR" — a JAR with no class entries whose manifestClass-Pathattribute lists the real dependencies —scala.tools.nsc.Maindoes not resolve the manifest entries. The compiler therefore cannot seescala-library.jar, and compilation fails withobject scala in compiler mirror not found.This PR adds an
expandManifestClasspathhelper that detects such JARs and resolves their manifestClass-Pathentries (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
-cpstring. Some build/CI tooling does the same. Without this fix,createJarWithScalaSourcesis 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
createJarWithScalaSourcesstill succeeds with a normal classpath, and now also succeeds when invoked with a classpath consisting of a single pathing JAR whose manifestClass-Pathlists the real dependencies. The expansion is a no-op for non-JAR URLs and for JARs that have no manifestClass-Pathattribute, 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