Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
File path canonicalization still broken inside jars on Windows #4692
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.
On Linux with JRuby 220.127.116.11:
On Windows with JRuby 18.104.22.168:
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...
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.
added a commit
Sep 6, 2017
@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?