You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Attempting to use cabal as script interpreter seems to not work in windows, even using mingw64 shell
To Reproduce
Steps to reproduce the behavior:
Create a test.hs file:
#!/usr/bin/env cabal
{- cabal:with-compiler: ghc-8.6.5build-depends: base-}main::IO()
main =putStrLn"Interpret me please"
Run cabal v2-run test.hs command in a dos shell
Or run ./test.hs in a mingw shell
Expected behavior
The script should be interpreted and show the message
Actual behavior
cabal throws an error:
Resolving dependencies...
Build profile: -w ghc-8.6.5 -O1
In order, the following will be built (use -v for more details):
- fake-package-0 (exe:script) (configuration changed)
Configuring executable 'script' for fake-package-0..
Preprocessing executable 'script' for fake-package-0..
Building executable 'script' for fake-package-0..
[1 of 1] Compiling Main ( Main.hs, \path\to\test-interpreter\di
st-newstyle\build\x86_64-windows\ghc-8.6.5\fake-package-0\x\script\build\script\
script-tmp\Main.o )
Main.hs:1:1: error:
Could not load module ‘Prelude’
It is a member of the hidden package ‘base-4.12.0.0’.
Perhaps you need to add ‘base’ to the build-depends in your .cabal file.ile.
it is a hidden module in the package ‘hackage-security-0.5.3.0’
Use -v to see a list of the files searched for.
|
1 | {- cabal:
| ^
System informataion
Windows
cabal
cabal-install version 2.4.1.0
compiled using version 2.4.1.0 of the Cabal library
Arrgh i cant believe i missed that one in my search, sorry for that.
Trying with cabal built from 2.4 branch works as expected.
Thanks for the point, closing this as duplicate of #5775
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
Attempting to use cabal as script interpreter seems to not work in windows, even using mingw64 shell
To Reproduce
Steps to reproduce the behavior:
Create a
test.hs
file:cabal v2-run test.hs
command in a dos shell./test.hs
in a mingw shellExpected behavior
The script should be interpreted and show the message
Actual behavior
System informataion
cabal
Additional context
Trying to build
haskell-ide-engine
with cabal, using the script feature: haskell/haskell-ide-engine#1221The text was updated successfully, but these errors were encountered: