-
Notifications
You must be signed in to change notification settings - Fork 701
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
What's the correct way to build Cabal and alex? #4633
Comments
Oh, I didn't realize that it was gated behind the |
The proposed solution in #4654 is to commit a copy of the alex-generated files to the repo, allowing us to remove I am a bit concerned about the effects of checking in automatically generated files on the development process; the obvious issues are (1) depending on what version of alex is used, the output could wobble unnecessarily, and (2) it makes merge conflicts a bit more painful. I was under the impression that Cabal had some affordance for including generated files in sdists, so it wouldn't be necessary to commit them into the repo. See for example #2940 where @simonmar makes reference to this feature. However, @hvr is not at all sure how this works at all (maybe Cabal will still be willing to use an installed alex even if it's not build-tool'ed). |
Fwiw, I consider what we do in #4654 a temporary workaround (i.e. I don't like the idea to check in generated artifacts into Git either). And yes, cabal may sometimes pick up an Alex on $PATH, but I consider that to be a bug that I intend to fix before 2.2 gets released; the way it works now is not principled. And as for, "Cabal had some affordance for including generated files in sdists"; I want to get rid of that too; there's no good reason to support this in Cabal proper anymore. The 2 very special corner cases I know are better handled by using a custom release generation process, rather than burden lib:Cabal by it. |
@hvr, but since this was advertised as a feature, and because packages rely on it, any such fix would be gated by cabal-version, right? |
@ezyang where exactly is it advertised as a feature? (and yes, it'd be gated via cabal-version where it's essential to not render packages already on Hackage invalid; but that still needs to be evaluated). |
Looking at https://cabal.readthedocs.io/en/latest/developing-packages.html#modules-and-preprocessors it is not specified that it is necessary to mention these hardcoded preprocessors in build-tools. |
Fair enough, and neither did and btw, I'm revising .cabal files on Hackage to retroactively add those missing |
@hvr, checking in isn't required, then one just need to update HOWTOs. After all, we already have |
@phadej sure, but this has implications for the GHC buildsystem too; so long-term I'd rather fix the problem at the root, i.e. have alex/happy fixed to be properly installable, rather than having to workaround this by a hack in lib:Cabal. I want to reduce the technical debt, rather than grow it. |
I'm all in favor of more reproudcible build plans, but I'm not sure I understand the proposal here. Is the idea that Cabal will only elect to generate code from Alex input files if Cabal itself built and installed the |
FWIW |
thanks for update the issue, i think we can close this one, feel free to reopen if the relationship between Cabal and alex continue giving build problems |
Sorry for the somewhat vague question, but I'm not sure what the expected behavior is. With Cabal-2.0.0.2 and alex-3.2.1, we have this situation:
Naively, this is a cyclic dependency. I can see a few ways of getting this both to build:
I may simply be missing out on something obvious here.
The text was updated successfully, but these errors were encountered: