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:
@@ -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
|
||||
|
Reference in New Issue
Block a user