diff options
author | John W. Parent <45471568+johnwparent@users.noreply.github.com> | 2022-03-31 14:47:11 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-31 11:47:11 -0700 |
commit | 88b1bf751d76e010584b251f482cdfb0ba5351a1 (patch) | |
tree | ad31c33fb60810047f1f9cd0c487c7a154ddb91c /lib | |
parent | 90da5dc909acbb677b8affde098e3fe08b63b2b6 (diff) | |
download | spack-88b1bf751d76e010584b251f482cdfb0ba5351a1.tar.gz spack-88b1bf751d76e010584b251f482cdfb0ba5351a1.tar.bz2 spack-88b1bf751d76e010584b251f482cdfb0ba5351a1.tar.xz spack-88b1bf751d76e010584b251f482cdfb0ba5351a1.zip |
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).
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/llnl/util/symlink.py | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/lib/spack/llnl/util/symlink.py b/lib/spack/llnl/util/symlink.py index d6e4651557..6c55d74f66 100644 --- a/lib/spack/llnl/util/symlink.py +++ b/lib/spack/llnl/util/symlink.py @@ -11,10 +11,11 @@ from sys import platform as _platform 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 |