Windows Support: Fixup Perl build (#29711)

* Add pl2bat to PATH: Windows on Perl requires the script pl2bat.bat
  and Perl to be available to the installer via the PATH. The build
  and dependent environments of Perl on Windows have the install
  prefix bin added to the PATH.
* symlink with win32file module instead of using Executable to
  call mklink (mklink is a shell function and so is not accessible
  in this manner).
This commit is contained in:
John W. Parent
2022-03-31 14:47:11 -04:00
committed by GitHub
parent 90da5dc909
commit 88b1bf751d
2 changed files with 9 additions and 13 deletions

View File

@@ -11,10 +11,11 @@
from llnl.util import lang
from spack.util.executable import Executable
is_windows = _platform == 'win32'
if is_windows:
from win32file import CreateHardLink
def symlink(real_path, link_path):
"""
@@ -53,16 +54,7 @@ def _win32_junction(path, link):
path = os.path.join(parent, path)
path = os.path.abspath(path)
command = "mklink"
default_args = [link, path]
if os.path.isdir(path):
# try using a junction
default_args.insert(0, '/J')
else:
# try using a hard link
default_args.insert(0, '/H')
Executable(command)(*default_args)
CreateHardLink(link, path)
@lang.memoized