-
-
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
(SystemCallError) Unknown error 123 - FindFirstFile with AsciidoctorJ on Win10 #3957
Comments
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 |
As a workaround just commenting out the symlink call works in prawn.rb line 15:
|
Ok, looks like we need to short-circuit logic for |
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 |
@idc101 We are pushing 9.1.3.0 out very soon. If you can verify this patch works for you, we'd be willing to incorporate it into the release. Otherwise this will get bumped to 9.1.4.0. |
Sure, what's the best way for me to test the patch? On Tuesday, 23 August 2016, Charles Oliver Nutter <notifications@github.com
|
@idc101 Hopefully you can build JRuby...if not, have a look at BUILDING; it's pretty easy. Throw that patch above on your local copy and go for it. If it works, it works! |
Just retested building asciidoctorj-1.6.0 with a jruby 9.1.3.0-SNAPSHOT and it seems to work indeed! \o/ |
@robertpanzer Without any additional patching? Or with the patch I pasted above? |
Yes, without patching, totally forgot that and this test ran successfully. :) Having two other issues though, for which I will file new tickets: |
@robertpanzer If they are simple and you get them in extremely soon we might get the new ones for 9.1.3.0 but we need a release out soon. So the quicker you can report them the better. |
using 9.1.12.0 i hit this bug. using 9.1.3.0 fixed it. Is there a regression? |
@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. |
Just want to add that I downgraded to 9.1.8.0 for the AsciidoctorJ distribution as I also experienced this problem with 9.1.12.0 on Win10. |
I am wondering if #4543 caused this regression since it broke some other stuff on windows. |
Environment
Win 10, Java 1.8.0_65, JRuby 9.1.2.0
AsciidoctorJ 1.6.0-alpha.3 i.e. no gems installed but packaged in jars like:
Asciidoctor 1.5.5
Prawn 1.3.0
Expected Behavior
When trying to render this document AsciidoctorJ should produce a PDF document and it does on OSX.
Actual Behavior
Create this document named
test.adoc
: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
asciidoctorj -b pdf ..../test.adoc
.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.
The text was updated successfully, but these errors were encountered: