-
Notifications
You must be signed in to change notification settings - Fork 100
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
Add build-tool flag to omit tool and FV deps+modules from build #882
Conversation
@@ -292,7 +316,7 @@ executable gasmodel | |||
default-language: Haskell2010 | |||
|
|||
test-suite hspec | |||
if !impl(ghcjs) | |||
if !impl(ghcjs) && flag(build-tool) | |||
main-is: hspec.hs | |||
type: exitcode-stdio-1.0 | |||
else |
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.
The else branch will be selected for !impl(ghcjs) && !flag(build-tool)
, which probably is not intended. I think, the following would be correct:
elif impl(ghcjs) && flag(build-tool)
main-is: hspec-ghcjs.hs
type: exitcode-stdio-1.0
else
buildable: False
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.
It's intended this way to at least run some tests on ghc && !build-tool. What is really needed is a subset of tests for this case but that can wait.
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.
Oh, cool. I though the build-tool would be incompatible with the test suite. Much better this way. We should also reenable tests in the ci build for -build-tool.
* reorganize lib section in pact.cabal * build tools only if the library supports it * set build-tool to manual in order for the default value to become effective * include -build-tool case into ci matrix * fix build-tool flag in ci build * set BUILD_TOOL macro for tool builds * don't run tests and benchmarks in ci when -fbuild-tool
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.
Approved with a few suggestions regarding the CPP macros for generating the errors.
Not sure, if they are needed, because building those modules is already disabled in the cabal file. If we want to keep them as an additional safety check, we may consider using #error
instead of Haskells error
, because the former would fail already at compilation time.
If we remove them we could simplify the cabal file for the respective components a bit by not setting the BUILD_TOOL
macro and removing the flag(build-tool)
branch of the if statement that guards the buildable
property.
if !flag(build-tool)
buildable: False
would be sufficient, since buildable: True
is the default.
No description provided.