-
Notifications
You must be signed in to change notification settings - Fork 704
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow empty set of input modules. #4891
Conversation
892a659
to
60f1f64
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments.
Configuring my-0.1... | ||
# Setup build | ||
Preprocessing executable 'foo' for my-0.1.. | ||
Building executable 'foo' for my-0.1.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we also test that it correctly outputs "hello, world"?
-- Do not try to build anything if there are no input files. | ||
-- This can happen if the cabal file ends up with only cSrcs | ||
-- but no Haskell modules. | ||
unless ((null inputFiles && null inputModules) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd maybe add an additional check, something along these lines:
let noHaskellSources = null inputFiles && null inputModules
noForeignSources = null cSrcs && null cxxSrcs && null asmSrcs && ...
when (noHaskellSources && noForeignSources) $
die "Component has no source files to compile"
Though perhaps that should be part of cabal check
.
BTW, do we allow a .cpp/.asm/.cmm
main-is
?
-- This can happen if the cabal file ends up with only cSrcs | ||
-- but no Haskell modules. | ||
unless ((null inputFiles && null inputModules) | ||
|| gbuildIsRepl bm) $ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if you run repl
on a component that only has C sources? Also, are C-only libraries allowed now?
@23Skidoo thanks. I'll have a look! |
Please include the following checklist in your PR:
[ci skip]
is used to avoid triggering the build bots.Please also shortly describe how you tested your change. Bonus points for added tests!
Do not try to call GHC on an empty set of
inputModules
.Fixes #4890