-
Notifications
You must be signed in to change notification settings - Fork 697
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
Only use cpphs for .cpphs files #8383
base: master
Are you sure you want to change the base?
Conversation
Would there be a way to cheaply test this in our test suite? Is it blocking you and would a backport to 3.8 potentially help? |
@@ -24,7 +24,7 @@ module Distribution.Simple.PreProcess (preprocessComponent, preprocessExtras, | |||
knownSuffixHandlers, ppSuffixes, | |||
PPSuffixHandler, PreProcessor(..), | |||
mkSimplePreProcessor, runSimplePreProcessor, | |||
ppCpp, ppCpp', ppGreenCard, ppC2hs, ppHsc2hs, | |||
ppCpp, ppCpp', ppGhcCpp, ppGreenCard, ppC2hs, ppHsc2hs, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's this export for? Is the function now unused and could be deleted instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I figured users might want it - seemed safest to allow it in custom Setup.hs
if they really want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm I'd tend to not extend the API unless there's a clear need (and we add some test coverage). But it's not for me to decide.
@Mikolaj I'd say a backpack to 3.8 would be useful, yes! GHC 9.4.1 has a bug in its preprocessor. |
3.8 is the Cabal version shipped with 9.4.1. Backport to 3.6 is not likely. An option is include this PR only in 3.10 that is not yet even planned, but I gather we'd want to avoid that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In principle the change looks fine to me, but I don't understand the topic well enough to give a full review -- this change does seem to have the potential break things.
It's a bit unfortunate that there doesn't seem to be any pre-existing test coverage for .cpphs
files, that would make things a bit easier to evaluate.
Let me rebase to include a workaround to our CI instability and fix the tests. |
@mergify rebase |
✅ Branch has been successfully rebased |
05d16d7
to
b6b777f
Compare
Wow: it just said that it was me who pushed the rebased committs?.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A test, please.
By principle, every new feature and every bug fix needs a test to secure it from rotting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, once we have a test, it's good to go.
BTW, we are ready to assist with modifying an existing test or writing a new one. |
Has anyone thought about what would a test amount to? For one (it seems to me), it'd require |
I don't know. Perhaps the new feature for specifying an exe build dependency would be enough (forgot how it's called). I mean, perhaps we could add |
@Mikolaj my impression (correct me if I'm wrong) was that those cabal files don't have access to Hackage; see FAQ for the testsuite, Q#3. |
Right, I now remember a discussion when somebody wanted the access to check messages from |
It's very small, both in terms of dependency footprint and in terms of code size. On my laptop it took several seconds to build. And yes, it'd probably be in the cache all the time. It's not the build time that I'm concerned about, but just expanding the CI script, and the precedent of doing that for a single test. But maybe it's not worth worrying. |
Let's expand this one last time. :) |
(Apologies if I'm talking out of turn here -- just ignore me. By some cosmic coincidence -- spotted by @vmchale -- a few days ago I found
|
Marking this PR as draft 🙂 |
This addresses #4278. I think mboes is correct and it should simply fail to process
.cpphs
files ifcpphs
is not available, especially since new-build andbuild-tool-depends: cpphs:cpphs
Tested by building the exe and running it locally.