Skip to content

Further compact build profile output in new-build #4620

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

Merged
merged 1 commit into from
Jul 21, 2017

Conversation

amir
Copy link
Collaborator

@amir amir commented Jul 21, 2017

Please include the following checklist in your PR:

  • Patches conform to the coding conventions.
  • Any changes that could be relevant to users have been recorded in the changelog.
  • The documentation has been updated, if necessary.

This change will further compact the newly added Build Profile to new-build command in #4605 per @hvr's comment: #4605 (comment)

Before this change:

Build profile: with-compiler: ghc-7.10.3, optimization: MaximumOptimisation

And after this change:

Build profile: -w ghc-7.10.3 -O2

@mention-bot
Copy link

@amir, thanks for your PR! By analyzing the history of the files in this pull request, we identified @23Skidoo, @dcoutts and @ezyang to be potential reviewers.

showBuildProfile = "Build profile: " ++ unwords [
"-w " ++ (showCompilerId . pkgConfigCompiler) elaboratedShared,
"-O" ++ (case packageConfigOptimization of
Setup.Flag NoOptimisation -> "0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we already have a utility function for rendering this type?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there probably is one. will start looking for it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it looks like we don't.

Setup.Flag NoOptimisation -> "0"
Setup.Flag NormalOptimisation -> "1"
Setup.Flag MaximumOptimisation -> "2"
_ -> "1")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer an exhaustive pattern-match instead of a catch-all clause. That way we'll get a warning about an inexhaustive pattern match when the data type changes.

@23Skidoo 23Skidoo merged commit 6fe7128 into haskell:master Jul 21, 2017
@23Skidoo
Copy link
Member

Merged, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants