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
In cabal version 3.6.2.0 and before, scripts could be named anything. But with a cabal-install built from HEAD attempting to run any script file without an ".hs" or ".lhs" suffix fails.
To Reproduce
Save the following as a file named "script":
{- cabal:
build-depends: base
-}
main = putStrLn "Hello"
Then,
$ cabal --version
cabal-install version 3.7
compiled using version 3.7.0.0 of the Cabal library
$ cabal v2-run script
Resolving dependencies...
Build profile: -w ghc-9.2.1 -O1
In order, the following will be built (use -v for more details):
- fake-package-0 (exe:script) (first run)
Configuring executable 'script' for fake-package-0..
Error: cabal: The 'main-is' field must specify a '.hs' or '.lhs' file (even if
it is generated by a preprocessor), or it may specify a C/C++/obj-C source
file.
Expected behavior
Scripts should continue to work regardless of what they are named.
Although, it seems like this new behavior has fixed #5702 so error messages no longer confusingly mention "Main.hs". It would be nice to keep the new behavior but without this regression.
System information
cabal-install version 3.7 (built from commit 7775be8)
GHC version 9.2.1
NixOS 21.05
The text was updated successfully, but these errors were encountered:
* Pass such scripts with: -x hs script
* Disable extension check for scripts
* Disable running preprocessors for scripts because they're based on
extension
* Add test case for script with no extension
Resolveshaskell#7910
* Pass such scripts with: -x hs script
* Disable extension check for scripts
* Disable running preprocessors for scripts because they're based on
extension
* Add test case for script with no extension
Resolveshaskell#7910
* Pass such scripts with: -x hs script
* Disable extension check for scripts
* Disable running preprocessors for scripts because they're based on
extension
* Add test case for script with no extension
Resolveshaskell#7910
Describe the bug
In cabal version 3.6.2.0 and before, scripts could be named anything. But with a cabal-install built from HEAD attempting to run any script file without an ".hs" or ".lhs" suffix fails.
To Reproduce
Save the following as a file named "script":
Then,
Expected behavior
Scripts should continue to work regardless of what they are named.
Although, it seems like this new behavior has fixed #5702 so error messages no longer confusingly mention "Main.hs". It would be nice to keep the new behavior but without this regression.
System information
The text was updated successfully, but these errors were encountered: