facebookarchive / nailgun

Nailgun is a client, protocol, and server for running Java programs from the command line without incurring the JVM startup overhead.
https://github.com/facebook/nailgun
Other
731 stars 138 forks source link

NGServer or ng client changes path delimiters on output #156

Open angwe opened 6 years ago

angwe commented 6 years ago

When I run the epubcheck tool as a jar file through the java -jar command on an epub, the output for individual file errors inside the epub shows real path-delimited (slash, "/") output (epubs are just zip-packaged document structures) as /path/to/file.epub/path/inside/container/file.xhml, but when the jar file and accompanying libraries are loaded and launched in a nailgun server, the output from the ng replaces path-delimiters with dots as .path.to.file.epub.path.inside.container.file.xhml. I can't figure out why this is happening (I see nothing obvious in the communication or output wrappers), and would prefer to be able to turn this off. Our users are not always sophisticated enough to be able to notice which of those dots are dots and which should be slashes. It's also not universal to the output. If the error message that epubcheck returns has slashes in it (a DOCTYPE is wrong, for example), they remain in the output. Only the file/path related output gets changed.

Example:

[rd@biblio-dev5 ~]$ java -jar epubcheck.jar /path/to/9780472026715_EPUB.epub
Validating using EPUB version 2.0.1 rules.
ERROR(PKG-007): /path/to/9780472026715_EPUB.epub/mimetype(-1,-1): Mimetype file should only contain the string 'application/epub+zip' and should not be compressed.
ERROR(HTM-001): /path/to/9780472026715_EPUB.epub/OPS/package.opf(2,96): Any publication resource that is an XML-based media type must be a valid XML 1.0 document. XML version found: 1.1.

...

NGServer started in systemd with: /usr/bin/java -cp /path/to/nailgun-server-1.0.0-SNAPSHOT.jar:/path/to/epubcheck-4.0.2/epubcheck.jar:/path/to/epubcheck-4.0.2/lib/* com.facebook.nailgun.NGServer 127.0.0.1


[rd@biblio-dev5 ~]$ ng com.adobe.epubcheck.tool.Checker /path/to/9780472026715_EPUB.epub
Validating using EPUB version 2.0.1 rules.
ERROR(PKG-007): .path.to.9780472026715_EPUB.epub.mimetype(-1,-1): Mimetype file should only contain the string 'application/epub+zip' and should not be compressed.
ERROR(HTM-001): .path.to.9780472026715_EPUB.epub.OPS.package.opf(2,96): Any publication resource that is an XML-based media type must be a valid XML 1.0 document. XML version found: 1.1.

...

Is there a configuration that I need to set to avoid this? Am I overlooking something obvious?

sbalabanov-zz commented 6 years ago

There is no any setting that can result to this. I suggest if you set a breakpoint in NGOutputStream and debug.

angwe commented 6 years ago

Since I am not a Java or C programmer, I'll just leave this here as a bug report. Presumably this kind of output mangling could be more of an issue for someone else.