Pass *-options to GHC when compiling ordinary Haskell sources#10969
Pass *-options to GHC when compiling ordinary Haskell sources#10969zlonast wants to merge 1 commit intohaskell:masterfrom
Conversation
1bd501e to
c3e68be
Compare
|
I probably need to think about tests, maybe something started working besides |
|
Ok, got it, we just need to separate the flags |
a439429 to
1b8e5bb
Compare
|
@ulysses4ever @phadej It's not very easy to add flags to sources files due to backward compatibility, so for now I suggest considering the pull request as is ¯\_(ツ)_/¯ (Anyway, this solved the problem with macros in header files) |
ulysses4ever
left a comment
There was a problem hiding this comment.
Great start, thank you! Below are some inline questions.
One general question: did you check that this doesn't lead to duplicated options when cabal calls GHC? I assume other *-options are passed today sometimes. So, sometimes we'll get those options passed as today and through your change too. Is that right? It seems undesirable.
It's not very easy to add flags to sources files due to backward compatibility
Can you be more specific? Do you mean it's hard to test on older GHCs? This shouldn't be a problem because the tests can run for specific versions of GHC (e.g. starting from 8.10).
geekosaur
left a comment
There was a problem hiding this comment.
Same concerns as @ulysses4ever raised.
Yes, it looks like so. I'd say the problem is rather that IMHO, it's wrong that there are separate EDIT: There might be situations where EDIT: So AFAICT, this is not the correct fix, not what I'd imagine seeing. |
0b74992 to
37417aa
Compare
|
@zlonast could you comment on this #10969 (comment)? Specifically, two things: was the issue resolved and what you think of trying a large scale compilation (perhaps stackage, maybe via clc-stackage). |
The problem wasn't my fault initially. (A bug in the mac os clc-stackage blacklist.) Yes, it's been resolved. The last test run was successful. (on linux and mac os ) I suppose, we should run another one? |
Is it something you ran on your side? If there was a successful clc-stackage run at some point, I don't see a reason to re-run it. Over to you @mpickering . |
|
@zlonast GitHub UI says the branch is out of date. Please rebase when you can, or, if you prefer, I can do it (after all, it's an endless game before the merge happens, and we don't want contributors to feel like they got an indefinite assignment for it). |
Yes, I tried it on my side, I would be glad if someone could do it too. I recently rebased, so feel free to do so with my branch. |
geekosaur
left a comment
There was a problem hiding this comment.
There are a lot of unresolved comments still, that will need to be resolved to merge.
cabal-testsuite/PackageTests/ShowBuildInfo/Complex/win-single.test.hs
Outdated
Show resolved
Hide resolved
|
FWIW I'm not worried about rebases, except insofar as they may help with development; since PRs are being merged all the time, it's usually not worth the resulting constant rebases when Mergify will do it itself. |
|
@zlonast please, attend to the inline comments when you get a chance |
|
I've closed a few threads because I don't think they're that important, but feel free to reopen them.
|
|
Perhaps we should add more tests, but I don't have the energy for that right now.
|
|
There are some linking issues with older versions. I don't know what to say about that.
|
a7f3e55 to
a8f1b13
Compare
|
And also we have problems with normalizer. #11187 (comment)
|
|
I see the diff is quite large and there is scope creep (possible interactions, hypothetical scenarios, related buglets), so I'm worried for the kind PR author. Could we all try to help somehow? Maybe let's try to answer some questions @zlonast poses? Could we somehow split responsibility for some subtasks or open new tickets for them and leave them undone for now? It would be really great to merge this PR while there still the momentum. |
|
The only unresolved thread that I was able to find in this (rather lengthy) discussion is this: #10969 (comment) started by @mpickering, so, maybe Matt could try to push it forward (or backward :-)) |
|
Sadly, @mpickering may not be able to contribute to this PR any more. @zlonast: how can we help to get it through? |
|
@Mikolaj Hi! As the author, I think it works and we can be merge it 😄 But perhaps you want to pay attention to this:
|
a8f1b13 to
6b7957c
Compare
|
@zlonast thank you for your work here and for the summary in partiular. Quetsions:
This looks rather serious. Can you elaborate with example scenarios? E.g. will I not be able to build any package with c-sources after this change if I need to use 9.4? FTR, we are supposed to maintain ccompatibility with any GHC released last 5 years. GHC 9.4.8 was released 10 November 2023, so there's still 2.5 years of it staying in this support window.
Do you think you could add some? |
6b7957c to
e522b12
Compare
|
This must happen before this pull request is merged.
issue #11712 pr fix #11713
tests #11711 |
e522b12 to
afa91a2
Compare
|
|
afa91a2 to
858d618
Compare
858d618 to
7de85b7
Compare
Refactor componentGhcOptions for pass *-options to all invoking GHC. During the refactoring process we needed to add componentGhcOptions to all Haskell sources. It was also worth add linkGhcOptions to linkLibrary same as componentGhcOptions to linkExecutable, linkFLib. Add test for PackageTests/FFI/ForeignOptsCapi to pass cc-options flags to *.h. Fixes haskell#9801 haskell#4435
|
I found the problem and left a link in this #10969 (comment). I've only left two things in that pr.
I suggest checking the compilation of the entire |
Will close issues #9801 #4435
Main idea #9801 (comment)
cc-options,cxx-options,jspp-options,asm-options,cmm-options,ld-options,cpp-options,should be always passed when invoking GHC, similarly as
ghc-optionsshould be always used wheninvoking
ghc- regardless of what is the intention of a particular GHC-call.GHC might use or not use the options, Cabal cannot know and should not guess.
cc-optionsandcxx-optionsstill need to be separated (C/C++) for versions below 8.10.https://gitlab.haskell.org/ghc/ghc/-/issues/16477
Template Α: This PR modifies behaviour or interface
Include the following checklist in your PR:
significance: significantin the changelog file.Depends-on: #11711
Depends-on: #11713