summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorJohn W. Parent <45471568+johnwparent@users.noreply.github.com>2022-03-31 14:47:11 -0400
committerGitHub <noreply@github.com>2022-03-31 11:47:11 -0700
commit88b1bf751d76e010584b251f482cdfb0ba5351a1 (patch)
treead31c33fb60810047f1f9cd0c487c7a154ddb91c /var
parent90da5dc909acbb677b8affde098e3fe08b63b2b6 (diff)
downloadspack-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 'var')
-rw-r--r--var/spack/repos/builtin/packages/perl/package.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/perl/package.py b/var/spack/repos/builtin/packages/perl/package.py
index e44a711d45..eec1927622 100644
--- a/var/spack/repos/builtin/packages/perl/package.py
+++ b/var/spack/repos/builtin/packages/perl/package.py
@@ -15,6 +15,7 @@
import os
import platform
import re
+import sys
from contextlib import contextmanager
from llnl.util.lang import match_predicate
@@ -23,7 +24,7 @@ from llnl.util.symlink import symlink
from spack import *
from spack.operating_systems.mac_os import macos_version
-is_windows = str(spack.platforms.host()) == 'windows'
+is_windows = sys.platform == 'win32'
class Perl(Package): # Perl doesn't use Autotools, it should subclass Package
@@ -330,6 +331,8 @@ class Perl(Package): # Perl doesn't use Autotools, it should subclass Package
if perl_lib_dirs:
perl_lib_path = ':'.join(perl_lib_dirs)
env.prepend_path('PERL5LIB', perl_lib_path)
+ if is_windows:
+ env.append_path('PATH', self.prefix.bin)
def setup_dependent_build_environment(self, env, dependent_spec):
self._setup_dependent_env(env, dependent_spec,
@@ -361,6 +364,7 @@ class Perl(Package): # Perl doesn't use Autotools, it should subclass Package
def setup_build_environment(self, env):
if is_windows:
+ env.append_path('PATH', self.prefix.bin)
return
spec = self.spec