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

Remove unused -XCPP #10723

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Conversation

philderbeast
Copy link
Collaborator

@philderbeast philderbeast commented Jan 7, 2025

Fixes #10720, a follow on from #10092. Removes unused {-# LANGUAGE CPP #-} pragmas.


Template B: This PR does not modify behaviour or interface

  • Patches conform to the coding conventions.
  • Is this a PR that fixes CI? If so, it will need to be backported to older cabal release branches (ask maintainers for directions).

Manual QA Notes

Please delete dist-newstyle and run the following to check for occurrences of unused -XCPP:

$ grep '^#if' --files-without-match $(grep -R --files-with-matches 'LANGUAGE.*CPP' */**/*.hs)
cabal-testsuite/PackageTests/Backpack/bkpcabal01/p/P.hs
cabal-testsuite/PackageTests/CabalMacros/Mdl.hs
cabal-testsuite/PackageTests/CmmSources/src/Demo.hs
cabal-testsuite/PackageTests/CmmSourcesDyn/demo/Main.hs
cabal-testsuite/PackageTests/CmmSourcesDyn/src/Demo.hs
cabal-testsuite/PackageTests/CmmSourcesExe/src/Demo.hs
cabal-testsuite/PackageTests/Haddock/CPP.hs
cabal-testsuite/PackageTests/PreProcess/Hsc2HsOptionsCC/Main.hs
cabal-testsuite/PackageTests/Regression/T5386/Foo.hs
Cabal/src/Distribution/Simple/Build/PathsModule/Z.hs

$ grep 'LANGUAGE CPP' Cabal/src/Distribution/Simple/Build/PathsModule/Z.hs
    tell "{-# LANGUAGE CPP #-}\n"

Those in cabal-testsuite/PackageTests are part of tests so should likely stay put and Distribution.Simple.Build.PathsModule.Z is generating a paths module using a zinza template. It's a false positive find with the unrefined grep pattern, LANGUAGE.*CPP.

@ulysses4ever
Copy link
Collaborator

I think the commits should be squashed before merging.

@philderbeast
Copy link
Collaborator Author

I think the commits should be squashed before merging.

Yeah I can do that.

As it stands this pull request has 66 files split into 7 commits, one per package.

We don't release every package at once any more and there's backports that I haven't been involved in. I'm being cautious here. Squashing won't make later maintenance harder, will it?

@Mikolaj and @Kleidukos with changes like this that touch many files, do we have to be careful about consequences outside merging to the master branch?

@Mikolaj
Copy link
Member

Mikolaj commented Jan 11, 2025

I guess squashing may make merging a tiny bit harder in this particular case, but not by much. Generally, I don't think there's any way to minimize conflicts from this PR, so let's just merge it and let others resolve them.

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.

Thank you.

@philderbeast
Copy link
Collaborator Author

so let's just merge it and let others resolve them

Thanks for the approval @Mikolaj. I read that as let's just merge it (squashed) which is what I'll do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Modules enabling -XCPP but not needing it
4 participants