lstat() differs from stat() in how it handles symbolic links, the former
doesn't resolve the symlink while the latter does so.
Implement a simple yet effective fallback using Win32 APIs.
Fixes #14933
https://github.com/vim/vim/pull/15014
(3 files)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
@LemonBoy pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.
thank you! can we get a test please?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
@LemonBoy pushed 2 commits.
You are receiving this because you are subscribed to this thread.
@k-takata commented on this pull request.
In src/testdir/test_functions.vim:
> + silent !ln -s XglobBad DoesNotExist + silent !ln -s XglobOk Xglob1
It seems reversed:
⬇️ Suggested change- silent !ln -s XglobBad DoesNotExist - silent !ln -s XglobOk Xglob1 + silent !ln -s DoesNotExist XglobBad + silent !ln -s Xglob1 XglobOk
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
MinGW is now failing.
Maybe we should not fall back to _wstat()
in wstat_symlink_aware()
?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
Hmm, it's just MinGW being MinGW. ln -s
performs a full copy (!!!) unless you specify some flag and enable the Windows' developer mode. What shall we do here? Perhaps skipping the test on MinGW is an option here.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
If that is the case, I am fine with skipping. But I don't know how to detect that Vim is running in a Mingw/Msys environment.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
Try this:
k-takata@ce07a7a
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.
Moreover, how about merging mswin_lstat()
and wstat_symlink_aware()
into one function?
k-takata@b48ce1c
No need to skip the symlink test on MinGW.
Here are the results: https://github.com/k-takata/vim/actions/runs/9556704996
ln -s
performs a full copy (!!!)
It is not the reason why it failed on MinGW. has("win32")
is true on MinGW, so the symlinks are created by the mklink command.
If we want to test the MSYS version of Vim, we need to care about the ln -s
issue, but currently, we don't have MSYS tests.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.
To skip the test on MSYS, the check should be like this:
if has('win32unix') && executable('uname') && system('uname -s') =~ '^MSYS' throw 'Skipped: does not work on Msys' endif
Note that has('win32unix')
is used instead of has('win32')
because MSYS is a variant of Cygwin.
has('win32')
returns 0 on Cygwin/MSYS.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.
Moreover, how about merging mswin_lstat() and wstat_symlink_aware() into one function?
Good idea, merged!
It is not the reason why it failed on MinGW. has("win32") is true on MinGW, so the symlinks are created by the mklink command.
If we want to test the MSYS version of Vim, we need to care about the ln -s issue, but currently, we don't have MSYS tests.
Oh well, it seems that every Unix layer tries do do its own thing with symlinks. Let's forget about MSYS for the time being then.
To skip the test on MSYS, the check should be like this:
On my MSYS-compiled version (using Make_cyg_ming.mak
) the 'win32unix'
is not defined.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.
On my MSYS-compiled version (using
Make_cyg_ming.mak
) the'win32unix'
is not defined.
It is just a normal Win32 (or Win64) version of Vim. It should work as the same as MSVC-compiled version. (No need to care about MSYS-style symlinks.)
The MSYS version I meant was which was compiled by the MSYS version of GCC (/usr/bin/gcc
) using src/Makefile
.
Let's forget about MSYS for the time being then.
👍
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.
thanks, let me include it then!
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.