From b60a0eea012587acef308d6df573454965aa8837 Mon Sep 17 00:00:00 2001 From: Betsy McPhail Date: Thu, 21 Oct 2021 16:30:16 -0400 Subject: 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 Co-authored-by: John Parent --- var/spack/repos/builtin/packages/wrf/package.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'var') 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): -- cgit v1.2.3-60-g2f50