diff options
author | Betsy McPhail <betsy.mcphail@kitware.com> | 2021-10-21 16:30:16 -0400 |
---|---|---|
committer | Peter Scheibel <scheibel1@llnl.gov> | 2022-03-17 09:01:01 -0700 |
commit | b60a0eea012587acef308d6df573454965aa8837 (patch) | |
tree | ce31689f14e083beaf3ba942d51726790a52d3cf /var | |
parent | 81bc00d61fd9872514e5e25b4af405e6d3c9202e (diff) | |
download | spack-b60a0eea012587acef308d6df573454965aa8837.tar.gz spack-b60a0eea012587acef308d6df573454965aa8837.tar.bz2 spack-b60a0eea012587acef308d6df573454965aa8837.tar.xz spack-b60a0eea012587acef308d6df573454965aa8837.zip |
Workarounds for install errors on Windows (#21890)
1. Forwarding sys.stdin, e.g. use input_multiprocess_fd,
gives an error on Windows. Skipping for now
3. subprocess_context needs to serialize for Windows, like it does
for Mac.
Co-authored-by: lou.lawrence@kitware.com <lou.lawrence@kitware.com>
Co-authored-by: John Parent <john.parent@kitware.com>
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/wrf/package.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/wrf/package.py b/var/spack/repos/builtin/packages/wrf/package.py index cd433c1ac2..7beeee61b1 100644 --- a/var/spack/repos/builtin/packages/wrf/package.py +++ b/var/spack/repos/builtin/packages/wrf/package.py @@ -10,12 +10,19 @@ from fcntl import F_GETFL, F_SETFL, fcntl from os import O_NONBLOCK from os.path import basename from subprocess import PIPE, Popen +from sys import platform as _platform from sys import stdout from llnl.util import tty from spack import * +if _platform != 'win32': + from fcntl import F_GETFL, F_SETFL, fcntl + from os import O_NONBLOCK, rename +else: + from os import rename + re_optline = re.compile(r'\s+[0-9]+\..*\((serial|smpar|dmpar|dm\+sm)\)\s+') re_paroptname = re.compile(r'\((serial|smpar|dmpar|dm\+sm)\)') re_paroptnum = re.compile(r'\s+([0-9]+)\.\s+\(') @@ -27,9 +34,11 @@ re_nestoptname = re.compile(r'=([^,)]+)') def setNonBlocking(fd): """ Set the given file descriptor to non-blocking + Non-blocking pipes are not supported on windows """ - flags = fcntl(fd, F_GETFL) | O_NONBLOCK - fcntl(fd, F_SETFL, flags) + if _platform != 'win32': + flags = fcntl(fd, F_GETFL) | O_NONBLOCK + fcntl(fd, F_SETFL, flags) def collect_platform_options(stdoutpipe): |