anb0s / eclox

Eclox is a simple doxygen frontend plug-in for eclipse. It aims to provide a slim and sleek integration of the code documentation process into Eclipse.
http://anb0s.github.io/eclox
Eclipse Public License 2.0
34 stars 2 forks source link

Doxygen Build Console: stderr and stdin are not synchronized #201

Closed anb0s closed 7 years ago

anb0s commented 7 years ago

related to #195

lordyavin commented 7 years ago

In eclox.core.doxygen.Doxygen.build you use ProcessBuilder.redirectErrorStream to merge stdout and stderr. This way you have no control over the output lines if the external process doesn't sync its output. It looks like that ProcessBuilder does not take care about that issue.

To work around that issue the client software needs to implement the synchronization by itself or handle the streams separately. So don't use redirectErrorStream. Read the error stream directly and use just this output to parse for warnings and errors. The output of stdout can be used for progress messages. May be you can drop the console at all. Just an idea.

Update: Tried to test my idea, but I need maven to build the plug-ins right? Could you provide a short "how to build"?

anb0s commented 7 years ago

I've created wiki site: https://github.com/anb0s/eclox/wiki/How-to-build

Please check "Running and debugging in Eclipse" if want try it in eclipse first and "Building eclox plugin with update site for testing" if want to build it with maven + tycho and install...

Any enhancements or questeions to the wiki page are welcome :)

anb0s commented 7 years ago

Yes, i think you right :)

In the eclox.core.doxygen.Doxygen.BuildJob.run() the streams are handled independently:

// stdin and stderr
MyLogFeeder inputLogFeeder = new MyLogFeeder(buildProcess.getInputStream());
Thread  inputLogThread  = new Thread(inputLogFeeder);
MyLogFeeder errorLogFeeder = new MyLogFeeder(buildProcess.getErrorStream());
Thread  errorLogThread  = new Thread(errorLogFeeder);

but in the eclox.core.doxygen.Doxygen.build() i've changed to ProcessBuilder in versions 0.11.x and made this mistake: pb.redirectErrorStream(true);

lordyavin commented 7 years ago

Looks like you nailed it. So no need for me to contribute :(

anb0s commented 7 years ago

Thanks for reporting the bug and pointing in the code 👍

It would be good if you can verify it, because i cannot reproduce this here with my doxyfiles at Windows and Linux. Also it would be good to know if my wiki description is clear :) So please contribute if you want!

lordyavin commented 7 years ago

Had a quick look into the how-to. You wrote "switch to master branch". Is it a good idea to tell conrtibutors to work on the master branch?

To test if the bug is fixed for my machine at work (where the problem occurred) you have to provide me a build. I can't setup the build env here.

anb0s commented 7 years ago

For a pull request contributors have to fork the project at GitHub and they can work at master, because master is the working branch for me. But you are right i will write that they have to created sub-branch from master for a fix.

anb0s commented 7 years ago

Wiki updated...

anb0s commented 7 years ago

fixed for 0.12.0

anb0s commented 7 years ago

please check out the testing build --> #202 comment and reopen if still not solved Thanks!

lordyavin commented 7 years ago

Issue seams to be fixed for me. No overlapping output anymore. But the console lists output after the "finished..." information of Doxygen. That is somehow irritating.

anb0s commented 7 years ago

Issue seams to be fixed for me. No overlapping output anymore.

Thanks for the feedback :+1: Then it looks good now.

But the console lists output after the "finished..." information of Doxygen. That is somehow irritating.

Yes, i see it too during my builds. The stdin and stderr are handled in two not depended threads and it looks like the stderr steam is catched later by JVM... i've no idea how to fix yet...

lordyavin commented 7 years ago

Don't use two Threads. One should be sufficient.