Sodium

Sodium

44M Downloads

Another mod applying an AccessWidener to a Sodium @Overwrite'd method causes startup crash

unascribed opened this issue ยท 1 comments

commented

Reproduction Steps

  1. Install any mod that uses an AccessWidener on a method that Sodium @Overwrites. (Such as my own Fabrication prior to v1.2.6)
  2. Try to launch the game.
  3. Fail.

Crash Report File

https://gist.github.com/unascribed/6f2274e193de6675fe42d4909ec61326

Additional Information

This can be fixed by telling Mixin to be less strict about access in @Overwrites by adding the following to sodium.mixins.json (This is how I currently fix it and is how I've recommended others fix it):

"overwrites": {
  "conformVisibility": true
}

This however will still log a warning, and I'm unsure if I'd consider this a "true" fix. I also am unsure if I'd consider this Sodium's "fault"; the alternative on my end is to use MethodHandles. Even if that is the "true" fix, I figured I should bring it up here because I don't believe this will be an isolated incident. (Discovered #385, this is not an isolated incident.)

Related: FalsehoodMC/Fabrication#30 (though I've known about this for a while longer than this issue's reporting)


I see #385 exists, but there is no mention of the conformVisibility fix/workaround, and the response suggests it is thought there is nothing that can be done about it on Sodium's side. I discovered it via digging in Mixin; it's not documented as far as I know. (Though, about 60% of Mixin isn't documented, so who's surprised.)

I will accept a closed issue and punt back to my side and use MethodHandles. Wanted to send over what I knew.

commented

I did not know this workaround existed, thanks for bringing it up. As you mention, this won't really fix the problem, but continuing on with a loud warning should be fine. These method visibility conflicts are not very frequent, and I don't really expect us to encounter runtime errors after enabling this for those few cases. It should be fine to enable on Sodium's side.