Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc.scaladoc is failing silently when command-line options list is too long. #7435

Closed
thoward opened this issue Mar 25, 2019 · 2 comments
Closed

Comments

@thoward
Copy link
Contributor

thoward commented Mar 25, 2019

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:

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

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

@stuhood
Copy link
Sponsor Member

stuhood commented Mar 25, 2019

Thank you @thoward ! That sounds great.

@Eric-Arellano
Copy link
Contributor

Closing because the JVM backend was removed in Pants 2.0 and will be rebuilt from the ground up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants