Adding basic Windows features (#21259)

* Snapshot of some MSVC infrastructure added during experiments a while ago.  Rebasing from spack/develop.

* Added platform and OS definitions for Windows.

* Updated Windows platform file to conform to new archspec use.

* Added Windows as a platform; introduced some debugging code.

* Added type annotations.

* Fixed copyright.

* Removed print statements.

* Ensure `spack arch` returns correctly on Windows (#21428)

* Correctly identify windows as 'windows-Windows10-AMD64'
This commit is contained in:
Ben Cowan
2021-02-01 07:26:47 -07:00
committed by Peter Scheibel
parent b26b3bebb4
commit 81bc00d61f
6 changed files with 138 additions and 3 deletions

View File

@@ -564,7 +564,7 @@ def __enter__(self):
sys.stdout.flush()
sys.stderr.flush()
# Now do the actual output rediction.
# Now do the actual output redirection.
self.use_fds = _file_descriptors_work(sys.stdout, sys.stderr)
if self.use_fds:
# We try first to use OS-level file descriptors, as this
@@ -725,7 +725,8 @@ def _writer_daemon(stdin_multiprocess_fd, read_multiprocess_fd, write_fd, echo,
# write_fd to terminate the reading loop, so we close the file descriptor
# here. Forking is the process spawning method everywhere except Mac OS
# for Python >= 3.8 and on Windows
if sys.version_info < (3, 8) or sys.platform != 'darwin':
if sys.version_info < (3, 8) \
or sys.platform not in ['darwin', 'cygwin']:
os.close(write_fd)
# Use line buffering (3rd param = 1) since Python 3 has a bug