1

I got a download file from my University for one of my assignments, it has an import Criterion.Main that my version of stack does not recognize

I tried updating my Stack and cabal, added

#!/usr/bin/env stack

to the beginning of my file, and tried running stack fib2.hs (the name of the file with the problematic import), but this only got me these error messages:

stack: WARNING! Expecting stack options comment at line 1, column 1
stack: WARNING! Missing or unusable Stack options specification
stack: WARNING! Using runghc without any additional Stack options
Executable named sh not found on path: [Path]

the file itself had

stack --resolver lts-11.10 script --optimize

put in there by my uni, but when I try to run this I get another error:

Missing: FILE

Usage: stack.exe script [--package PACKAGE] FILE
                    [-- ARGUMENT(S) (e.g. stack script X.hs -- argument(s) to program).]
                    [--compile | --optimize] [--[no-]use-root]
                    [--ghc-options OPTIONS] [--extra-dep PACKAGE-VERSION]
                    [--no-run] [--setup-info-yaml URL]
                    [--snapshot-location-base URL] [--help]

Run a Stack script

What am I doing wrong?

leftaroundabout
  • 117,950
  • 5
  • 174
  • 319
Am Akkaya
  • 11
  • 2
  • Something somewhere is pointing to an `sh` executable. You can see that from the last bit of the error message `Stack options Executable named sh not found on path: [Path]`. You can also run a script by executing `stack [script_filename]`, which might work or maybe give you another error. – Augusto Jul 23 '23 at 16:17
  • 1
    Your problem seems to have nothing to do with the Criterion import really, this is a deeper setup issue. You should try to first get Stack working with a simple Hello World program. – leftaroundabout Jul 23 '23 at 16:28

0 Answers0