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

bugfix: Try and fix issue with Base64 reflection #1775

Merged
merged 1 commit into from
Aug 10, 2022

Conversation

@tgodzik
Copy link
Contributor Author

tgodzik commented Aug 5, 2022

Anyone willing to test it out on windows? Otherwise I can do that probably next week and run a new release.

@tgodzik
Copy link
Contributor Author

tgodzik commented Aug 9, 2022

I tried releasing it locally on Windows, but it seems a bottomless rabbit hole :/

Try is a simple instruction:
gu.cmd install native-image which should install native-image.cmd in the same folder, but it doesn't!

Spent an hour trying to google/fix that, but to no avail. I found native-image.exe, is that the same thing? It's in a totally different folder, but maybe it does work?

Then it started failing with not finding cl.exe, which needed Visual Studio being installed (!!!) and it still didn't help.

I think we will check this when the release runs :/

@tgodzik tgodzik requested review from adpi2 and ckipp01 August 9, 2022 17:20
@ckipp01
Copy link
Member

ckipp01 commented Aug 9, 2022

I honestly know nothing about what this is doing. Do you have any links or reference to what these are?

@tgodzik
Copy link
Contributor Author

tgodzik commented Aug 9, 2022

There is a bit more here: https://www.graalvm.org/22.1/reference-manual/native-image/Reflection/

But I ma kind of guessing here and copying from dev-dirs, which seems to have that setting

Copy link
Member

@adpi2 adpi2 left a comment

Choose a reason for hiding this comment

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

Ok, so this dirs-dev library tries to load java.util.Base64
by reflection here and to call getEncoder which probably returns a java.util.Base64$Encoder.

I wonder if we should also declare sun.misc.BASE64Encoder here. Probably not if we compile with Java 11 or greater.

I cannot test this change now but it seems perfectly legitimate to me.

@tgodzik
Copy link
Contributor Author

tgodzik commented Aug 10, 2022

Ok, so this dirs-dev library tries to load java.util.Base64 by reflection here and to call getEncoder which probably returns a java.util.Base64$Encoder.

I wonder if we should also declare sun.misc.BASE64Encoder here. Probably not if we compile with Java 11 or greater.

I cannot test this change now but it seems perfectly legitimate to me.

I will try and build it on CI, might be possible to download it and test on windows.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@tgodzik
Copy link
Contributor Author

tgodzik commented Aug 10, 2022

I will try and build it on CI, might be possible to download it and test on windows.

That actually worked! 🎉

Copy link
Member

@ckipp01 ckipp01 left a comment

Choose a reason for hiding this comment

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

Alrighty, finally read through the link. Thanks! From what I can tell, yea this makes sense. LGTM

@tgodzik tgodzik merged commit 7ff5368 into scalacenter:main Aug 10, 2022
@tgodzik tgodzik deleted the fix-base64 branch August 10, 2022 15:05
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.

RuntimeException: Could not find any viable Base64 encoder
3 participants