Skip to content

Fix deprecation warnings at startup caused by sun.misc.Unsafe usage - #14350

Open
Warriorrrr wants to merge 5 commits into
PaperMC:mainfrom
Warriorrrr:fix/unsafe-startup-warn
Open

Warriorrrr wants to merge 5 commits into
PaperMC:mainfrom
Warriorrrr:fix/unsafe-startup-warn

Conversation

@Warriorrrr

@Warriorrrr Warriorrrr commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Fixes a warning during startup caused by joml, as of joml 1.10.9 it's able to use the newer unsafe provided that you add the jvm arg or manifest attribute that gives it access to it.

One downside is that fixing this warning just makes it show up later but for spark's protobuf library instead, supposedly that lib also has a new update that fixes it but I've so far been unsuccessful in seeing that. spark's latest version resolves this

Also moves the Enable-Native-Access attribute that was previously being configured in paperweight to paper itself, this is mainly used for jline but maybe also some other things.

@Warriorrrr
Warriorrrr requested a review from a team as a code owner October 5, 2026 07:02
@masmc05

masmc05 commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

supposedly that lib also has a new update that fixes it but I've so far been unsuccessful in seeing that.

That's due to the fact that the fix is in the standard edition, while spark uses android one where andoid jvm wouldn't follow the unsafe removal roadmap as per the internal-then-mirrored protocolbuffers/protobuf@1eafbde

@SirYwell

SirYwell commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Is it also possible to disable use of Unsafe completely? Opting into the internal one that is more likely to break somehow doesn't feel like a good thing.

@Warriorrrr
Warriorrrr requested a review from a team as a code owner October 5, 2026 15:15
@Warriorrrr

Copy link
Copy Markdown
Member Author

Is it also possible to disable use of Unsafe completely? Opting into the internal one that is more likely to break somehow doesn't feel like a good thing.

Sure, I've added the flag in the way originally suggested when this was still a paperweight pr PaperMC/paperweight#395 (comment)

@Warriorrrr

Warriorrrr commented Oct 5, 2026 •

Copy link
Copy Markdown
Member Author

That's due to the fact that the fix is in the standard edition, while spark uses android one where andoid jvm wouldn't follow the unsafe removal roadmap as per the internal-then-mirrored protocolbuffers/protobuf@1eafbde

This was pretty helpful, using the regular protobuf-java artifact fixed it, passed it onto luck

@Warriorrrr

Copy link
Copy Markdown
Member Author

This now also includes a spark version bump to resolve the final warning

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Delayed approval

Development

Successfully merging this pull request may close these issues.

5 participants