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

Stack 2.1.1 fails to build package with non-ascii module name #4938

Open
bjornbm opened this issue Jul 4, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@bjornbm
Copy link

commented Jul 4, 2019

General summary/comments (optional)

Stack 2.1.1 fails to build when module names contain ä. Stack 1.9.3 does NOT fail.

Steps to reproduce

  1. Clone https://github.com/bjornbm/umlaut-stack.git
  2. stack build --verbose

Expected

A successful build.

Actual

The build fails with (last lines of output, for full output see gist):

2019-07-04 22:13:21.591710: [info] Linking .stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/umlaut-exe/umlaut-exe ...
2019-07-04 22:13:23.467465: [debug] Process finished in 4757ms: /Users/bjorn/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.5 --builddir=.stack-work/dist/x86_64-osx/Cabal-2.4.0.1 build lib:umlaut exe:umlaut-exe --ghc-options ""
2019-07-04 22:13:23.468057: [debug] Start: getPackageFiles /Users/bjorn/repos/umlaut/umlaut.cabal
2019-07-04 22:13:23.470598: [debug] Finished with exception in 2ms: getPackageFiles /Users/bjorn/repos/umlaut/umlaut.cabal
Exception thrown: ModuleName.fromComponents: invalid components ["T\195\164st"]
CallStack (from HasCallStack):
  error, called at ./Distribution/ModuleName.hs:105:46 in Cabal-2.4.0.1-3bZfb3D11r2LsqHGk5ybV3:Distribution.ModuleName
2019-07-04 22:13:23.473932: [error] ModuleName.fromComponents: invalid components ["T\195\164st"]
CallStack (from HasCallStack):
  error, called at ./Distribution/ModuleName.hs:105:46 in Cabal-2.4.0.1-3bZfb3D11r2LsqHGk5ybV3:Distribution.ModuleName

The error is reported by a cabal function ModuleName.fromComponents, but since the ChangeLog.md says that Cabal 2.4 has been used since stack-1.9.1 I assume there is a change in how stack passes the module names to cabal.

May be related to UTF normalisation? (ore the absence thereof?)

Interestingly if the Täst module is imported by Main.hs instead of Lib.hs the build completes just fine (see branch named "works").

Stack version

$ stack --version
Version 2.1.1, Git revision f612ea85316bbc327a64e4ad8d9f0b150dc12d4b (7648 commits) x86_64 hpack-0.31.2

Method of installation

stack upgrade --force-download

@qrilka

This comment has been minimized.

Copy link
Contributor

commented Jul 4, 2019

Thanks for the report! According to my quick investigation it looks like some incorrect module name handling was introduced in #4804

@qrilka qrilka referenced this issue Jul 6, 2019

Merged

Fix support for non-ASCII module names #4939

1 of 2 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.