stack script --compile
errors when executing via relative path
#3372
Milestone
stack script --compile
errors when executing via relative path
#3372
Running a script via a relative path works fine unless you use the
--compile
or--optimize
options.Steps to reproduce
mkdir blah
vim blah/Blah.hs
and paste in the contents belowchmod +x blah/Blah.hs
./blah/Blah.hs
Expected
It runs and outputs
blah
Actual
The following error occurs and the program doesn't run:
Stack version
still seems to exist in
Method of installation
It does actually work fine if you use an absolute path, like
/home/whatever/blah/Blah.hs
.Just based on the output and testing, it appears that doing something like figuring out the directory, changing to it, and then using the name of the executable as you specified it to tell GHC what to compile. Which works fine if it's in the same directory, or if you refer to it via an absolute path that will always be valid, or if it's in your
$PATH
and you just call it viaBlah.hs
, but fails in this case.It works fine if you don't specify
--compile
or--optimize
by the way.The text was updated successfully, but these errors were encountered: