-
Notifications
You must be signed in to change notification settings - Fork 183
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
handle non ascii classpath with system classloader #1226
Conversation
I'm not sure what the deal is with the remaining failed tests. Is there something additional that needs to be done to get the new java test classes into the test runner? |
I will give it a look though it is looking like Wednesday at best. Lost 16 hours to a network problem 4 days before my critical project demo. So I have a heavy workload this weekend. |
I wish you best of strength and endurance, and of course a good demo! I will have a look as wel. Maybe we can sort this out already. |
@astrelsky I turned on trace logging of all JVM subsystems and stumbled upon this one: It is also confusing that a semicolon is used as path separator on Linux, right? It should be a colon! |
Oh, that's interesting. I'll take a quick look maybe it's something stupid |
@marscher I think I know what happened, thank you! I must have copied the classpath from the But now, how could the mac tests have passed? As far as I know windows is the outlier and the only one that uses |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1226 +/- ##
==========================================
+ Coverage 87.17% 87.18% +0.01%
==========================================
Files 113 113
Lines 10267 10287 +20
Branches 4045 4045
==========================================
+ Hits 8950 8969 +19
- Misses 725 726 +1
Partials 592 592 ☔ View full report in Codecov by Sentry. |
Maybe the mac did something clever - I cannot tell, dont use that stuff. Thanks for fixing it! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall I like the changes. If we don't care about the behavior of a service then I woudl approve.
If we do care about the minor differences between before and after the JVM is started, then we would need to find the appropriate test case.
My vote would be to skip it for now and wait for a user report. We are definitely better having some support, and we can add the rest once someone locates the problematic test case.
elif supportLib.isascii(): | ||
# ok, setup the jpype system classloader and add to the path after startup | ||
# this guarentees all classes have the same permissions as they did in the past | ||
extra_jvm_args += [ | ||
'-Djava.system.class.loader=org.jpype.classloader.JpypeSystemClassLoader', | ||
'-Djava.class.path=%s'%supportLib | ||
] | ||
jvmargs = _removeClassPath(jvmargs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we pass the class path as a different variable and then use it. The issue I am concerned about is that of those jars that specify a service.
https://medium.com/@yureshcs/services-and-service-provider-with-java-9-modules-ddd0170749b0
In that past when we did testing is was clear that services were only recognized if they were loaded on the initial class_path. I believe it is the case for certain things like databases. Unfortunately, it was a while since I last looked at the issue so I don't have a working test case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we pass the class path as a different variable and then use it. The issue I am concerned about is that of those jars that specify a service.
https://medium.com/@yureshcs/services-and-service-provider-with-java-9-modules-ddd0170749b0
In that past when we did testing is was clear that services were only recognized if they were loaded on the initial class_path. I believe it is the case for certain things like databases. Unfortunately, it was a while since I last looked at the issue so I don't have a working test case.
They are still loaded on the initial classpath (loaded by the system class loader). I can figure out how to put together a service and add a test case for it tomorrow.
Services are loaded and instantiated lazily. So as long as the paths are added to the system classpath before returning from startJVM, before the user can do anything, then we should be ok.
Is this ready to go? |
Yes. Services work as expected so I think everything is good if you don't have any other objections. I thought I had left a comment after I made the test but it looks like I didn't. I happened to find a simple test case for a service. |
Thanks for the hard work on this. I will trigger test and release scripts in my next open session. |
Sounds good, thank you. |
Sure I see no reason to exclude it. |
fixes #1194 fixes #1222
Note that the encoding problem appears to effect anything that isn't ascii. I tested the
ParseUtil
with theunicode_à😎
right in Java code (utf-8) and it didn't encode the url correctly.