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

Unicode in package name causes build failure #5795

Open
edsko opened this issue Dec 15, 2018 · 10 comments
Open

Unicode in package name causes build failure #5795

edsko opened this issue Dec 15, 2018 · 10 comments

Comments

@edsko
Copy link
Contributor

edsko commented Dec 15, 2018

When I named my package Query书法字典, reading the generated paths module goes wrong:

# cabal new-build all
Build profile: -w ghc-8.6.3 -O1
In order, the following will be built (use -v for more details):
 - Query书法字典-0.1.0.0 (exe:Query书法字典) (first run)
/home/edsko/personal/doc/calligraphy/Query书法字典/dist-newstyle/build/x86_64-linux/ghc-8.6.3/Query书法字典-0.1.0.0/x/Query书法字典/build/Query书法字典/autogen/Paths_Query书法字典.hs: hGetContents: invalid argument (invalid byte sequence)
@phadej
Copy link
Collaborator

phadej commented Dec 15, 2018

To be sure, if you have a package with non-generated non-ascii module name, those work ok? on your OS (seems linux) / file-system

@edsko
Copy link
Contributor Author

edsko commented Dec 15, 2018

Just tried. Created a package with non-ASCII characters in the package name but nowhere else. It fails somewhere else now:

[head 8.6.3 ~/personal/doc/calligraphy/t]
# cabal new-build all
Resolving dependencies...
Build profile: -w ghc-8.6.3 -O1
In order, the following will be built (use -v for more details):
 - Q嘿-0.1.0.0 (exe:Qhei) (first run)
Configuring executable 'Qhei' for Q嘿-0.1.0.0..
Saved package config file header is corrupt. Re-run the 'configure' command.

Not entirely sure why the difference (maybe it's just not building the paths module)?

@edsko
Copy link
Contributor Author

edsko commented Dec 15, 2018

Mind you, this is not exactly high priority :)

@phadej
Copy link
Collaborator

phadej commented Dec 15, 2018

I see. So I tried locally and unicode module names are completely ok, but it's indeed the package-name which makes cabal not work.

It's indeed not high priority as Hackage forbids non-Ascii package names.

@edsko
Copy link
Contributor Author

edsko commented Dec 15, 2018

Ah, didn't even realize that. In that case I guess the only thing to do here is better error reporting.

@phadej
Copy link
Collaborator

phadej commented Dec 15, 2018

It would be good if they would work. Properly upporting unicode in the executable / library would highlight places were we implicitly make assumptions which we shouldn't (at least in 2018+)

In any case, if someone wants to see what's corrupted, the

cabal-version: 2.4
name: package-олег
version: 0

library
  default-language: Haskell2010
  build-depends: base

is a single file reproducible case.

@hvr

This comment has been minimized.

@edsko
Copy link
Contributor Author

edsko commented Dec 17, 2018

Turns out probably not a duplicate after all; see #5804 (comment) .

@hvr hvr marked this as not a duplicate of #2557 Dec 17, 2018
@hvr
Copy link
Member

hvr commented Dec 17, 2018

@edsko yes, it appears there are multiple bugs at play here :-)

@edsko
Copy link
Contributor Author

edsko commented Dec 17, 2018

Once you start using Chinese names in Haskell projects you start to realize quite how Western-biased we are :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants