Open Angular-Angel opened 2 years ago
@Angular-Angel I've had a look, the runOsgi
task is not working anymore since the Gradle upgrade even on MacOS (where I develop). I tried for several hours to make it work again but Gradle seems to be doing something that makes it impossible to run any interactive command at all.
I am open to suggestions, as everything I tried failed.
My attempts:
new ProcessBuilder().inheritIO()...
(doesn't actually inherit either stdin or stdout)JavaExec
setting standardInput
to System.in
- I couldn't figure out why the process errors no matter what I tried as it doesn't show the reason why it errors.I think the reason for this is that Gradle starts a daemon to run the build, and it's impossible to inherit IO from a daemon as the daemon is not a child process, it's a remote process.
I tried to get rid of the daemon with --no-daemon
, but Gradle insists in forking a JVM to run the build anyway, which causes the same problem as the forked JVM is not inheriting IO either, as it seems.
See this discussion on the ineffectiveness of --no-daemon
.
I think I will remove this task from the plugin, unfortunately. It seems to me that having Gradle allow this is a losing battle. Using the launcher script that createOsgi
creates is about as easy anyway... do you have a strong reason to prefer runOsgi
?
It's a lot easier in my IDE, just double-clicking a thing, vs opening a terminal and running two commands. I'd say leave it in, unless that requires a lot more work or something.
See if you can completely eliminate the Gradle daemon or even forking a new JVM, and I bet it will work again.
I don't even begin to know how to do that. :/
Actually, maybe what you want is some kind of fancy 'Connect Terminals' Command? That seems like it should be possible, but I have no idea how. :/
When I use the 'runOsgi' task, it gives me:
And then when I try the various commands in terminal, it doesn't seem to respond? But if I run 'stop 0' then a couple seconds later it will give some kind of error and shut down, so maybe it's getting the commands and responding to them, but just not giving me any output from them? :/
I found this other issue with the same error message, which was fixed by this commit, which updated the version of jline and added jansi, so maybe that's the issue? Though, I tried doing this on my end via adding those dependencies and it didn't change anything, even when I excluded any versions from osgi-run. :/
The text of that error I eventually get on telling it to 'exit' or 'stop 0':
This problem occurs both when running via netbeans, and when running via xfce4-terminal. When I run the 'createOsgi' task and then manually run via terminal as below, however, it does not have any problem creating a system terminal and I can use full functionality.