Skip to content

Apply Java version-specific flags in launcher script#8718

Merged
headius merged 1 commit intojruby:masterfrom
headius:unsafe_native_flags
Mar 26, 2025
Merged

Apply Java version-specific flags in launcher script#8718
headius merged 1 commit intojruby:masterfrom
headius:unsafe_native_flags

Conversation

@headius
Copy link
Member

@headius headius commented Mar 26, 2025

This adds flags for native access and unsafe memory functions and cleans up some of the launcher logic around Java version detection.

Relates to #8696.

@headius headius added this to the JRuby 10.0.0.0 milestone Mar 26, 2025
@headius headius requested a review from mrnoname1000 March 26, 2025 01:20
@headius headius force-pushed the unsafe_native_flags branch from 4000ee9 to 06f1ecb Compare March 26, 2025 01:30
Copy link
Contributor

@mrnoname1000 mrnoname1000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would avoid nesting so many conditionals, it's much more verbose and comparisons are cheap. We could use some other structure if we wanted to consolidate, but no matter what every check is going to happen on >=23 or <13 depending on which we check first

@headius
Copy link
Member Author

headius commented Mar 26, 2025

Perhaps it's just better to drop that commit then. It's not critical, and I don't like it as much as I thought.

Your point about doing all the checks anyway depending on how we search also makes sense.

@headius headius force-pushed the unsafe_native_flags branch from 06f1ecb to c0bfde9 Compare March 26, 2025 01:35
These flags are only available at certain levels of JDK, so we add
version-specific logic to the launcher.

See jruby#8696

This will fix that issue for 9.4 once we backport the script. It
fixes it for JRuby 10 right away.
@headius headius force-pushed the unsafe_native_flags branch from c0bfde9 to 8ff65f4 Compare March 26, 2025 01:37
Copy link
Contributor

@mrnoname1000 mrnoname1000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside from that duplicate comment looks good to me

@headius headius merged commit cd20147 into jruby:master Mar 26, 2025
55 of 72 checks passed
@headius headius deleted the unsafe_native_flags branch March 26, 2025 01:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants