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
(SystemCallError) Unknown error 123 - FindFirstFile with AsciidoctorJ on Win10 #3957
Win 10, Java 1.8.0_65, JRuby 18.104.22.168
When trying to render this document AsciidoctorJ should produce a PDF document and it does on OSX.
Create this document named
Download AsciidoctorJ 1.6.0-alpha.3 from http://jcenter.bintray.com/org/asciidoctor/asciidoctorj/1.6.0-alpha.3/:asciidoctorj-1.6.0-alpha.3-bin.zip, unpack it and invoke
On Win10 this fails with this exception:
Side note: I actually wanted to report an error that the build of AsciidoctorJ does not pass on Win10 because the source highlighter rouge cannot be found. Therefore I wanted to see if I also have this problem with the packaged version of AsciidoctorJ, but it turns out I don't even get that far.
referenced this issue
Jun 7, 2016
I see the same problem on Win7 with:
Note: JRuby-complete rather than JRuby. Using JRuby I don't get this far and get a different error:
@robertpanzer I guess 123 is an invalid name error on windows: http://forums.codeguru.com/showthread.php?116333-FindFirstFile-fails-for-wildcard-characters-in-the-path
The file it is tripping on is our symlink? checking code (which is required for newer version of rubygems). If you can provide some reproduction I can try it locally and track down the file. If you want to try and narrow down the file it is tripping on you can add a puts to gems/prawn-1.3.0/lib/prawn.rb before line 15 and see what it is calling symlink on.
@idc101 your problem is completely unrelated to this one. You can open a new issue for it. It sort of looks like an environment issue since it is saying you cannot load FFI (which is how we call native methods below Java/Ruby).
@enebo I added a
Please note that all gems are installed and then packaged into jars during the build of AsciidoctorJ.
If you want to reproduce you can download the distribution of AsciidoctorJ (had the link already in the issue description above), create a file
and then invoke
This is a possible patch. I don't have Windows handy to test at the moment.
diff --git a/core/src/main/ruby/jruby/kernel/file.rb b/core/src/main/ruby/jruby/kernel/file.rb index 4b58a6e..3a93a2d 100644 --- a/core/src/main/ruby/jruby/kernel/file.rb +++ b/core/src/main/ruby/jruby/kernel/file.rb @@ -118,7 +118,12 @@ if org.jruby.platform.Platform::IS_WINDOWS return false unless File.exist?(file) bool = false - wfile = string_check(file).wincode + checked = string_check(file) + + return false if checked =~ /^(classpath:)|(classloader:)|(uri:classloader)|(jar:)/ + checked.slice!(5..-1) if checked =~ /^file:/ + + wfile = checked.wincode attrib = GetFileAttributesW(wfile)
I believe this is caused by having prawn bundled into the JRuby app and run from the classloader. It attempts to determine if one of its own files is a symlink, which blow sup when trying to test classloader resources. This patch short-circuits all in-jar URL forms as always being "false" and strips off any
Sure, what's the best way for me to test the patch?
On Tuesday, 23 August 2016, Charles Oliver Nutter <email@example.com
@dzwicker can you open up a new issue and paste in the stack trace you see. We have 2 in this issue and I would like to capture this as a regression issue (assuming it is and not something else throwing the same error perhaps we missed?). I do know there is another issue involving classpath: paths, but more info the better.