-
Notifications
You must be signed in to change notification settings - Fork 703
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
Restore Distribution.Simple.Build.initialBuildSteps
to Cabal's API
#9856
Comments
Can cabal please add something to their CI so that new releases don't break one of the main consumers of the API? |
@hasufell, I think that (Cabal CI anticipating Stack's use) would be difficult - not least because each version of On one perspective, the 'alpha' process for GHC and its (unreleased) boot packages has 'done its job' in that it has allowed the Stack project to identify this. |
I think it is not correct to manually call The only practical way to create all autogenerated modules that works across all build-types that I can think of right now is to call |
I think you're probably right about its limitations. However, the ticket notes that existing versions of stack will call this via a shim with whatever version of the cabal shipped with ghc is. So we should encourage stack to not do this, for the reasons you enumerate, but we should probably put it back anyway, so as to not break all existing stacks with the new ghc. Perhaps @mpilgrem can correct me if I'm mistaken on this? I see the linked ticket describes a workaround in new stack -- does that suffice, or would it be better to restore this function but perhaps mark it deprecated? |
Thanks @sheaf and @gbaz. I too divide the Stack problem into two parts: (1) Stack continuing to do what it has done in the past; and (2) taking on board @sheaf's analysis here and elsewhere, Stack considering doing something different (to accommodate things other than Cabal's own autogenerated files). That second part will take me a little time to understand why, currently, Stack does not make use of Cabal's If the Cabal project would be willing to do so, I would prefer for the However, I acknowledge that is only to avoid some CPP that currently looks like this: -- | Temporary, can be removed if initialBuildSteps restored to Cabal's API.
-- Based on the functions of the same name provided by Cabal-3.10.3.0.
#if MIN_VERSION_Cabal(3,11,0)
-- | Runs 'componentInitialBuildSteps' on every configured component.
initialBuildSteps ::
FilePath -- ^"dist" prefix
-> PackageDescription -- ^mostly information from the .cabal file
-> LocalBuildInfo -- ^Configuration information
-> Verbosity -- ^The verbosity to use
-> IO ()
initialBuildSteps distPref pkg_descr lbi verbosity =
withAllComponentsInBuildOrder pkg_descr lbi $ \_comp clbi ->
componentInitialBuildSteps distPref pkg_descr lbi clbi verbosity
-- | Creates the autogenerated files for a particular configured component.
componentInitialBuildSteps ::
FilePath -- ^"dist" prefix
-> PackageDescription -- ^mostly information from the .cabal file
-> LocalBuildInfo -- ^Configuration information
-> ComponentLocalBuildInfo
-> Verbosity -- ^The verbosity to use
-> IO ()
componentInitialBuildSteps _distPref pkg_descr lbi clbi verbosity = do
createDirectoryIfMissingVerbose verbosity True (componentBuildDir lbi clbi)
-- Cabal-3.10.3.0 used writeAutogenFiles, that generated and wrote out the
-- Paths_<pkg>.hs, PackageInfo_<pkg>.hs, and cabal_macros.h files. This
-- appears to be the equivalent function for Cabal-3.11.0.0.
writeBuiltinAutogenFiles verbosity pkg_descr lbi clbi
#endif |
I see that |
@mpilgrem you are correct this should have at least been in the release notes, I think this ticket was overlooked. How bad is this for stack? Can you work around until we make up our minds on what to do next? |
@ffaf1, Stack can, I think, work around it - the 'cost' to Stack is only some use of CPP. |
@mpilgrem: Apologies for not signalling earlier nor clearer that this disputed change is now getting, I'm guessing, permanent. We have limited resources and the 3.12 release is late by about half a year, so I'm afraid we had to cut corners regarding communication and even any deeper introspection. Please kindly don't close the issue until we at least fix the release notes (they are on master branch, so they can easily be fixed after the release). Of course, all options are still open and reverting or slow deprecation is still possible, but somebody would have to step up and drive the re-evaluation and reimplementation. Is there anything else we can do to help? Again, that awkward outcome was not intentional, but OTOH quite predictable. |
That seems bad. And I question whether that actually frees any of your time, because you're increasing back and forth communication, delayed releases of other tools etc. |
If this breaks existing stack versions, I think the change should be reverted. Is there any real cost to just do that and marking it deprecated? Then hopefully future versions of stack could avoid using the function. |
I am responsible for the release of First things first: minimise disruption to |
My attempt at a postmortem:
To be clear, I'm personally responsible for some of the missteps on this list, e.g., I saw this ticket early and I did not mark it as "regression in 3.12" on the weak grounds of "not enough info" + "enough eyes" at that early point. |
Lots of projects are scarce on manpower. I think it's also a matter of priorities, awareness and processes. It's time to consider stack a major consumer of Cabal API and act accordingly, not just as an afterthought. Communication/coordination should be the last thing to cut when short on manpower. Cut release frequency and new features, before cutting on communication. |
@ffaf1, I think you are correct: past releases of Stack will not work with versions of GHC that have
@Mikolaj, no need to apologise. I now understand I could have done more to label this issue when I created it. |
We can simply revise past releases with |
Stress an API change is enough to warrant a `changelog.d` entry. Check haskell#9856 to see why we need it.
Stress an API change is enough to warrant a `changelog.d` entry. Check haskell#9856 to see why we need it.
Stress an API change is enough to warrant a `changelog.d` entry. Check haskell#9856 to see why we need it.
Stress an API change is enough to warrant a `changelog.d` entry. Check haskell#9856 to see why we need it.
Stress an API change is enough to warrant a `changelog.d` entry. Check haskell#9856 to see why we need it.
By way of update, a first release candidate of Stack 2.15.7 is now released. |
Stress an API change is enough to warrant a `changelog.d` entry. Check haskell#9856 to see why we need it.
This patch reinstates the 'initialBuildSteps' function, as it is used by stack in its implementation of the multi-repl feature. A warning has been added to that function: calling it does not suffice to prepare the sources for a package, as there are other steps that one might also need to perform: - running pre-processors (such as alex/happy) - running pre-build hooks or custom logic (in build-type: Hooks or build-type: Custom or Configure) Fixes #9856
This patch reinstates the 'initialBuildSteps' function, as it is used by stack in its implementation of the multi-repl feature. A warning has been added to that function: calling it does not suffice to prepare the sources for a package, as there are other steps that one might also need to perform: - running pre-processors (such as alex/happy) - running pre-build hooks or custom logic (in build-type: Hooks or build-type: Custom or Configure) Fixes #9856
I have put up #9950 to re-instate |
This patch reinstates the 'initialBuildSteps' function, as it is used by stack in its implementation of the multi-repl feature. A warning has been added to that function: calling it does not suffice to prepare the sources for a package, as there are other steps that one might also need to perform: - running pre-processors (such as alex/happy) - running pre-build hooks or custom logic (in build-type: Hooks or build-type: Custom or Configure) Consumers wanting to prepare the sources of a package, e.g. in order to launch a REPL session, are advised to run @setup repl --repl-multi-file=<fn>@ instead. Fixes #9856
This patch reinstates the 'initialBuildSteps' function, as it is used by stack in its implementation of the multi-repl feature. A warning has been added to that function: calling it does not suffice to prepare the sources for a package, as there are other steps that one might also need to perform: - running pre-processors (such as alex/happy) - running pre-build hooks or custom logic (in build-type: Hooks or build-type: Custom or Configure) Consumers wanting to prepare the sources of a package, e.g. in order to launch a REPL session, are advised to run `Setup repl --repl-multi-file=<fn>` instead. Fixes #9856
This patch reinstates the 'initialBuildSteps' function, as it is used by stack in its implementation of the multi-repl feature. A deprecation warning has been added to that function: calling it does not suffice to prepare the sources for a package, as there are other steps that one might also need to perform: - running pre-processors (such as alex/happy) - running pre-build hooks or custom logic (in build-type: Hooks or build-type: Custom or Configure) Consumers wanting to prepare the sources of a package, e.g. in order to launch a REPL session, are advised to run `Setup repl --repl-multi-file=<fn>` instead. Fixes #9856
This patch reinstates the 'initialBuildSteps' function, as it is used by stack in its implementation of the multi-repl feature. A deprecation warning has been added to that function: calling it does not suffice to prepare the sources for a package, as there are other steps that one might also need to perform: - running pre-processors (such as alex/happy) - running pre-build hooks or custom logic (in build-type: Hooks or build-type: Custom or Configure) Consumers wanting to prepare the sources of a package, e.g. in order to launch a REPL session, are advised to run `Setup repl --repl-multi-file=<fn>` instead. Fixes #9856
While we finalize the proper gentle deprecation of the abruptly cut out feature (@sheaf: thank you very much for stepping up; anybody else: we are keen to hear your opinion), the changelogs/release notes have been fixed: https://hackage.haskell.org/package/Cabal-3.12.0.0/changelog |
Edit: Replying to deleted comment by juhp:
That's what I'm doing in #9950. |
Isn't this a runtime issue, that's how I understood it. @mpilgrem it will hit Stackage Nightly rather sooner, so I feel you are being optimistic. |
@juhp: I'm having trouble understanding from your comments if you are bringing up new issues we've missed or confirming we are addressing your past remarks properly. Would it be too much for me to ask you do go through your past two comments and either edit them or clarify who they are addressed to and what's the point you'd like to underscore? Thank you. |
Sorry I was commenting on my phone - With the revert I think all should be well. Thank you @sheaf! |
@juhp, noted and agreed on Stackage Nightly coming sooner than LTS but I still think it is manageable, because:
|
This patch reinstates the 'initialBuildSteps' function, as it is used by stack in its implementation of the multi-repl feature. A deprecation warning has been added to that function: calling it does not suffice to prepare the sources for a package, as there are other steps that one might also need to perform: - running pre-processors (such as alex/happy) - running pre-build hooks or custom logic (in build-type: Hooks or build-type: Custom or Configure) Consumers wanting to prepare the sources of a package, e.g. in order to launch a REPL session, are advised to run `Setup repl --repl-multi-file=<fn>` instead. Fixes #9856
This patch reinstates the 'initialBuildSteps' function, as it is used by stack in its implementation of the multi-repl feature. A deprecation warning has been added to that function: calling it does not suffice to prepare the sources for a package, as there are other steps that one might also need to perform: - running pre-processors (such as alex/happy) - running pre-build hooks or custom logic (in build-type: Hooks or build-type: Custom or Configure) Consumers wanting to prepare the sources of a package, e.g. in order to launch a REPL session, are advised to run `Setup repl --repl-multi-file=<fn>` instead. Fixes #9856
This patch reinstates the 'initialBuildSteps' function, as it is used by stack in its implementation of the multi-repl feature. A deprecation warning has been added to that function: calling it does not suffice to prepare the sources for a package, as there are other steps that one might also need to perform: - running pre-processors (such as alex/happy) - running pre-build hooks or custom logic (in build-type: Hooks or build-type: Custom or Configure) Consumers wanting to prepare the sources of a package, e.g. in order to launch a REPL session, are advised to run `Setup repl --repl-multi-file=<fn>` instead. Fixes #9856 (cherry picked from commit dd74e92) # Conflicts: # Cabal/src/Distribution/Simple/Build.hs
This patch reinstates the 'initialBuildSteps' function, as it is used by stack in its implementation of the multi-repl feature. A deprecation warning has been added to that function: calling it does not suffice to prepare the sources for a package, as there are other steps that one might also need to perform: - running pre-processors (such as alex/happy) - running pre-build hooks or custom logic (in build-type: Hooks or build-type: Custom or Configure) Consumers wanting to prepare the sources of a package, e.g. in order to launch a REPL session, are advised to run `Setup repl --repl-multi-file=<fn>` instead. Fixes #9856 (cherry picked from commit dd74e92) # Conflicts: # Cabal/src/Distribution/Simple/Build.hs
This patch reinstates the 'initialBuildSteps' function, as it is used by stack in its implementation of the multi-repl feature. A deprecation warning has been added to that function: calling it does not suffice to prepare the sources for a package, as there are other steps that one might also need to perform: - running pre-processors (such as alex/happy) - running pre-build hooks or custom logic (in build-type: Hooks or build-type: Custom or Configure) Consumers wanting to prepare the sources of a package, e.g. in order to launch a REPL session, are advised to run `Setup repl --repl-multi-file=<fn>` instead. Fixes #9856 (cherry picked from commit dd74e92)
Stress an API change is enough to warrant a `changelog.d` entry. Check haskell#9856 to see why we need it.
This patch reinstates the 'initialBuildSteps' function, as it is used by stack in its implementation of the multi-repl feature. A deprecation warning has been added to that function: calling it does not suffice to prepare the sources for a package, as there are other steps that one might also need to perform: - running pre-processors (such as alex/happy) - running pre-build hooks or custom logic (in build-type: Hooks or build-type: Custom or Configure) Consumers wanting to prepare the sources of a package, e.g. in order to launch a REPL session, are advised to run `Setup repl --repl-multi-file=<fn>` instead. Fixes #9856 (cherry picked from commit dd74e92)
Stack 2.15.7 is required to use GHC 9.10.1, as detailed in the following issues: * commercialhaskell/stack#6540 * haskell/cabal#9856
#9474 removed
initialBuildSteps
as unused, and it is absent fromCabal-3.11.0.0
(ships with GHC 9.10.0.20240328), but the function is used by Stack in the 'shim' that itputs in place to set upuses to cause Cabal to create the autogenerated files for every configured component, without building everything else: commercialhaskell/stack#6540.Setup.hs repl
Please can the function be restored to Cabal's API. Elsewhere (Matrix), @alt-romes has indicated that should be possible, tagging @sheaf.
The text was updated successfully, but these errors were encountered: