Skip to content

Adding an explicit pgmcxx flag for interaction with GHC#11763

Merged
mergify[bot] merged 1 commit into
haskell:masterfrom
zlonast:zlonast/pgmcxx-option
Jun 7, 2026
Merged

Adding an explicit pgmcxx flag for interaction with GHC#11763
mergify[bot] merged 1 commit into
haskell:masterfrom
zlonast:zlonast/pgmcxx-option

Conversation

@zlonast

@zlonast zlonast commented Apr 24, 2026

Copy link
Copy Markdown
Collaborator

Add an explicit pgmcxx flag to Cabal's GHC invocation logic. This aligns
with the existing pgmc behavior and accounts for the GHC 9.4+ toolchain
requirements, resolving inconsistencies in how C++ compiler options are handled.

This change allows users to remove extra-libraries: stdc++ from their
configuration files, as g++ automatically handles C++ standard library
linking, unlike the legacy approach of invoking C++ via gcc.

Main idea #9801 (comment)

IMHO, cc-options (and ld-options and cpp-options and ...) should be always passed when invoking GHC, similarly as ghc-options should be always used when invoking 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.

Template Α: This PR modifies behaviour or interface

Include the following checklist in your PR:

@zlonast zlonast force-pushed the zlonast/pgmcxx-option branch 2 times, most recently from 8fc0a6f to 92d0cb0 Compare April 24, 2026 13:33
@zlonast zlonast force-pushed the zlonast/pgmcxx-option branch from 92d0cb0 to 124be87 Compare May 9, 2026 10:41
@zlonast

zlonast commented May 9, 2026

Copy link
Copy Markdown
Collaborator Author

This pr is a logical continuation of this #11713

@zlonast zlonast force-pushed the zlonast/pgmcxx-option branch from 124be87 to 729c3d7 Compare May 17, 2026 08:15
@zlonast zlonast marked this pull request as ready for review May 17, 2026 08:15
@zlonast zlonast requested review from ffaf1 and sheaf May 17, 2026 08:16
@zlonast zlonast added attention: needs-review re: ghc-options Concerning passing options to GHC re: ghc 9.4 Concerning GHC 9.4 cabal-install: v2-build system Affecting v2-build and related commands that use v2-architecture (aka "nix local builds"). labels May 17, 2026
@zlonast zlonast force-pushed the zlonast/pgmcxx-option branch from 729c3d7 to 62cd6cb Compare May 24, 2026 08:58
Comment thread Cabal/src/Distribution/Simple/GHC/Internal.hs
Comment thread Cabal/src/Distribution/Simple/GHC/Internal.hs Outdated
Comment thread Cabal/src/Distribution/Simple/GHC/Internal.hs
Comment thread cabal-testsuite/PackageTests/FFI/ForeignOptsPgmcxx/foreign-opts-pgmcxx.cabal Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@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.

Thank you.

Comment thread cabal-testsuite/PackageTests/FFI/ForeignOptsPgmcxx/Main.hs Outdated
@zlonast zlonast force-pushed the zlonast/pgmcxx-option branch 2 times, most recently from d0941f3 to 18adf96 Compare June 4, 2026 18:52
@zlonast zlonast force-pushed the zlonast/pgmcxx-option branch from 18adf96 to c596c67 Compare June 4, 2026 18:59
@zlonast zlonast added the merge me Tell Mergify Bot to merge label Jun 4, 2026
@mergify mergify Bot added ready and waiting Mergify is waiting out the cooldown period merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days labels Jun 4, 2026
@mergify mergify Bot added the queued label Jun 6, 2026
@mergify

mergify Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 11 minutes 30 seconds in the queue, including 36 seconds running CI.

Waiting for
  • any of: [🛡 GitHub branch protection]
    • check-neutral = Doctest Cabal
    • check-skipped = Doctest Cabal
    • check-success = Doctest Cabal
  • any of: [🛡 GitHub branch protection]
    • check-neutral = Meta checks
    • check-skipped = Meta checks
    • check-success = Meta checks
  • any of: [🛡 GitHub branch protection]
    • check-neutral = docs/readthedocs.org:cabal
    • check-skipped = docs/readthedocs.org:cabal
    • check-success = docs/readthedocs.org:cabal
  • any of: [🛡 GitHub branch protection]
    • check-neutral = Validate post job
    • check-skipped = Validate post job
    • check-success = Validate post job
  • any of: [🛡 GitHub branch protection]
    • check-neutral = fourmolu
    • check-skipped = fourmolu
    • check-success = fourmolu
  • any of: [🛡 GitHub branch protection]
    • check-neutral = hlint
    • check-skipped = hlint
    • check-success = hlint
  • any of: [🛡 GitHub branch protection]
    • check-neutral = Bootstrap post job
    • check-skipped = Bootstrap post job
    • check-success = Bootstrap post job
  • any of: [🛡 GitHub branch protection]
    • check-neutral = Changelogs
    • check-skipped = Changelogs
    • check-success = Changelogs
