Skip to content
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

Update #7874: Add test, fix changelog #7900

Merged
merged 4 commits into from
Jan 12, 2022

Conversation

sergv
Copy link
Collaborator

@sergv sergv commented Jan 8, 2022

I have added test for #7874. It works by cabal package having a c file which will only compile if all the necessary defines are defined. I'm passing defines via various ways, including cabal configure, fields of cabal file and test that gcc is overridden by passing a custom script which defines final macro without which the c file will not compile.

The original patch seems to be working fine as without it the test doesn't pass. However, I noticed that the original patch only results in cabal passing -pgmc flag to ghc, thus overriding the C compiler. However original issue #4439 also mentioned the intention to override linker, which should have resulted in -pgml being passed to the ghc, but this doesn't happen in the original patch.

syntheorem and others added 4 commits January 8, 2022 21:20
This fix allows users to override the C/C++ compiler, either by passing
--with-gcc to configure or adding -pgmc to ghc-options in their Cabal
file.

Tested manually with a project using C++ sources that require a more
recent version of clang than the default install (macOS). Inspected the
output of `Setup.hs build -v` to confirm that the correct arguments are
being passed to GHC when compiling the C++ sources.

Resolves: haskell#4439
@Mikolaj
Copy link
Member

Mikolaj commented Jan 11, 2022

Let me clarify: this PR provides a test, #7874 passed the test, and, based on the test, this PR slightly amends #7874 as well? If so, how exactly is #7874 amended? Is this reflected in the recorded test results?

@sergv
Copy link
Collaborator Author

sergv commented Jan 11, 2022

This PR takes originall commit from #7874, rebases it on master, adds test and in another commit puts changelog entry in proper place (I hope I got it right). The original commit is not changed but Amend changelog commit does some fixing atfter the original commit since it was adding changelog entry under cabal 2.4.

@Mikolaj
Copy link
Member

Mikolaj commented Jan 11, 2022

OK, thanks, I got confused.

Copy link
Member

@Mikolaj Mikolaj left a comment

Choose a reason for hiding this comment

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

Indeed, this matches the old PR and, while I'm not experienced in this area, the test looks great. Thank you!

Copy link
Member

@Kleidukos Kleidukos left a comment

Choose a reason for hiding this comment

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

Fantastic, thank you very much. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
attention: needs-review merge me Tell Mergify Bot to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants