Open JRikken opened 4 years ago
I'm running into the same problem. Running a simple benchmark
import Criterion.Main
main :: IO ()
main = defaultMain [
bench "squaring 1000 elements" $ nf (map (^2)) ([1..1000] :: [Int])
]
causes the same error to occur. When the length of the list is lowered to 10, the problem goes away.
When running the same code as a executable and with the command stack run
, everything runs fine.
Also on Window 10 x64, but using the cmd.
Very strange...
General summary
Stack terminates with "terminateProcess: permission denied (Permission denied)", after running the benchmarks with
stack bench
The error seems to be time-related. Also, it seems that this error only occurs when using
stack bench
, I ran the compiled benchmark executable directly from the command line, this worked as expected.Steps to reproduce
I have reproduced the issue in a MWE, see the attached files benchTest.zip, or recreate as follows:
stack new benchTest
&stack setup
main = defaultMain [ bgroup "Fib" [ bench "N=5 " $ whnf fib 5, bench "N=6 " $ whnf fib 6, bench "N=15" $ whnf fib 15]]
package.yaml
so that it compiles the benchmark as an executable (benchTest-exe
) as well as a benchmark (benchTest-bench
)stack bench
terminates with error, whereasstack run
works as expected, even though they come from the same codeNotes:
n=7
for the third call tofib
, the error disappears on my PC)stack bench -v
and replicated the call to the benchmark executable directly from command line (e.g.<...ghc.8.6.5.exe> --builddir=<somedir> bench benchTest-bench
, this runs as expected!Expected
stack bench
==stack run
== replicating theghc bench benchTest-bench
callActual
stack bench
produces "terminateProcess: permission denied (Permission denied)" whereasstack run
, running the benchmark executable directly from command line or replicating the call from the verbose output do not produce this error.Stack version
Method of installation