bazelbuild / rules_groovy

Groovy rules for Bazel
Apache License 2.0
11 stars 28 forks source link

Handle long Java classpaths. #65

Open brown opened 1 year ago

brown commented 1 year ago

The groovyc command requires that the Java classpath be specified as one argument, which does not work for long classpaths, since Linux limits the length of any one command argument to 131072 characters. Work around the problem by creating symlinks with short names to classpath jars and using the symlinks instead of the original jar file name paths.

brown commented 1 year ago

This pull request should fix issue https://github.com/bazelbuild/rules_groovy/issues/64

hvadehra commented 1 year ago

This feels like an overly complicated workaround.

I have no experience with groovy so this might be totally off, but from https://docs.groovy-lang.org/latest/html/documentation/tools-groovyc.html it appears to support @argfile arguments? If that's the case, it might be better to write the classpath to a file and pass it in that way.

Looking at groovy.bzl, there is already code that is doing the same thing in the last step where the output classes are passed to the zip tool.