-
-
Notifications
You must be signed in to change notification settings - Fork 808
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
Graal support - reflection and runtime loading #777
Comments
Probably the target milestone is no longer valid. Do you mind changing it or removing it altogether? |
I abuse the field to note the report version. Sorry for the confusion. |
Hi Rafael, I was also looking for a similar solution, as we are having a lot of Mockito tests that we are trying to run with Graal's new JUnit native support. Mockito uses ByteBuddy to generate classes at runtime. So, I found this issue here. Investigating further, I saw that dynamic class loading is a PR in the Graal project that has recently been merged: So maybe, ByteBuddy can leverage the upcoming functionality of Graal to realize this feature. What do you think? |
Interesting. This would require that the default naming strategy is deterministic what is certainly possible, but it would likely also require reflection to work but this should be picked up by the agent. I will certainly look into this! |
Byte Buddy can now kind of work with this, as long as class names are deterministic. There are still some rough edges but we are moving forward, at least! |
@raphw Pretty awesome to see this working out of the box if collecting predefined classes using an agent run 🎉 Though, I noticed predefined classes are not collected if the dynamic type is loaded using |
This would be a bug in Graal if so. Byte Buddy only adjiusts its default class naming strategy to work with the Graal agent out of the box. It's Graal that is responsible of collecting class files. |
Thanks @raphw! In deed, classes injected into the system class loader are skipped (oracle/graal#4248). Unfortunately, that's what will typically happen when defining a class using a lookup :/ |
Add support for running Byte Buddy on Graal native image by offering a runtime mode where generated classes are cached in a location and retreived in a different runtime mode such that no runtime code generation needs to take place.
The final API should ideally not require any changes to make it automatically applicable for any Byte Buddy user, direct or indirect.
Also, files for required reflection should be added as a convenience to support the runtime.
The text was updated successfully, but these errors were encountered: