Actually no, wait.  I changed the pom as you described but I think the build is 
still using the old plexus version.
Is there a way to be sure?

-----Original Message-----
From: mark.yagnatin...@barclays.com.INVALID 
<mark.yagnatin...@barclays.com.INVALID> 
Sent: Saturday, December 23, 2023 1:51 PM
To: users@maven.apache.org
Subject: RE: Why does Plexus Compiler parse compiler output, when forked? (was: 
maven debugging frustrations)


CAUTION: This email originated from outside our organisation - 
mark.yagnatin...@barclays.com.INVALID Do not click on links, open attachments, 
or respond unless you recognize the sender and can validate the content is safe.
Also: just tested with your new and improved version.
To speed up the build failures I gave it even less heap (just one meg).
It doesn't seem to help; all I get is "compilation failure"
And thanks for putting up with my attitude; I'll try to do better.

-----Original Message-----
From: Yagnatinsky, Mark : Markets Pre Trade 
Sent: Saturday, December 23, 2023 12:50 PM
To: Maven Users List <users@maven.apache.org>
Subject: RE: Why does Plexus Compiler parse compiler output, when forked? (was: 
maven debugging frustrations)

Okay you win, stack trace below.  My bad, sorry, I should know better.
Also, thanks for explaining the parsing picture: that's not how I expected it 
to work at all!
I never thought maven expected this much structure from the compiler messages. 

The system is out of resources.
Consult the following stack trace for details.
java.lang.OutOfMemoryError: GC overhead limit exceeded
        at com.sun.tools.javac.util.List.of(List.java:135)
        at com.sun.tools.javac.util.ListBuffer.append(ListBuffer.java:129)
        at 
com.sun.tools.javac.parser.JavacParser.variableDeclaratorsRest(JavacParser.java:3006)
        at 
com.sun.tools.javac.parser.JavacParser.classOrInterfaceBodyDeclaration(JavacParser.java:3537)
        at 
com.sun.tools.javac.parser.JavacParser.classOrInterfaceBody(JavacParser.java:3436)
        at 
com.sun.tools.javac.parser.JavacParser.classDeclaration(JavacParser.java:3285)
        at 
com.sun.tools.javac.parser.JavacParser.classOrInterfaceOrEnumDeclaration(JavacParser.java:3226)
        at 
com.sun.tools.javac.parser.JavacParser.typeDeclaration(JavacParser.java:3215)
        at 
com.sun.tools.javac.parser.JavacParser.parseCompilationUnit(JavacParser.java:3155)
        at com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:628)
        at com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:665)
        at 
com.sun.tools.javac.main.JavaCompiler.parseFiles(JavaCompiler.java:950)
        at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:857)
        at com.sun.tools.javac.main.Main.compile(Main.java:523)
        at com.sun.tools.javac.main.Main.compile(Main.java:381)
        at com.sun.tools.javac.main.Main.compile(Main.java:370)
        at com.sun.tools.javac.main.Main.compile(Main.java:361)
        at com.sun.tools.javac.Main.compile(Main.java:56)
        at com.sun.tools.javac.Main.main(Main.java:42)

-----Original Message-----
From: Alexander Kriegisch <alexan...@kriegisch.name> 
Sent: Saturday, December 23, 2023 3:03 AM
To: users@maven.apache.org
Subject: Why does Plexus Compiler parse compiler output, when forked? (was: 
maven debugging frustrations)


CAUTION: This email originated from outside our organisation - 
alexan...@kriegisch.name Do not click on links, open attachments, or respond 
unless you recognize the sender and can validate the content is safe.
> There's nothing that special about MY stack trace... just run javac on 
> a largish module with a tiny heap.

Well, that is an abstract description, and instead of just sending one or two 
stack traces, now you are burdening me with trying to reproduce your problem 
without a reproducer. Do you think, that makes sense or is particularly nice? I 
just wanted *any* example stack trace for this error.

> In the meantime, I have a question. Why is maven in the business of 
> trying to "parse" the output of javac? Why can't it give me its output 
> verbatim, as if javac were a mysterious black box binary blob with 
> totally unknown behaviour?

That is actually a good question. I was wondering about the same thing, too. 
Let me remind you, I am not a maintainer or even have commit rights on Plexus 
Compiler. I am a simple user, just like you, and last week contributes a little 
patch for the very first time. The patch improved something, it was not a 
rewrite.

