commercialhaskell / commercialhaskell/stack
Windows: stty: 'standard input': Inappropriate ioctl for device
- Dominant language
- Haskell
- Stars
- 4.1k
- Forks
- 850
- Avg merge
- 10h 37m
- Merged PRs (30d)
- 4
Description
### General summary/comments (optional)
On Windows running `stack path` as a subprocess results in an error printed to `stderr`:
```
stty: 'standard input': Inappropriate ioctl for device
```
### Steps to reproduce
Running normally inside a powershell has no problems:
```
PS C:\Users\lehins> stack --no-terminal path --project-root
C:\sr\global-project
```
But when executed as a subprocess
```haskell
Prelude System.Process> import System.Process
Prelude System.Process> res <- readProcess "stack" ["--version"] ""
Prelude System.Process> putStr res
Version 2.2.0, Git revision b8f8ec203209fccb1a86b9e8705f16125845254b PRE-RELEASE x86_64 hpack-0.31.2
Prelude System.Process> _ <- readProcess "stack" ["path", "--project-root"] ""
stty: 'standard input': Inappropriate ioctl for device
Prelude System.Process> _ <- readProcess "stack" ["--no-terminal", "path", "--project-root"] ""
stty: 'standard input': Inappropriate ioctl for device
```
There should be no reason that `stack path` would require anything from `stdin`.
### Expected
No error printed to `stderr`
### Actual
Here is the version with `--verbose`:
```
Prelude System.Process> r <- readProcess "stack" ["--no-terminal", "--verbose", "path", "--project-root"] ""
Version 2.2.0, Git revision b8f8ec203209fccb1a86b9e8705f16125845254b PRE-RELEASE x86_64 hpack-0.31.2
stty: 'standard input': Inappropriate ioctl for device
2019-09-24 14:07:06.956615: [debug] Checking for project config at: C:\Users\lehins\stack.yaml
2019-09-24 14:07:06.956615: [debug] Checking for project config at: C:\Users\stack.yaml
2019-09-24 14:07:06.956615: [debug] Checking for project config at: C:\stack.yaml
2019-09-24 14:07:06.956615: [debug] No project config file found, using defaults.
2019-09-24 14:07:06.972240: [debug] SELECT COUNT(*) FROM "last_performed" WHERE ("action"=?) AND ("timestamp">=?); [Pers
istInt64 1,PersistUTCTime 2019-09-23 20:07:06.9722403 UTC]
2019-09-24 14:07:06.972240: [debug] Run from outside a project, using implicit global project config
2019-09-24 14:07:06.972240: [debug] Using package location completions from a lock file
2019-09-24 14:07:07.206615: [debug] Asking for a supported GHC version
2019-09-24 14:07:07.206615: [debug] Installed tools:
- msys2-20180531
- ghc-8.6.5
- ghc-8.4.3
- ghc-8.2.2
2019-09-24 14:07:07.222240: [debug] Potential GHC builds: standard
2019-09-24 14:07:07.222240: [debug] Found already installed GHC builds: standard
2019-09-24 14:07:07.222240: [debug] SELECT "id","actual_version","arch","ghc_path","ghc_size","ghc_modified","ghc_pkg_pa
th","runghc_path","haddock_path","cabal_version","global_db","global_db_cache_size","global_db_cache_modified","info","g
lobal_dump" FROM "compiler_cache" WHERE "ghc_path"=?; [PersistText "C:\\Users\\lehins\\AppData\\Local\\Programs\\stack\\
x86_64-windows\\ghc-8.6.5\\bin\\ghc-8.6.5.EXE"]
2019-09-24 14:07:07.300365: [debug] Loaded compiler information from cache
2019-09-24 14:07:07.315990: [debug] Asking for a supported GHC version
2019-09-24 14:07:07.315990: [debug] Resolving package entries
2019-09-24 14:07:07.315990: [debug] Parsing the targets
2019-09-24 14:07:07.315990: [debug] Checking flags
2019-09-24 14:07:07.315990: [debug] SourceMap constructed
2019-09-24 14:07:07.331615: [debug] Starting to execute command inside EnvConfig
2019-09-24 14:07:07.331615: [debug] Checking for project config at: C:\Users\lehins\stack.yaml
2019-09-24 14:07:07.331615: [debug] Checking for project config at: C:\Users\stack.yaml
2019-09-24 14:07:07.347240: [debug] Checking for project config at: C:\stack.yaml
2019-09-24 14:07:07.347240: [debug] No project config file found, using defaults.
2019-09-24 14:07:07.362865: [debug] SELECT COUNT(*) FROM "last_performed" WHERE ("action"=?) AND ("timestamp">=?); [Pers
istInt64 1,PersistUTCTime 2019-09-23 20:07:07.3628653 UTC]
2019-09-24 14:07:07.362865: [debug] Run from outside a project, using implicit global project config
2019-09-24 14:07:07.362865: [debug] Using package location completions from a lock file
2019-09-24 14:07:07.581615: [debug] Asking for a supported GHC version
2019-09-24 14:07:07.581615: [debug] Installed tools:
- msys2-20180531
- ghc-8.6.5
- ghc-8.4.3
- ghc-8.2.2
2019-09-24 14:07:07.581615: [debug] Potential GHC builds: standard
2019-09-24 14:07:07.581615: [debug] Found already installed GHC builds: standard
2019-09-24 14:07:07.597240: [debug] SELECT "id","actual_version","arch","ghc_path","ghc_size","ghc_modified","ghc_pkg_pa
th","runghc_path","haddock_path","cabal_version","global_db","global_db_cache_size","global_db_cache_modified","info","g
lobal_dump" FROM "compiler_cache" WHERE "ghc_path"=?; [PersistText "C:\\Users\\lehins\\AppData\\Local\\Programs\\stack\\
x86_64-windows\\ghc-8.6.5\\bin\\ghc-8.6.5.EXE"]
2019-09-24 14:07:07.675365: [debug] Loaded compiler information from cache
2019-09-24 14:07:07.675365: [debug] Asking for a supported GHC version
2019-09-24 14:07:07.675365: [debug] Resolving package entries
2019-09-24 14:07:07.675365: [debug] Parsing the targets
2019-09-24 14:07:07.675365: [debug] Checking flags
2019-09-24 14:07:07.675365: [debug] SourceMap constructed
2019-09-24 14:07:07.706615: [debug] Starting to execute command inside EnvConfig
Prelude System.Process>
```
### Stack version
This issue is present in the latest released version as well, since I observed it on AppVeyor as well as on a local version of Windows 7
```
PS C:\Users\lehins> stack --version
Version 2.2.0, Git revision b8f8ec203209fccb1a86b9e8705f16125845254b PRE-RELEASE x86_64 hpack-0.31.2
```
### Method of installation
* `stack update --git`
Contributor guide
Assessment
This issue has not been assessed yet.