All conditions
  • any of [🛡 GitHub branch protection]:
    • check-neutral = Doctest Cabal
    • check-skipped = Doctest Cabal
    • check-success = Doctest Cabal
  • any of [🛡 GitHub branch protection]:
    • check-neutral = Meta checks
    • check-skipped = Meta checks
    • check-success = Meta checks
  • any of [🛡 GitHub branch protection]:
    • check-neutral = docs/readthedocs.org:cabal
    • check-skipped = docs/readthedocs.org:cabal
    • check-success = docs/readthedocs.org:cabal
  • any of [🛡 GitHub branch protection]:
    • check-neutral = Validate post job
    • check-skipped = Validate post job
    • check-success = Validate post job
  • any of [🛡 GitHub branch protection]:
    • check-neutral = fourmolu
    • check-skipped = fourmolu
    • check-success = fourmolu
  • any of [🛡 GitHub branch protection]:
    • check-neutral = hlint
    • check-skipped = hlint
    • check-success = hlint
  • any of [🛡 GitHub branch protection]:
    • check-neutral = Bootstrap post job
    • check-skipped = Bootstrap post job
    • check-success = Bootstrap post job
  • any of [🛡 GitHub branch protection]:
    • check-neutral = Changelogs
    • check-skipped = Changelogs
    • check-success = Changelogs
  • #approved-reviews-by >= 2 [🛡 GitHub branch protection]
  • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
  • any of [🛡 GitHub branch protection]:
    • check-success = whitespace
    • check-neutral = whitespace
    • check-skipped = whitespace
  • any of [🛡 GitHub branch protection]:
    • check-success = Check sdist post job
    • check-neutral = Check sdist post job
    • check-skipped = Check sdist post job

Reason

The merge conditions cannot be satisfied due to failing checks

Failing checks:

Hint

You may have to fix your CI before adding the pull request to the queue again.
If you update this pull request, to fix the CI, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

mergify Bot added a commit that referenced this pull request Jun 6, 2026
@mergify mergify Bot added dequeued and removed queued labels Jun 6, 2026
@zlonast

zlonast commented Jun 7, 2026

Copy link
Copy Markdown
Collaborator Author

@Mergifyio queue

@mergify

mergify Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 1 hour 49 minutes 54 seconds in the queue, including 1 hour 38 minutes 4 seconds running CI.

Required conditions to merge
  • #approved-reviews-by >= 2 [🛡 GitHub branch protection]
  • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
  • any of [🛡 GitHub branch protection]:
    • check-success = Doctest Cabal
    • check-neutral = Doctest Cabal
    • check-skipped = Doctest Cabal
  • any of [🛡 GitHub branch protection]:
    • check-success = Meta checks
    • check-neutral = Meta checks
    • check-skipped = Meta checks
  • any of [🛡 GitHub branch protection]:
    • check-success = docs/readthedocs.org:cabal
    • check-neutral = docs/readthedocs.org:cabal
    • check-skipped = docs/readthedocs.org:cabal
  • any of [🛡 GitHub branch protection]:
    • check-success = Validate post job
    • check-neutral = Validate post job
    • check-skipped = Validate post job
  • any of [🛡 GitHub branch protection]:
    • check-success = fourmolu
    • check-neutral = fourmolu
    • check-skipped = fourmolu
  • any of [🛡 GitHub branch protection]:
    • check-success = hlint
    • check-neutral = hlint
    • check-skipped = hlint
  • any of [🛡 GitHub branch protection]:
    • check-success = Bootstrap post job
    • check-neutral = Bootstrap post job
    • check-skipped = Bootstrap post job
  • any of [🛡 GitHub branch protection]:
    • check-success = whitespace
    • check-neutral = whitespace
    • check-skipped = whitespace
  • any of [🛡 GitHub branch protection]:
    • check-success = Check sdist post job
    • check-neutral = Check sdist post job
    • check-skipped = Check sdist post job
  • any of [🛡 GitHub branch protection]:
    • check-success = Changelogs
    • check-neutral = Changelogs
    • check-skipped = Changelogs

@mergify mergify Bot added queued and removed dequeued labels Jun 7, 2026
mergify Bot added a commit that referenced this pull request Jun 7, 2026
@mergify mergify Bot merged commit e08f28b into haskell:master Jun 7, 2026
83 checks passed
@mergify mergify Bot removed the queued label Jun 7, 2026
@zlonast zlonast deleted the zlonast/pgmcxx-option branch June 8, 2026 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

attention: needs-review cabal-install: v2-build system Affecting v2-build and related commands that use v2-architecture (aka "nix local builds"). merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days merge me Tell Mergify Bot to merge re: ghc 9.4 Concerning GHC 9.4 re: ghc-options Concerning passing options to GHC ready and waiting Mergify is waiting out the cooldown period

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automatically set --pgmcxx for C++ sources when a C++ compiler is available

5 participants