Hello David,
I tried to enable the symlinks by the following edits :
1) uncomment set MSYS=winsymlinks:nativestrict from msys2_shell.cmd
2) Follow instructions in
https://github.com/git-for-windows/git/wiki/Symbolic-Links to that
extent
``Launch gpedit.msc, navigate to Computer configuration - Windows
Setting - Security Settings - Local Policies - User Rights Assignment
and add the account(s) to the list named Create symbolic links.''. Of
course I launched gpedit.msc as Administrator to do that.
3) modify msys2_shell.cmd so that the terminal is opened with UAC
elevation : in a nutshell, when MSYS2 has winsymlinks:nativestrict,
instead of using ``start'' internal command to launch the terminal,
it launches a VBscript that instantiate a Shell.Application COM to
launch the terminal with "runas" operation, ie UAC elevation while
keeping the same user.
When I do these 3 things, I observe the following things:
1) First there seems to be something broken in the environment
inheritance. I inherit my MSWindows PATH variable, it is not replaced
by the MSYS2 default one, and if I close all the bash terminals and
comment again set MSYS=winsymlinks:nativestrict, that does not solve
this. It is quite annoying, because diff and find utils are no longer
found at the correct place.
2) Second, the terminal window size and font size are no longer the last
one used, but the system default --- no surprise about that, I need
to make my VBScript launcher a little more elaborated.
3) Third, and that is the point, ln -s does not work as expected if it
was doing real symlinks. It is still faking. If I launch this script
(I need the full path for diff.exe because of issue #1):
--8<----8<----8<----8<----8<-- begin -->8---->8---->8---->8---->8----
#! /usr/bin/bash
cd /tmp
file1=$(mktemp ./test_symlinks.XXXXXXXXXX)
echo "A first content" > $file1
file2=$(mktemp ./test_symlinks.XXXXXXXXXX)
rm -f $file2
ln -s $file1 $(basename $file2)
echo "A second content" >> $file1
echo "== Here is file1 ===="
cat $file1
echo "====================="
echo "== Here is file2 ===="
cat $file2
echo "====================="
if /c/Nos_Programmes/msys64/usr/bin/diff.exe -q -s $file1 $file2; then
echo "Symlinks are working well";
else
echo "Symlinks DON'T work";
fi
# un peu de ménage
rm -f $file1 $file2
--8<----8<----8<----8<----8<-- end -->8---->8---->8---->8---->8----
then I get this output:
--8<----8<----8<----8<----8<-- begin -->8---->8---->8---->8---->8----
== Here is file1 ====
A first content
A second content
=====================
== Here is file2 ====
A first content
=====================
Files ./test_symlinks.nBMZiODcch and ./test_symlinks.AECWQriGFm differ
Symlinks DON'T work
--8<----8<----8<----8<----8<-- end -->8---->8---->8---->8---->8----
However, there seems to be a change with the ln -s ../* . test. For
remainder this test is as follows:
--8<----8<----8<----8<----8<-- begin -->8---->8---->8---->8---->8----
#! /bin/bash
mkdir foo
cd foo
echo "Hello" > bar
mkdir gnats
cd gnats
ln -s ../* .
--8<----8<----8<----8<----8<-- end -->8---->8---->8---->8---->8----
Before uncommenting the `set MSYS=winsymlinks:nativestrict' line, I
got an error telling something like "too long path" which is
consistent with doing infinite loop copies recursively. Now, I get
this error:
--8<----8<----8<----8<----8<-- begin -->8---->8---->8---->8---->8----
ln -s ../* .
/bin/ln: creating symbolic link `./gnats' to `../gnats': No such file or
directory
--8<----8<----8<----8<----8<-- end -->8---->8---->8---->8---->8----
Vincent.
Le 11/08/2017 à 13:13, Vincent Belaïche a écrit :
Le 11/08/2017 à 10:26, David Macek a écrit :
On 9. 8. 2017 16:29, Vincent Belaïche wrote:
Le 09/08/2017 à 15:38, David Macek a écrit :
On 9. 8. 2017 15:34, Vincent Belaïche wrote:
The symlink emulation could keep track of all elements already
copied once, and every time it is inspecting a new element to be
copied, it would cancel the copy if the element has already been
copied. This would break this infinite loop stuff (otherwise it
breaks only when the path length exceed the maximum allowed).
That doesn't help much IMO. The copy (the fake symlink) is not
complete, so it's still a failure.
I think it would be useful however. If you do :
mkdir gnats; cd gnats; ln -s ../* .; cd ..; zip -r gnats.zip gnats
then the gnats.zip compressed archive would be the same if
pseudo-symlinks are created in the way which I propose as if real
symlinks were created. Therefore, if you keep pseud-symlinks as they
are, the outcome is farther away from what you get with real symlink
than which the fix which I propose.
I'm not able to confirm. When ran the commands on Linux, I ended up
with a ZIP archive with lots of nested gnats directories. If we were
to break recursions on MSYS2 as you propose, the archive would have
just 1 level of nesting.
I must admit that my statement was probably incorrect. After checking
it, the example I had in mind actually list explicitly all the files
to be zipped rather than just give the directory name.
Vincent.
---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel
antivirus Avast.
https://www.avast.com/antivirus
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Msys2-users mailing list
Msys2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/msys2-users