-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
File path canonicalization still broken inside jars on Windows #4692
Comments
Should probably tag @kares |
@presidentbeef, have you tried with 9.1.12.0? This worked for me. |
9.1.12.0 has the same behavior. |
@presidentbeef can you try latest on jruby-9.1.13 branch? @kares added some logic which should work a week or two ago and it did not get associated with this issue. |
Ah I knew I had downloaded your test repo but now running it I can see require_relative is broken still although I think @kares patch did fix a good chunk of the issues around the fakepath part of it all. So here is a smaller repro: relative_arg = "lib/test"
dir = "classpath:/"
p File.expand_path(relative_arg, dir) This prints out
The C: should not be there... |
Thanks for checking @enebo. |
Ok fixed the letter and now I see this:
GRRRRRRR, :) |
Yay...so FILE is correct but File.realpath is swapping the / to \. So a second weird behavior. @presidentbeef Is the reason for doing this to potentially elide stuff like '..' or '.'. I don't think classpath uris can actually have softlinks. With that said it no classpath: uri should ever get converted to back slashes. So it should just get fixed. |
Our app does have a lot of uses of |
…indows This fixed two things in expandPathInternal which displayed differences in File.expand_path, and File.realpath. The fixes themselves are pretty gorey but since they are limited to classpath uris and only on windows I see no risk. We really really need to rewrite expandPathInternal...
@presidentbeef yeah I think you should not need to be concerned with whether you are calling with real filesystem paths or a classpath uri. I just wondered if you were using it for '..'. I am pushing a fix here. I would love it if you could try your product on jruby-9.1 branch and see if it is golden now? |
9.1.13.0 works!! Thank you @enebo 😄 |
Despite #4647 and earlier patches, this issue persists.
As previously, please see https://github.com/presidentbeef/jruby-realpath-error and the simple reproduction steps therein.
I hate to keep mentioning this, but due to this issue we are still stuck releasing on JRuby 1.7.
Expected Behavior
On Linux with JRuby 9.1.11.0:
Actual Behavior
On Windows with JRuby 9.1.11.0:
The text was updated successfully, but these errors were encountered: