-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Java 18 - do not set SecurityManager if unsupported #5107
Java 18 - do not set SecurityManager if unsupported #5107
Conversation
…ns running under Java 18 and above" This reverts commit ca91326.
@BenjaminAmos do I need #5109 to be able to test this to support newer Java, or how did you do it locally? |
It looks like I might have increased the gradle version to 7.2 locally. I forgot about that. #5109 should make this work as well. |
I tried to test this with #5109 and Java 20 (since I cannot find a Java 18 or 19 via SDKMan), but then I run into the issue that Kotlin and Java 20 don't get along yet 🙈 Why can't things be easy 🙄 I suspect this to just work, and will give it another try running the game with Java 11 - if that still works, I guess we can merge and move forward to sort out Gradle, Java, and Kotlin versions along the path. 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, did not test with Java 18 or higher due to the issues with Gradle, but the game still starts up fine 👍
kotlin-1.9.0 is released: https://kotlinlang.org/docs/whatsnew19.html which supports java-20, gradle-8.1 supports gradle as well, but cannot run itself yet with java-20. |
@skaldarnar @jdrueckert you want to merge this one please? it prints a warning what parameter to use, which will be valid for java-21 as well, so sufficient for a couple of years. here some details on why security manager got removed, and how otherwise to address it (attention, they try to sell you snyk...) some key parts extracted:
from oracles secure coding guidelines:
|
@BenjaminAmos @jdrueckert @skaldarnar java-21 is out, tested if it still is good, and it is. can we please merge this? |
I think this just got overlooked. It happens sometimes. I'm not able to merge this until the tests pass (this one specifically), even if I wanted to. I might have to rebase these changes to force a tests re-run so that GitHub makes it mergable again. The changes should not affect normal execution before Java 18, so I think I could merge it safely. |
i cannot see the failing test link, is it because i am not project member? |
Hey @soloturn - interestingly it does look like if I load the PR in an incognito browser I can't see the checks on the main PR page, I have to go to the checks page (https://github.com/MovingBlocks/Terasology/pull/5107/checks) to find them. Huh! I had no idea. That's pretty weird. It looks like this to a maintainer (in dark mode anyway): I just tried adding you to a "Contributors" team we used to add everybody who contributed to - started doing that years ago before GitHub made some further UI tweaks. Does that let you see the thing in the screenshot? If not maybe it needs a push-access team or so. Let me see if a rebuild in Jenkins will help, our CI was a little erratic for a while but should be better now. The branch may still need a quick update sometime. |
After the rebuild it looks a bit different, but that may again be more about the CI infrastructure changes. Checking Jenkins directly only shows one failing test, however: https://jenkins.terasology.io/job/Terasology/job/engine/view/change-requests/job/PR-5107/1/testReport/junit/org.terasology.engine.integrationenvironment/ExampleTest/Integration_Tests___testClientConnection__/ Being that it is "ExampleTest" I'm not too worried about it, the latest build from Still curious if you can see the check results now on the main PR page @soloturn :-) The change itself looks reasonable despite the area of security historically having been a bit of a can of worms to deal with. But yeah if this doesn't affect anything below Java 18 it sounds safe enough 👍 |
now i can see the test result here: https://jenkins.terasology.io/job/Terasology/job/engine/job/develop/3/testReport/junit/org.terasology.engine.integrationenvironment/ExampleTest/Integration_Tests___testClientConnection__/ with the stack trace and error message: |
Contains
This pull request reverts ca91326 and re-implements it properly using a runtime check. It ensures that the game does not set a custom
SecurityManager
when running on Java 18 or above.How to test