Skip to content

Update #7874: Add test, fix changelog - #7900

Merged
mergify[bot] merged 4 commits into
haskell:masterfrom
sergv:add-test-for-cc-override
Jan 12, 2022
Merged

mergify[bot] merged 4 commits into
haskell:masterfrom
sergv:add-test-for-cc-override

Conversation

@sergv

@sergv sergv commented Jan 8, 2022

Copy link
Copy Markdown
Collaborator

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

Mikolaj commented Jan 11, 2022 •

Copy link
Copy Markdown
Member

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

sergv commented Jan 11, 2022 •

Copy link
Copy Markdown
Collaborator Author

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

Mikolaj commented Jan 11, 2022

Copy link
Copy Markdown
Member

OK, thanks, I got confused.

@Mikolaj Mikolaj left a comment •

Copy link
Copy Markdown
Member

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!

@Kleidukos Kleidukos left a comment

Copy link
Copy Markdown
Member

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. :)

@Mikolaj Mikolaj added the merge me Tell Mergify Bot to merge label Jan 12, 2022
@mergify
mergify Bot merged commit 7e46d03 into haskell:master Jan 12, 2022
@sergv
sergv deleted the add-test-for-cc-override branch January 12, 2022 00:10
@sergv
sergv restored the add-test-for-cc-override branch April 11, 2022 17:01
@ulysses4ever ulysses4ever mentioned this pull request Apr 25, 2024
1 of 2 tasks
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