Basically, all Plexus compilers (Javac, C#, AspectJ, Eclipse Java) implement 
the same Compiler interface and even extend from the same AbstractCompiler base 
class. No matter if they compile in process or out of process, they are calle 
by Maven Compiler via interface method

CompilerResult Compiler.performCompile(CompilerConfiguration)
  throws CompilerException

I.e., they have to return a CompilerResult,and that one e.g. has a

List<CompilerMessage> getCompilerMessages()

method. I.e., Maven Compiler does not expect a dump of output and error streams 
and a single result OK or failed, but a list of error messagesof different 
kinds, such as errors, warnings, infos etc. When compiling out of process 
(fork=true) instead of Java tools interface, the compiler output must be 
parsed, which is a rather crude and imperfect heuristic approach. Actually, it 
is amazing that it works as good as it does at all. Simply running the forked 
compiler VM with a non-English locale can make the difference between an error 
correctly identified or not, because since at least JDK 8, there are 3 locales, 
since JDK 21 4 locales in OpenJDK.

I do not want to elaborate any further - you get the picture.

That in some cases, especially when the build fails for any reason, the error 
message is not parsed out correctly, is exactly what needs improvement and what 
was partly addressed by my patch, at least if a stack trace happens to be part 
of the compiler output.

Cheers
--
Alexander Kriegisch
https://clicktime.symantec.com/15t5ejaoBdG3n3Nk8C4vS?h=lY-QL6rWusTeyzIz0RujRgAvrvPPWo66hf-ZSgB36q4=&u=https://clicktime.symantec.com/15siQqyagwqo7rpNW8hag?h=Xfl1MqtFlU0HUFmEgS0_Xdgtd6szG1OqcZz6i8fSR2E=&u=https://scrum-master.de


mark.yagnatin...@barclays.com.INVALID schrieb am 23.12.2023 10:40 (GMT +07:00):

> There's nothing that special about MY stack trace... just run javac on a
> largish module with a tiny heap.
> (Our module was huge enough to fail with 800 megs, but there are plenty 
> modules
> that will fail with 8 megs, let alone one meg.)
> Further, the exact stack trace is very sensitive to the exact amount of heap I
> give it; I tried varying it and it fails in totally different places.
> In fact, depending on the exact heap size, sometimes the stack trace doesn't 
> go
> all the way back to main() and other times it does.
> I have no idea how to explain that last part... maybe depth is limited??
> I will try this again with new and improved plexus version and report back.
> In the meantime, I have a question.  Why is maven in the business of trying to
> "parse" the output of javac?
> Why can't it give me its output verbatim, as if javac were a mysterious black
> box binary blob with totally unknown behaviour?
> 
> -----Original Message-----
> From: Alexander Kriegisch <alexan...@kriegisch.name> 
> Sent: Friday, December 22, 2023 10:23 PM
> To: users@maven.apache.org
> Subject: Re: maven debugging frustrations
> 
> 
> CAUTION: This email originated from outside our organisation -
> alexan...@kriegisch.name Do not click on links, open attachments, or respond
> unless you recognize the sender and can validate the content is safe.
>>> How can I can find out EXACTLY how maven invoked javac, so I can 
>>> invoke it the same way?
> 
> I think, somebody already mentioned earlier that you can just activate debug
> output in Maven. Then search for the line following "Command line
> options":
> 
> $ mvn -X compile | grep --after-context 1 'Command line options'
> 
> [DEBUG] Command line options:
> [DEBUG] -d ...\target\classes -classpath ...
> src\main\java\org\example\Main.java -s ... -processor ... -g -target 1.8
> -source 1.8 -encoding UTF-8
> 
> Copy everything from the last line agter "[DEBUG] " and paste it right behind
> "javac ". That should be your exact command.
> 
>> Okay, I think I got it.  Here is the error I get when running with  
>> -J-Xmx800
>>
>> <snip warnings about using internal APIs> The system is out of 
>> resources.
>> Consult the following stack trace for details.
>> java.lang.OutOfMemoryError: GC overhead limit exceeded <snip long 
>> stack trace from the depths of javac>
> 
> Sorry to bother you again, but two more requests:
> 
>   1. Can you please paste more of the stack trace? That would make for a
>      good (as in realistic) unit or integration test.
> 
>   2. I think, my PR in the recently released Plexus Compiler 2.14.2
>      should at least enable you to get the stack trace printed. The two
>      header lines beginning with "The system is out of resources"
>      probably will be cut off. Anyway, that would be better than
>      nothing. Can you please retest? In Maven, that would go like this
>      (fragmentary POM):
> 
> <properties>
>   <plexusCompilerVersion>2.14.2</plexusCompilerVersion>
> </properties>
> 
> <plugin>
>   <groupId>org.apache.maven.plugins</groupId>
>   <artifactId>maven-compiler-plugin</artifactId>
>   <version>3.12.0</version>
>   <dependencies>
>     <dependency>
>       <groupId>org.codehaus.plexus</groupId>
>       <artifactId>plexus-compiler-api</artifactId>
>       <version>${plexusCompilerVersion}</version>
>     </dependency>
>     <dependency>
>       <groupId>org.codehaus.plexus</groupId>
>       <artifactId>plexus-compiler-manager</artifactId>
>       <version>${plexusCompilerVersion}</version>
>     </dependency>
>     <dependency>
>       <groupId>org.codehaus.plexus</groupId>
>       <artifactId>plexus-compiler-javac</artifactId>
>       <version>${plexusCompilerVersion}</version>
>       <scope>runtime</scope>
>     </dependency>
>   </dependencies>
> </plugin>
> 
> --
> Alexander Kriegisch
> https://clicktime.symantec.com/15siL1nJELAChuzSxaJS4?h=nzpjga3_SLSLrs5JaJ3OiaZifiLqcf_nkIhMPiTjhQ4=&u=https://clicktime.symantec.com/15siFBaoYbM4wmfMjZKMr?h%3DisWwo2pYTjyI3SuGICAE9ZFT6R_DSWTZSKkBbg1NX0E%3D%26u%3Dhttps://clicktime.symantec.com/15t5ejaoBdG3n3Nk8C4vS?h%3DlY-QL6rWusTeyzIz0RujRgAvrvPPWo66hf-ZSgB36q4%3D%26u%3Dhttps://scrum-master.de
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
> 
> 
> This message is for information purposes only. It is not a recommendation,
> advice, offer or solicitation to buy or sell a product or service, nor an
> official confirmation of any transaction. It is directed at persons who are
> professionals and is intended for the recipient(s) only. It is not directed at
> retail customers. This message is subject to the terms at:
> https://clicktime.symantec.com/15t64tZDUhg1qmWMqz4fY?h=xQz5jFfHOpTwgvomCCOKiUOghFNoKoT-k2ij7fprQZo=&u=https://clicktime.symantec.com/15sipzwzz2FmBawzDvhKn?h=HpsFM7c82XUjXE_RGYhCNWR1Uqj-TXWgdqMoOkXcW10=&u=https://www.cib.barclays/disclosures/web-and-email-disclaimer.html.
>  
> 
> For important disclosures, please see:
> https://clicktime.symantec.com/15t5z4Mw25zRRpgSJRfWv?h=CuC3-L57ZWBl-bFOridRR-v_htBUveAVT2oFXLDyBBo=&u=https://clicktime.symantec.com/15sikAkiXQaAme84gNJBA?h=-BcjeOTSLHBOJ_Nv0gsPFuc8b07t6SD26uViyjvO8Zw=&u=https://www.cib.barclays/disclosures/sales-and-trading-disclaimer.html
> regarding marketing commentary from Barclays Sales and/or Trading desks, who
> are active market participants;
> https://clicktime.symantec.com/15t5jZn5eEweBzCffkU54?h=9tEpCyq0ayl9xwFLaJtiszVHnyT6Ln6Fr4kFI_vkmss=&u=https://clicktime.symantec.com/15siVgAs9ZXPXoeJ3h6jJ?h=qjEhvjxVlwv9PzaJC7BbC0Toe6zX1cZGlPVPfjyyUl0=&u=https://www.cib.barclays/disclosures/barclays-global-markets-disclosures.html
> regarding our standard terms for Barclays Corporate and Investment Bank where
> we trade with you in principal-to-principal wholesale markets transactions; 
> and
> in respect to Barclays Research, including disclosures relating to specific
> issuers, see: 
> https://clicktime.symantec.com/15t5ZuPWj1aTN6Ypadfmp?h=lQBXfcQrYNBladUaOqeg9VI44VBdfVZNfC0hpARg4v4=&u=https://clicktime.symantec.com/15siFBb1miUcHyAXR1uHS?h=6qkne1UkNxWPpvNGnSvxQG2xDqwDfghLsCyyO05u31w=&u=http://publicresearch.barclays.com.
> __________________________________________________________________________________
> 
> If you are incorporated or operating in Australia, read these important
> disclosures:
> https://clicktime.symantec.com/15t5pPyN6rdEbw2bDJsDg?h=uysNfMEe75RdcM2d4XzbbO3G4cbCuG9XmN9u4rVSels=&u=https://clicktime.symantec.com/15siaWN9cBCywkUDbFVsv?h=XUTACoSNPdwkLE7BhDArD3o0KyCOvEypokyEWAwYpqg=&u=https://www.cib.barclays/disclosures/important-disclosures-asia-pacific.html.
> __________________________________________________________________________________
> For more details about how we use personal information, see our privacy 
> notice:
> https://clicktime.symantec.com/15t5uEAeZUJq1srWksGNJ?h=xxFgXFXqBddyzfoD9p38VoTH0R51ogdjQuaVVkvmdgU=&u=https://clicktime.symantec.com/15sifLZS4ntaMhJ98ou2Y?h=r1QxyNG6BKPZq-VKxnm4SVYzr86NimGQy7HSha-p2Rs=&u=https://www.cib.barclays/disclosures/personal-information-use.html.
>  
> __________________________________________________________________________________
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org


This message is for information purposes only. It is not a recommendation, 
advice, offer or solicitation to buy or sell a product or service, nor an 
official confirmation of any transaction. It is directed at persons who are 
professionals and is intended for the recipient(s) only. It is not directed at 
retail customers. This message is subject to the terms at: 
https://clicktime.symantec.com/15sipzwzz2FmBawzDvhKn?h=HpsFM7c82XUjXE_RGYhCNWR1Uqj-TXWgdqMoOkXcW10=&u=https://www.cib.barclays/disclosures/web-and-email-disclaimer.html.
 

For important disclosures, please see: 
https://clicktime.symantec.com/15sikAkiXQaAme84gNJBA?h=-BcjeOTSLHBOJ_Nv0gsPFuc8b07t6SD26uViyjvO8Zw=&u=https://www.cib.barclays/disclosures/sales-and-trading-disclaimer.html
 regarding marketing commentary from Barclays Sales and/or Trading desks, who 
are active market participants; 
https://clicktime.symantec.com/15siVgAs9ZXPXoeJ3h6jJ?h=qjEhvjxVlwv9PzaJC7BbC0Toe6zX1cZGlPVPfjyyUl0=&u=https://www.cib.barclays/disclosures/barclays-global-markets-disclosures.html
 regarding our standard terms for Barclays Corporate and Investment Bank where 
we trade with you in principal-to-principal wholesale markets transactions; and 
in respect to Barclays Research, including disclosures relating to specific 
issuers, see: 
https://clicktime.symantec.com/15siFBb1miUcHyAXR1uHS?h=6qkne1UkNxWPpvNGnSvxQG2xDqwDfghLsCyyO05u31w=&u=http://publicresearch.barclays.com.
__________________________________________________________________________________
 
If you are incorporated or operating in Australia, read these important 
disclosures: 
https://clicktime.symantec.com/15siaWN9cBCywkUDbFVsv?h=XUTACoSNPdwkLE7BhDArD3o0KyCOvEypokyEWAwYpqg=&u=https://www.cib.barclays/disclosures/important-disclosures-asia-pacific.html.
__________________________________________________________________________________
For more details about how we use personal information, see our privacy notice: 
https://clicktime.symantec.com/15sifLZS4ntaMhJ98ou2Y?h=r1QxyNG6BKPZq-VKxnm4SVYzr86NimGQy7HSha-p2Rs=&u=https://www.cib.barclays/disclosures/personal-information-use.html.
 
__________________________________________________________________________________

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

This message is for information purposes only. It is not a recommendation, 
advice, offer or solicitation to buy or sell a product or service, nor an 
official confirmation of any transaction. It is directed at persons who are 
professionals and is intended for the recipient(s) only. It is not directed at 
retail customers. This message is subject to the terms at: 
https://www.cib.barclays/disclosures/web-and-email-disclaimer.html. 

For important disclosures, please see: 
https://www.cib.barclays/disclosures/sales-and-trading-disclaimer.html 
regarding marketing commentary from Barclays Sales and/or Trading desks, who 
are active market participants; 
https://www.cib.barclays/disclosures/barclays-global-markets-disclosures.html 
regarding our standard terms for Barclays Corporate and Investment Bank where 
we trade with you in principal-to-principal wholesale markets transactions; and 
in respect to Barclays Research, including disclosures relating to specific 
issuers, see: http://publicresearch.barclays.com.
__________________________________________________________________________________
 
If you are incorporated or operating in Australia, read these important 
disclosures: 
https://www.cib.barclays/disclosures/important-disclosures-asia-pacific.html.
__________________________________________________________________________________
For more details about how we use personal information, see our privacy notice: 
https://www.cib.barclays/disclosures/personal-information-use.html. 
__________________________________________________________________________________

Reply via email to