File tree Expand file tree Collapse file tree 7 files changed +37
-1
lines changed
cabal-testsuite/PackageTests/COnlyMain Expand file tree Collapse file tree 7 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -1268,7 +1268,11 @@ gbuild verbosity numJobs pkg_descr lbi bm clbi = do
12681268 runGhcProg compileTHOpts { ghcOptNoLink = toFlag True
12691269 , ghcOptNumJobs = numJobs }
12701270
1271- unless (gbuildIsRepl bm) $
1271+ -- Do not try to build anything if there are no input files.
1272+ -- This can happen if the cabal file ends up with only cSrcs
1273+ -- but no Haskell modules.
1274+ unless ((null inputFiles && null inputModules)
1275+ || gbuildIsRepl bm) $
12721276 runGhcProg compileOpts { ghcOptNoLink = toFlag True
12731277 , ghcOptNumJobs = numJobs }
12741278
Original file line number Diff line number Diff line change 11-*-change-log-*-
22
332.2.0.0 (current development version)
4+ * Cabal does not try to build an empty set of `inputModules` (#4890).
45 * Add `HexFloatLiterals` to `KnownExtension`
56 * Added `virtual-module` field, to allow modules that are not built
67 but registered (#4875).
Original file line number Diff line number Diff line change 1+ #include <stdio.h>
2+
3+ int main (int argc , char * * argv ) {
4+ printf ("Hello world!" );
5+ return 0 ;
6+ }
Original file line number Diff line number Diff line change 1+ name : my
2+ version : 0.1
3+ license : BSD3
4+ cabal-version : >= 2.1
5+ build-type : Simple
6+
7+ executable foo
8+ -- default-language is required by cabal-version >= 1.10
9+ default-language : Haskell2010
10+ main-is : foo.c
Original file line number Diff line number Diff line change 1+ # Setup configure
2+ Resolving dependencies...
3+ Configuring my-0.1...
4+ # Setup build
5+ Preprocessing executable 'foo' for my-0.1..
6+ Building executable 'foo' for my-0.1..
Original file line number Diff line number Diff line change 1+ # Setup configure
2+ Configuring my-0.1...
3+ # Setup build
4+ Preprocessing executable 'foo' for my-0.1..
5+ Building executable 'foo' for my-0.1..
Original file line number Diff line number Diff line change 1+ import Test.Cabal.Prelude
2+ -- Test building an executable whose main() function is defined in a C
3+ -- file
4+ main = setupAndCabalTest $ setup_build []
You can’t perform that action at this time.
0 commit comments