You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes the list of command-line options passed to Scaladoc is very large (especially w/ generating combined Scaladocs, with many dependencies). This is due to the need to pass many classpath locations and source file locations in large build graphs. There is a practical limit to the size of a commandline string, and it can sometimes surpass that. When it's too long, it will fail to run the task, but not produce an error.
For example, I have a target which I'd like to generate Scaladocs for, which generated a 1MB string for the commandline. This is too large, even though it's a valid target/Scaladoc task.
There are two ways to fix:
Output the options into a text file, then pass this as an "options file" to Scaladoc. I tried this by modifying Pant's code locally to test, and it worked well. Generated a 1MB text file which Scaldoc had no problem loading as options, and it successfully built the Scaladoc for this large graph.
Per recommendation from @stuhood, run via Nailgun (e.g. change the base class to NailgunTask instead of JvmTask). This resolves by passing the command directly to Nailgun instead of going through a subprocess, which should allow larger option sets. Converting to this base class requires broader changes, and touches doc.javadoc as well. This is a little beyond me in terms of my familiarity w/ Pants code.
I will file a PR for the first option, as a less-than-ideal "broken->working" fix for this issue, but another ticket should probably be made for migrating to a Nailgun task to go from "ok->good" in terms of implementation quality.
The text was updated successfully, but these errors were encountered:
Sometimes the list of command-line options passed to Scaladoc is very large (especially w/ generating combined Scaladocs, with many dependencies). This is due to the need to pass many classpath locations and source file locations in large build graphs. There is a practical limit to the size of a commandline string, and it can sometimes surpass that. When it's too long, it will fail to run the task, but not produce an error.
For example, I have a target which I'd like to generate Scaladocs for, which generated a 1MB string for the commandline. This is too large, even though it's a valid target/Scaladoc task.
There are two ways to fix:
Output the options into a text file, then pass this as an "options file" to Scaladoc. I tried this by modifying Pant's code locally to test, and it worked well. Generated a 1MB text file which Scaldoc had no problem loading as options, and it successfully built the Scaladoc for this large graph.
Per recommendation from @stuhood, run via Nailgun (e.g. change the base class to
NailgunTask
instead ofJvmTask
). This resolves by passing the command directly to Nailgun instead of going through a subprocess, which should allow larger option sets. Converting to this base class requires broader changes, and touchesdoc.javadoc
as well. This is a little beyond me in terms of my familiarity w/ Pants code.I will file a PR for the first option, as a less-than-ideal "broken->working" fix for this issue, but another ticket should probably be made for migrating to a Nailgun task to go from "ok->good" in terms of implementation quality.
The text was updated successfully, but these errors were encountered: