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

Fix support for non-ASCII module names #4939

Merged
merged 1 commit into from
Jul 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ Bug fixes:

* Expose package library when running tests.

* Fix support for non-ASCII module names. See
[4938](https://github.com/commercialhaskell/stack/issues/4938)

## v2.1.1.1

Hackage-only release that removes `stack.yaml` from the sdist. This is because
Expand Down
4 changes: 2 additions & 2 deletions src/Stack/Package.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ module Stack.Package
,applyForceCustomBuild
) where

import qualified Data.ByteString.Char8 as B8
import Data.List (find, isPrefixOf, unzip)
import Data.Maybe (maybe)
import qualified Data.Map.Strict as M
Expand Down Expand Up @@ -1117,7 +1116,8 @@ parseHI hiPath = do
]
pure (S.empty, [])
Right iface -> do
let moduleNames = fmap (fromString . B8.unpack . fst) . Iface.unList . Iface.dmods . Iface.deps
let moduleNames = fmap (fromString . T.unpack . decodeUtf8Lenient . fst) .
Iface.unList . Iface.dmods . Iface.deps
resolveFileDependency file = do
resolved <- liftIO (forgivingAbsence (resolveFile dir file)) >>= rejectMissingFile
when (isNothing resolved) $
Expand Down
5 changes: 5 additions & 0 deletions test/integration/tests/4938-non-ascii-module-names/Main.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import StackTest

main :: IO ()
main = do
stack ["build"]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.cabal
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module Lib
( foo
, bar
) where

import Täst

bar :: Int
bar = 42
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module Täst where

foo :: Int
foo = 42
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module Main where

import Täst

main :: IO ()
main = putStrLn "42"
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: umlaut
dependencies: [base]
library:
source-dirs: .
executables:
exe:
main: Main.hs
source-dirs: app
dependencies:
- umlaut
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
resolver: lts-11.22