-
Notifications
You must be signed in to change notification settings - Fork 696
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
cabal init
incorrectly writes non-ASCII file names in library:exposed-modules
#6507
Comments
According to https://superuser.com/questions/999232/unicode-filenames-in-windows-vs-mac-os-x.
NFD (note visible e, i.e. 65)
NKC (note no e)
I'm not 100% sure though what happens, |
Thanks so much for the insight! I'll use this information to make whatever progress I can on my end, and if I learn exactly what's going on I'll post my findings here. |
Unfortunately, the Stack Overflow answer only applied to the HFS and HFS+ file systems, which were replaced by the APFS file system in macOS High Sierra (10.13) and above. I can confirm that my machine uses APFS, whose normalization rules can be found here. According to these, the system doesn't enforce a single form of Unicode normalization.
I have reason to believe it's the program creating the file that controls how its name is normalized. On my system:
(Note: I checked the above statements using With this information in mind, when I create the following file with Emacs and save it with the name
Note that when If I understand correctly, when I managed to work around this problem for my local I changed
to
Above, |
Since this has been marked as a bug now, if the fix above is acceptable (in its current form it adds |
I'm not sure that's a correct fix. I don't understand why Without proper understanding when we fix macOS we might break Windows or Linux, so fix of this should have properly. Also there is: haskell/tar#6 so I suspect that may cause some problems too (or is the problem?) |
@jneira this was explicitly left off that particular ticket, because we weren't sure if it was completely solved. However if someone were to confirm that we did in fact fix this I would be fine with saying it's closed. A regression test for this would be enough for me to make that call |
Describe the bug
Consider a folder hierarchy that looks like
Running
cabal init --interactive
when the working directory isproglet
generates the files necessary forcabal v2-build
.Running
cabal v2-build
, however, gives the unexpected errorTo Reproduce
proglet
proglet/Typeclass
proglet/Typeclass/Pokémon.hs
with contentproglet
cabal init --interactive
and complete the prompts this waycabal v2-build
and observe the errorExpected behavior
I expected the build to succeed.
System information
cabal
version: 3.0.0.0ghc
version: 8.6.5Additional context
It seems that the "e with acute accent" under "Saw" is the UTF-8 character U+00E9, while the "e with acute accent" under "Expected" is a combination of the normal letter "e" (U+0065) and some acute accent character.
Since the "e with acute accent" under "Expected" corresponds to the contents of the
library:exposed-modules
section of the.cabal
file, I checkedproglet.cabal
(I have removed the comment lines below).I changed
Typeclass.Pokémon
in the file above toTypeclass.Pokémon
, where the latter actually uses U+00E9, and thencabal build
worked painlessly.The text was updated successfully, but these errors were encountered: