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

Compilation of Parser.y depends on the locale on Debian too #5465

Closed
edrx opened this issue Jul 2, 2021 · 2 comments · Fixed by #5479
Closed

Compilation of Parser.y depends on the locale on Debian too #5465

edrx opened this issue Jul 2, 2021 · 2 comments · Fixed by #5479
Assignees
Labels
happy Problems with Happy's parser generation type: bug Issues and pull requests about actual bugs upstream ux: installation Getting Agda set up on your machine
Milestone

Comments

@edrx
Copy link

edrx commented Jul 2, 2021

The latest version of the Agda Manual from

https://readthedocs.org/projects/agda/downloads/pdf/latest/

mentions a certain error as something that can only happen on M$ Windows. It says:

Warning: If you are installing Agda using Cabal on Windows,
depending on your system locale setting, cabal install Agda may fail
with an error message:

hGetContents: invalid argument (invalid byte sequence)

If this happens, you can try changing the console code page to UTF-8
using the command:

CHCP 65001

I'm on Debian stable and I got something similar. I tried to install Agda with

cabal update
cabal install Agda

and it failed with:

happy: src/full/Agda/Syntax/Parser/Parser.y: hGetContents: invalid
argument (invalid byte sequence)
cabal: Failed to build Agda-2.6.2. See the build log above for
details.

My default value for $LC_ALL is "C" and the only uncommented line in my /etc/locale.gen is this one:

en_GB.UTF-8 UTF-8

If I run this

export LC_ALL=en_GB.UTF-8
cabal install Agda

instead of just "cabal install Agda" the compilation succeeds.

This is a copy of this bug report that I sent to the mailing list:

https://lists.chalmers.se/pipermail/agda/2021/012689.html

@andreasabel
Copy link
Member

The problem is upstream: haskell/happy#157.

@andreasabel andreasabel added happy Problems with Happy's parser generation ux: installation Getting Agda set up on your machine type: bug Issues and pull requests about actual bugs upstream labels Jul 14, 2021
@andreasabel
Copy link
Member

In head.hackage this is fixed by simply avoiding unicode characters in Parser.y:
https://gitlab.haskell.org/ghc/head.hackage/-/commit/6d0a6c46777414b3f85c59f7c2525bb07348b3ae

andreasabel added a commit that referenced this issue Jul 17, 2021
New command

    make check-encoding

that checks that Parser.y is ASCII (no proper unicode characters).
andreasabel added a commit that referenced this issue Jul 17, 2021
New command

    make check-encoding

that checks that Parser.y is ASCII (no proper unicode characters).
andreasabel added a commit that referenced this issue Jul 17, 2021
This is a workaround for upstream issue

    haskell/happy#157

By sticking to ASCII, we avoid locale issues.
andreasabel added a commit that referenced this issue Jul 17, 2021
New command

    make check-encoding

that checks that Parser.y is ASCII (no proper unicode characters).
andreasabel added a commit that referenced this issue Jul 17, 2021
This is a workaround for upstream issue

    haskell/happy#157

By sticking to ASCII, we avoid locale issues.
@andreasabel andreasabel added this to the 2.6.3 milestone Aug 17, 2021
@andreasabel andreasabel self-assigned this Aug 18, 2021
@andreasabel andreasabel modified the milestones: 2.6.3, 2.6.2.1 Aug 18, 2021
andreasabel added a commit that referenced this issue Nov 17, 2021
New command

    make check-encoding

that checks that Parser.y is ASCII (no proper unicode characters).
andreasabel added a commit that referenced this issue Nov 17, 2021
This is a workaround for upstream issue

    haskell/happy#157

By sticking to ASCII, we avoid locale issues.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
happy Problems with Happy's parser generation type: bug Issues and pull requests about actual bugs upstream ux: installation Getting Agda set up on your machine
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants