Open hakonhagland opened 3 years ago
The crucial bit is here:
Symbolic links are supported.
Checking how to test for symbolic links...
/usr/bin/ln: failed to create symbolic link 'sym': No such file or directory
Your builtin 'test -h' may be broken.
Trying external '/usr/bin/test -h'.
External '/usr/bin/test -h' is broken, too.
I do not know how you can test for symbolic links.
On an OS with symbolic links, it's apparently assuming there is a way to check for them, but somehow test -h
fails.
Then it later fails with an invalid shell command because $issymlink
isn't set. Possibly that should be set to false
(the executable) if it can't be found?
Some more information: According to this blog symlinks are available on MSYS2 if you are running Windows 10 Creators Update or above and have enabled "Developer mode" in the Windows "Settings" app. Which are is the case for my machine. In this case symlinks are “emulated” by copying files and directories unless you set the enviroment variable MSYS to winsymlinks:nativestrict
, which I have done by editing the file C:\msys64\home\hakon\.bashrc
and appending the line export MSYS=winsymlinks:nativestrict
.
I tested ln -s
and it worked as expected for the cases I tried, except for creating a broken symlink (which works fine on Linux) but errors on MSYS2, e.g. if foo.txt
does not exist, this command fails on MSYS2:
$ ln -s foo.txt bar.txt
ln: failed to create symbolic link 'bar.txt': No such file or directory
It seems like test -h
works fine in the MSYS2 terminal window:
$ touch a.txt
$ ln -s a.txt b.txt
$ test -h b.txt && echo ok
ok
$ test -h a.txt && echo ok
[no output]
I tested ln -s and it worked as expected for the cases I tried, except for creating a broken symlink (which works fine on Linux) but errors on MSYS2, e.g. if foo.txt does not exist, this command fails on MSYS2:
I think this is the problem, on line 2845 it tries to create a broken symlink:
$lns blurfl sym
This fails on MSYS2. I made a quick fix by adding the following code on the line before the test:
if $test "X$unameosname" = XMsys ; then
# MSYS2 cannot create broken symlinks, so we need make sure blurfl exists
$touch blurfl
fi
and I set the $unameosname
before using
if uname --help >/dev/null 2>&1; then
unameosname=`uname -o`
fi
After this change to Configure
, I reran and it worked fine:
$ sh Configure -de
Beginning of configuration questions for perl5.
Checking echo to see how to suppress newlines...
...using -n.
The star should be here-->*
First let's make sure your kit is complete. Checking...
Looks good...
Would you like to see the instructions? [n]
[...]
Symbolic links are supported.
Checking how to test for symbolic links...
You can test for symbolic links with 'test -h'.
Checking for cross-compile
No targethost for running compiler tests against defined, running locally
[...]
Doing variable substitutions on .SH files...
Extracting config.h (with variable substitutions)
cflags.SH: Adding -Werror=pointer-arith.
cflags.SH: Adding -Wextra.
cflags.SH: Adding -Wc++-compat.
cflags.SH: Adding -Wwrite-strings.
cflags.SH: Adding -Werror=declaration-after-statement.
cflags.SH: cc = cc
cflags.SH: ccflags = -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -D_FORTIFY_SOURCE=2
cflags.SH: stdflags =
cflags.SH: optimize = -O
cflags.SH: warn = -Wall -Werror=pointer-arith -Wextra -Wc++-compat -Wwrite-strings -Werror=declaration-after-statement
Extracting cflags (with variable substitutions)
Not re-extracting config.h
Extracting makedepend (with variable substitutions)
Extracting Makefile (with variable substitutions)
Extracting myconfig (with variable substitutions)
Extracting pod/Makefile (with variable substitutions)
Extracting Policy.sh (with variable substitutions)
Extracting runtests (with variable substitutions)
Configure done.
If you compile perl5 on a different machine or from a different object
directory, copy the Policy.sh file from this object directory to the
new one before you run Configure -- this will help you with most of
the policy defaults.
I am trying to install a debug version of
perl
5.32.0 on Windows 10, using MSYS2.More detailed system information: