Skip to content

With process substitiution, ghc didn't read filedescriptor.

I ran ghc with process substitution as filename but ghc couldn't read the filedescriptor. I ran this script with bash and zsh, then I got the error.

#!/bin/sh
H='''
main = putStrLn "Hello, World!
'''
P='''
print("Hello, World!")
'''
R='''
puts "Hello, World!"
'''

stack ghc -- --version
bash --version
zsh --version
cat --version
python --version
ruby --version
echo '-----------------------'
cat <(echo -n "$H")
echo '-----------------------'
stack ghc <(echo -n "$H")
echo '-----------------------'
python <(echo -n "$P")
ruby <(echo -n "$R")
The Glorious Glasgow Haskell Compilation System, version 8.2.2
GNU bash, バージョン 4.4.19(1)-release (x86_64-unknown-linux-gnu)
Copyright (C) 2016 Free Software Foundation, Inc.
ライセンス GPLv3+: GNU GPL バージョン 3 またはそれ以降 <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
zsh 5.4.2 (x86_64-unknown-linux-gnu)
cat (GNU coreutils) 8.29
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

作者 Torbjorn Granlund および Richard M. Stallman。
Python 3.6.4
ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-linux]
-----------------------

main = putStrLn "Hello, World!
-----------------------
target ‘/dev/fd/63’ is not a module name or a source file
-----------------------
Hello, World!
/dev/fd/63: No such file or directory @ realpath_rec - /proc/4024/fd/pipe:[1855404] (Errno::ENOENT)

I already reported to ruby.

Trac metadata
Trac field Value
Version 8.2.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information