Adding an explicit pgmc flag for interaction with GHC#11713
Adding an explicit pgmc flag for interaction with GHC#11713zlonast wants to merge 1 commit intohaskell:masterfrom
Conversation
d777763 to
ea2ac23
Compare
f101073 to
7e400d4
Compare
fbec784 to
250c39d
Compare
|
I found out why it started working and why it didn't work before. Since 9.4 it works like this: From 8.8 to 9.2 it worked like this: This didn't work before 8.8: |
e929e22 to
4d55bb2
Compare
|
I will do my best to take a look at this PR soon. |
4d55bb2 to
7e0b5ad
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates Cabal’s GHC invocation to pass an explicit -pgmc (C compiler program) for GHC ≥ 9.4, with accompanying tests and output normalization to keep the testsuite stable.
Changes:
- Add version-gated
-pgmcinjection tocomponentGhcOptions(GHC ≥ 9.4). - Update
show-build-infogolden tests (split expectations across GHC versions) and normalize-pgmcpaths in JSON output. - Add a new FFI regression test case that verifies
-pgmcwrapper usage.
Reviewed changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| changelog.d/11713.md | Changelog entry describing the -pgmc-related behavior change. |
| cabal-testsuite/src/Test/Cabal/OutputNormalizer.hs | Normalizes -pgmc argument paths in show-build-info JSON output. |
| cabal-testsuite/PackageTests/ShowBuildInfo/Custom/custom.test.hs | Formatting-only adjustments to the test script. |
| cabal-testsuite/PackageTests/ShowBuildInfo/Complex/single.test.hs | Restricts the existing golden test to GHC ≥ 9.4 (where -pgmc now appears). |
| cabal-testsuite/PackageTests/ShowBuildInfo/Complex/single.out | Updates golden output to include normalized -pgmc for GHC ≥ 9.4. |
| cabal-testsuite/PackageTests/ShowBuildInfo/Complex/single-2.test.hs | Adds a new golden test variant for GHC 9.2.x (caret-bounded) without -pgmc. |
| cabal-testsuite/PackageTests/ShowBuildInfo/Complex/single-2.out | New golden output matching the GHC 9.2.x behavior. |
| cabal-testsuite/PackageTests/FFI/ForeignOptsPgmc/scripts/cc-wrapper.sh | Adds a shell wrapper used to validate -pgmc selection in tests. |
| cabal-testsuite/PackageTests/FFI/ForeignOptsPgmc/foreign-opts-pgmc.cabal | New test package using ghc-options: -pgmc scripts/cc-wrapper.sh. |
| cabal-testsuite/PackageTests/FFI/ForeignOptsPgmc/cbits/pgmclib.h | New C header for the FFI test. |
| cabal-testsuite/PackageTests/FFI/ForeignOptsPgmc/cbits/pgmclib.c | New C source asserting the wrapper-injected define is present. |
| cabal-testsuite/PackageTests/FFI/ForeignOptsPgmc/cabal.test.hs | New testsuite driver for the FFI -pgmc scenario. |
| cabal-testsuite/PackageTests/FFI/ForeignOptsPgmc/cabal.project | New cabal.project for the test package. |
| cabal-testsuite/PackageTests/FFI/ForeignOptsPgmc/cabal.out | Empty golden output placeholder for the new test. |
| cabal-testsuite/PackageTests/FFI/ForeignOptsPgmc/README.md | Documents the intent and mechanics of the new FFI test. |
| cabal-testsuite/PackageTests/FFI/ForeignOptsPgmc/Main.hs | New Haskell FFI entrypoint that checks the wrapper-injected value at runtime. |
| Cabal/src/Distribution/Simple/GHC/Internal.hs | Adds ghcOptionsSince helper and sets ghcOptCcProgram (i.e. -pgmc) for GHC ≥ 9.4. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| cwd <- fmap testCurrentDir getTestEnv | ||
| let wrapper = cwd </> "scripts/cc-wrapper.sh" |
There was a problem hiding this comment.
wrapper is defined but never used. This produces an unnecessary -Wunused-local-binds warning under the testsuite’s -Wall settings; either remove the binding or use it (e.g., to assert the wrapper exists / is executable, or to pass it explicitly via configuration).
| cwd <- fmap testCurrentDir getTestEnv | |
| let wrapper = cwd </> "scripts/cc-wrapper.sh" |
There was a problem hiding this comment.
Yes, I missed that.
7e0b5ad to
598702c
Compare
Issue #11712
Main idea #9801 (comment)
Template Α: This PR modifies behaviour or interface
Include the following checklist in your PR:
significance: significantin the changelog file.