Repository navigation
Closed
Description
General summary/comments (optional)
In latest Stack version, a project won't build if its pathname contains non-ASCII characters.
Steps to reproduce
- stack new dúmmy # Note the accent on the ú
- cd dúmmy/
- stack build
Expected
I expect it to build
Actual
The build fails.
If you do the same steps, but using the project name "dummy" (no accent), the build succeeds.
$ stack build
Building all executables for `dúmmy' once. After a successful build of all of them, only specified executables will be rebuilt.
dúmmy-0.1.0.0: configure (lib + exe)
<stdout>: commitBuffer: invalid argument (invalid character)
Configuring d
-- While building package d\250mmy-0.1.0.0 using:
/home/amy/.stack/setup-exe-cache/x86_64-linux-nix/Cabal-simple_mPHDZzAJ_2.2.0.1_ghc-8.4.4 --builddir=.stack-work/dist/x86_64-linux-nix/Cabal-2.2.0.1 configure --with-ghc=/nix/store/vrdzir6ql35x1an44ln0vir3a3pra75f-ghc-8.4.4/bin/ghc --with-ghc-pkg=/nix/store/vrdzir6ql35x1an44ln0vir3a3pra75f-ghc-8.4.4/bin/ghc-pkg --user --package-db=clear --package-db=global --package-db=/home/amy/.stack/snapshots/x86_64-linux-nix/lts-12.22/8.4.4/pkgdb --package-db=/home/amy/dúmmy/.stack-work/install/x86_64-linux-nix/lts-12.22/8.4.4/pkgdb --libdir=/home/amy/dúmmy/.stack-work/install/x86_64-linux-nix/lts-12.22/8.4.4/lib --bindir=/home/amy/dúmmy/.stack-work/install/x86_64-linux-nix/lts-12.22/8.4.4/bin --datadir=/home/amy/dúmmy/.stack-work/install/x86_64-linux-nix/lts-12.22/8.4.4/share --libexecdir=/home/amy/dúmmy/.stack-work/install/x86_64-linux-nix/lts-12.22/8.4.4/libexec --sysconfdir=/home/amy/dúmmy/.stack-work/install/x86_64-linux-nix/lts-12.22/8.4.4/etc --docdir=/home/amy/dúmmy/.stack-work/install/x86_64-linux-nix/lts-12.22/8.4.4/doc/dúmmy-0.1.0.0 --htmldir=/home/amy/dúmmy/.stack-work/install/x86_64-linux-nix/lts-12.22/8.4.4/doc/dúmmy-0.1.0.0 --haddockdir=/home/amy/dúmmy/.stack-work/install/x86_64-linux-nix/lts-12.22/8.4.4/doc/dúmmy-0.1.0.0 --dependency=base=base-4.11.1.0 --extra-include-dirs=/nix/store/3zal9zfqb41fsbmwl5ba7sxh3h2ngvxi-git-2.18.1/include --extra-include-dirs=/nix/store/ipba8r4418ls0j55p5y5gi4zmg2kna5n-gmp-6.1.2-dev/include --extra-include-dirs=/nix/store/iw94llkj05wgaz268mlzvgx8jkbi1ss0-gcc-wrapper-7.3.0/include --extra-include-dirs=/nix/store/vrdzir6ql35x1an44ln0vir3a3pra75f-ghc-8.4.4/include --extra-lib-dirs=/nix/store/3zal9zfqb41fsbmwl5ba7sxh3h2ngvxi-git-2.18.1/lib --extra-lib-dirs=/nix/store/iw94llkj05wgaz268mlzvgx8jkbi1ss0-gcc-wrapper-7.3.0/lib --extra-lib-dirs=/nix/store/rxaclc3vhxbzgfllv7601i85z854h48a-gmp-6.1.2/lib --extra-lib-dirs=/nix/store/vrdzir6ql35x1an44ln0vir3a3pra75f-ghc-8.4.4/lib --enable-tests --enable-benchmarks
Process exited with code: ExitFailure 1
Output in verbose mode is shown in gist.
Stack version
$ stack --version
Version 1.9.3, Git revision 40cf7b37526b86d1676da82167ea8758a854953b (6211 commits) x86_64 hpack-0.31.1
Method of installation
This is on a NixOS, installed using NixOS package repo.
Activity
mhwombat commentedon Dec 13, 2018
Forgot to add:
qrilka commentedon Dec 13, 2018
BTW @mhwombat did you try impure Nix mode in Stack with
--no-nix-pure? By default nix mode is run in pure nix shell and that makes yourlocalelisting inapplicable though as of #4294en_US.UTF-8should be used as a default.Also running Stack in verbose mode could help a lot.
mhwombat commentedon Dec 13, 2018
That gist I linked to includes the output when running in verbose mode.
I forgot to say that I tried --no-nix-pure, and got a similar message. Here's that gist with --no-nix-pure.
mhwombat commentedon Dec 13, 2018
I was able to duplicate the problem on Debian. Here's the gist.
EDIT: Just to clarify, I don't have Nix installed on the Debian machine, so I don't think this problem is Nix-specific.
dbaynard commentedon Dec 13, 2018
@mhwombat Thanks for the report. I've just had a flick through the related issues; would you please check whether this is still an issue for you with stack nightly?
Meanwhile, I'll try to repro with an integration test based on the one in #4294 (unless you want to do that?).
mhwombat commentedon Dec 14, 2018
I'll try both of those and let you know.
Incidentally, this was working fine a few weeks ago. I have a hunch that it might be a cabal issue rather than a Stack issue. I'll try to test that theory as well.
mhwombat commentedon Dec 15, 2018
It seems my hunch was correct; it's not a Stack issue per se. What's happening here is that
cabal buildautomatically generates a module called Paths__projectname_, and that's what causes the problem.dbaynard commentedon Dec 15, 2018
@mhwombat Thanks for investigating — and please do comment here if you find a suitable workaround.
qrilka commentedon Dec 16, 2018
BTW @mhwombat did you open a Cabal issue about this?
mhwombat commentedon Dec 16, 2018
As it turns out, there is already a Cabal issue about it.