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

IntelliJ: BUGFIX: Fix launcher script execution #10228

Merged
merged 4 commits into from
Mar 23, 2024

Conversation

cyrusbuilt
Copy link
Contributor

Observation: When launching IntelliJ, "idea.sh" appears in the DeskBar. The 'bash' process executes and immediately pegs a core at 100%, and remains that way indefinitely. The JVM never executes and therefore, IntelliJ never launches.

Manually executing the launcher script ('idea.sh') from the Terminal succeeds. It appears (as discussed with @augiedoggie) the launcher script doesn't like being executed via a symlink in Tracker/DeskBar.

This PR modifies the execution to launch background which seems to work fine. This same issue also applies to PyCharm (I intend to open a separate PR for that). This is not an ideal solution, but is at least one that seems to work fine. Certainly open to suggestions if anyone has a better idea.

@cyrusbuilt cyrusbuilt changed the title Cb/idea community fix launcher IntelliJ: Fix launcher Mar 17, 2024
@cyrusbuilt cyrusbuilt changed the title IntelliJ: Fix launcher IntelliJ: BUGFIX: Fix launcher script execution Mar 17, 2024
@korli
Copy link
Contributor

korli commented Mar 17, 2024

This rings a bell, but can't remember where/when.
I see in ancestris the following is used:
exec \$(dirname \$(readlink -f \$0))/bin/ancestris

@cyrusbuilt
Copy link
Contributor Author

@korli I'll try that

@cyrusbuilt
Copy link
Contributor Author

cyrusbuilt commented Mar 18, 2024

@korli I tried this and honestly expected it to work. I can't see any reason why it wouldn't. However, it doesn't actually launch. Not sure what is happening, but with this change what I see happening now is basicallly nothing. It no longer launches a bash process which pegs a core at 100%, it just seems like it immediately terminates instead. I tried the following:

exec \$(dirname \$(readlink -f \$0))/bin/idea.sh

Which doesn't seem to work. So I added the following just above that line for debug purposes which of course had no effect, but I then ran it from the terminal to see if any errors were being generated (or a bad path):

set -x
echo \$(dirname \$(readlink -f \$0))/bin/idea.sh

And the output was:

Welcome to the Haiku shell.

+ export PATH=/packages/openjdk17-17.0.7.3-2/.self/lib/openjdk17/bin:.:/boot/home/config/non-packaged/bin:/boot/home/config/bin:/boot/system/non-packaged/bin:/bin:/boot/system/apps:/boot/system/preferences
+ PATH=/packages/openjdk17-17.0.7.3-2/.self/lib/openjdk17/bin:.:/boot/home/config/non-packaged/bin:/boot/home/config/bin:/boot/system/non-packaged/bin:/bin:/boot/system/apps:/boot/system/preferences
+++ readlink -f ./idea.sh
++ dirname /boot/system/apps/idea/idea.sh
+ echo /boot/system/apps/idea/bin/idea.sh
/boot/system/apps/idea/bin/idea.sh
+++ readlink -f ./idea.sh
++ dirname /boot/system/apps/idea/idea.sh
+ exec /boot/system/apps/idea/bin/idea.sh

The rest is output from the JVM as the app launches. The background exec method is still working. But for reasons I don't understand, this method is not. Thoughts?

@korli
Copy link
Contributor

korli commented Mar 19, 2024

I've no better idea than your fix ATM.

@cyrusbuilt
Copy link
Contributor Author

@korli Fair enough. I discarded my changes and I'll leave this PR as-is. This same fix is working for PyCharm too, so I'll get a PR opened for that shortly. Thanks!

@Begasus
Copy link
Contributor

Begasus commented Mar 22, 2024

Newer version is available according to Repology, 2023.3.6, maybe bump it while you are at it? :)

@cyrusbuilt
Copy link
Contributor Author

@Begasus I'll certainly give it a shot!

@cyrusbuilt
Copy link
Contributor Author

@Begasus Done. Works well so far!

@Begasus Begasus merged commit 032a0b9 into haikuports:master Mar 23, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants