Skip to content

fix(Cabal-syntax): Remove left-over file after #8980 #9198

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

Merged
merged 1 commit into from
Sep 7, 2023

Conversation

andreabedini
Copy link
Collaborator

In #8980 we started generating Lexer.hs with Cabal rather than as a external step. That PR forgets to remove the generatex file though which this PR rectifies.

Closes #9196

PS: now I wonder whether Cabal should complain/fail if an auto-generated file is already present in the source distribution. 🤔

@andreabedini andreabedini self-assigned this Aug 23, 2023
@mpickering mpickering self-requested a review August 23, 2023 08:25
Copy link
Collaborator

@mpickering mpickering left a comment

Choose a reason for hiding this comment

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

Thanks @andreabedini

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.

LGTM. Please feel free to set the merge_me label.

@andreabedini andreabedini added merge me Tell Mergify Bot to merge and removed attention: needs-review labels Sep 4, 2023
@mergify mergify bot added the merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days label Sep 6, 2023
@mergify mergify bot merged commit 24f336d into haskell:master Sep 7, 2023
@Bodigrim
Copy link
Collaborator

Bodigrim commented Sep 17, 2023

It seems this change breaks GHC bootstrapping process: https://gitlab.haskell.org/ghc/ghc/-/jobs/1665720#L5755

Without Lexer.hs one cannot bootstrap GHC on a new platform, which does not have Alex available (because, well, it does not have GHC available yet).

Relevant part of https://gitlab.haskell.org/ghc/ghc/-/blob/master/.gitlab-ci.yml#L691:

    # Bootstrapping should not depend on HAPPY or ALEX so set them to false
    # so the build fails if they are invoked.
    - export HAPPY=/bin/false; export ALEX=/bin/false

Could Lexer.hs please be restored back?

@Bodigrim
Copy link
Collaborator

Just restoring Lexer.hs does not help, because now there are both Lexer.hs and Lexer.x in the same folder. I'm afraid we need to revert key parts of #8980, moving Lexer.x back to boot/ folder and restoring Makefile rule.

@mpickering
Copy link
Collaborator

@Bodigrim I will look into this tomorrow about whether we need to patch hadrian to resolve this.

@andreabedini
Copy link
Collaborator Author

I believe @hamishmack had run into this issue with Hadrian already and make a fix in Haskell.nix.
I'll look at this today too.

@hamishmack
Copy link
Collaborator

I only made a branch of GHC that bumped the Cabal submodule to a version with this PR. https://gitlab.haskell.org/hamishmack/ghc/-/tree/hkm/bump-Cabal

@andreabedini
Copy link
Collaborator Author

@Bodigrim @mpickering Is the quoted comment still applicable/relevant?

I admit that I don't have much experience with boostrapping or cross-compiling but I ask because just before that we bootstrap hadrian:

    - python3 ./hadrian/bootstrap/bootstrap.py -w $GHC --bootstrap-sources hadrian-bootstrap-sources-$GHC_VERSION.tar.gz
    - export HADRIAN_PATH="$PWD/_build/bin/hadrian"
    - .gitlab/ci.sh setup
    # Bootstrapping should not depend on HAPPY or ALEX so set them to false
    # so the build fails if they are invoked.

and, in this repository, we have tests to check we can bootstrap cabal-install in the same way (which also builds Cabal-syntax).

Cannot Cabal-syntax be compiled exactly as we compile hadrian? I am happy to help with figuring out build plans it that's of any help.

@mpickering
Copy link
Collaborator

@Mikolaj
Copy link
Member

Mikolaj commented Sep 27, 2023

Any progress here? This sounds mildly alarming, but I have no clue.

@mpickering
Copy link
Collaborator

This was fixed on the ghc side and we successfully bumped the Cabal submodule.

@Mikolaj
Copy link
Member

Mikolaj commented Sep 27, 2023

Oh, so I assume there's nothing to do cabal-side. Great, so this PR is closed-closed.

@andreabedini andreabedini deleted the remove-lexer-hs branch October 2, 2023 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days merge me Tell Mergify Bot to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cabal-syntax/src/Distribution/Fields/Lexer.x and .hs exist
5 participants