Skip to content

Conversation

@cloud-fan
Copy link
Contributor

@cloud-fan cloud-fan commented Dec 25, 2025

What changes were proposed in this pull request?

People may use sbt and maven together: local test with sbt, IDE with Maven. As of today this will trigger duplicated class issue during compilation, because sbt and Maven use different output folder for generated proto/antlr java classes. This PR updates the sbt build to use the same folder as Maven for proto/antlr output.

Why are the changes needed?

Improve dev experience.

Does this PR introduce any user-facing change?

No

How was this patch tested?

Manual test

Was this patch authored or co-authored using generative AI tooling?

cursor 2.2.43

@github-actions github-actions bot added the BUILD label Dec 25, 2025
@cloud-fan
Copy link
Contributor Author

cc @pan3793 @HyukjinKwon

@cloud-fan cloud-fan changed the title [SPARK-54847][SQL] unify the proto output folder between sbt and maven [SPARK-54847][SQL] unify the proto/antlr output folder between sbt and maven Dec 25, 2025
Copy link
Member

@pan3793 pan3793 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, this does fix the issue about maven/sbt mix-used cases!

the only left noisy is my IDEA still seems not to correctly recognize classes overridden in spark-connect-shims, thus can not jump code from IDEA

Image

.sbtopts Outdated
@@ -0,0 +1,3 @@
-J-Xmx4g
-J-Xms4g
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to make the build more stable, avoid OOM

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR unifies the output directories for generated sources (protobuf and ANTLR4) between sbt and Maven builds to prevent duplicate class issues when developers use both build systems (e.g., local testing with sbt and IDE with Maven).

  • Updates sbt build configuration to use Maven's default output directories for generated sources
  • Adds .sbtopts file to configure JVM memory settings for sbt

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
project/SparkBuild.scala Updates output directories for protobuf (Core, SQL, SparkConnectCommon modules) and ANTLR4 (SqlApi module) generated sources to match Maven's default paths
.sbtopts Adds new sbt configuration file with JVM memory settings (4GB Xmx/Xms, 1GB MaxMetaspaceSize)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cloud-fan
Copy link
Contributor Author

cloud-fan commented Dec 27, 2025

the last commit simply updates .sbtopts, and the second last commit passed all unit tests. I'm merging it to master/4.1, as it doesn't affect any production code (we use maven to build release), thanks for the review!

@cloud-fan cloud-fan changed the title [SPARK-54847][SQL] unify the proto/antlr output folder between sbt and maven [SPARK-54847][BUILD] unify the proto/antlr output folder between sbt and maven Dec 27, 2025
@cloud-fan cloud-fan closed this in 174b62d Dec 27, 2025
cloud-fan added a commit that referenced this pull request Dec 27, 2025
…and maven

### What changes were proposed in this pull request?

People may use sbt and maven together: local test with sbt, IDE with Maven. As of today this will trigger duplicated class issue during compilation, because sbt and Maven use different output folder for generated proto/antlr java classes. This PR updates the sbt build to use the same folder as Maven for proto/antlr output.

### Why are the changes needed?

Improve dev experience.

### Does this PR introduce _any_ user-facing change?

No

### How was this patch tested?

Manual test

### Was this patch authored or co-authored using generative AI tooling?

cursor 2.2.43

Closes #53616 from cloud-fan/shim.

Lead-authored-by: Wenchen Fan <[email protected]>
Co-authored-by: Wenchen Fan <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
(cherry picked from commit 174b62d)
Signed-off-by: Wenchen Fan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants