-
-
Notifications
You must be signed in to change notification settings - Fork 922
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
Cannot resolve or detect symlinks on Windows #3287
Comments
Article on links for windows as a note when we try and figure this out: http://www.sevenforums.com/tutorials/278262-mklink-create-use-links-windows.html. This will get fixed upstream in jnr/jnr-posix to get fixed in jruby proper. |
Does this work in MRI? I thought I might find that they had shimmed out a win32 version of readlink, but it appears they simply raise NotImplementedError when readlink is not present on the given system. We could do that too; perhaps gollum checks if it's supported before trying to use it? |
I went ahead and "fixed" this the same way MRI does, by marking @techwiz24 Tonight's nightly builds of 1.7.23 and 9.0.2.0 will have this fix...perhaps you can check whether it's working? I suspect gollum checks for readlink or perhaps it should. If you believe we should actually support readlink, we'll need to have that conversation with ruby-core too. |
@headius Thank you for looking into this. For the specific test that was failing, this is what gollum looks for: # Return the file path to this file on disk, if available.
#
# Returns nil if the file isn't available on disk. This can occur if the
# repo is bare, if the commit isn't the HEAD, or if there are problems
# resolving symbolic links.
def get_disk_reference(name, commit)
return false if @wiki.repo.bare
return false if commit.sha != @wiki.repo.head.commit.sha
# This will try to resolve symbolic links, as well
pathname = Pathname.new(::File.expand_path(::File.join(@wiki.repo.path, '..', name)))
if pathname.symlink?
source = ::File.readlink(pathname.to_path)
realpath = ::File.join(::File.dirname(pathname.to_path), source)
return false unless realpath && ::File.exist?(realpath)
@on_disk_path = realpath.to_s
else
@on_disk_path = pathname.to_path
end
true
end I believe what you're saying is that we'll have to wrap |
Thank you @headius , appreciate your time and effort! Another way to go might be to rely on |
Necroposting apart, it could good for reader coming from Google search.
I imagine you meant: Concerning the support in "native" |
Thanks @Wadeck for sharing this info! |
While doing some testing for running gollum under windows I discovered that JRuby under windows appears to lack support for resolving symlinks. From gollum/gollum#1044:
It doesn't seem that
Pathname
can detect windows symlinks. For this test, I have created the following:C:\SymlinkTest\a.txt
C:\SymlinkTest\b.txt
=> softlink toC:\SymlinkTest\a.txt
(mklink C:\SymlinkTest\b.txt C:\SymlinkTest\a.txt
)C:\SymlinkTest\c.txt
=> hardlink toC:\SymlinkTest\a.txt
(fsutil hardlink create C:\SymlinkTest\b.txt C:\SymlinkTest\a.txt
)The text was updated successfully, but these errors were encountered: