`v2-build` fails when there are white spaces in path to `ghcup\bin\ghc-pkg.exe`
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
**Describe the bug**
`cabal v2-build` fails to build clean cabal-generated project with library and executable. According to warnings and error message it's seems it (or ghcup) doesn't work correctly with white space in file path. Without library everything works fine. `v1-build` also work.
**To Reproduce**
- make new project *with library* by `cabal init`
- run `cabal v2-build`
**Expected behavior**
Executable will be successfuly built.
**Log**
```
Resolving dependencies...
Build profile: -w ghc-8.10.7 -O1
In order, the following will be built (use -v for more details):
- test-cabal-0.1.0.0 (lib) (first run)
- test-cabal-0.1.0.0 (exe:test-cabal) (first run)
Configuring library for test-cabal-0.1.0.0..
Warning: 'extra-lib-dirs: Files\ghcup\msys64\mingw64\lib' directory does not
exist.
Warning: 'extra-lib-dirs: Files\ghcup\msys64\mingw64\lib' directory does not
exist.
Warning: 'include-dirs: Files\ghcup\msys64\mingw64\include' directory does not
exist.
Warning: 'include-dirs: Files\ghcup\msys64\mingw64\include' directory does not
exist.
Preprocessing library for test-cabal-0.1.0.0..
Building library for test-cabal-0.1.0.0..
[1 of 1] Compiling MyLib ( src\MyLib.hs, D:\dvorkin_lev\Haskell\test-cabal\dist-newstyle\build\x86_64-windows\ghc-8.10.7\test-cabal-0.1.0.0\build\MyLib.o
)
cabal-3.6.2.0.exe: Failed to build test-cabal-0.1.0.0 (which is required by
exe:test-cabal from test-cabal-0.1.0.0). The failure occurred during the final
install step. The exception was:
dieVerbatim: user error (cabal-3.6.2.0.exe: 'C:\Program
Files\ghcup\bin\ghc-pkg.exe' exited with an
error:
test-cabal-0.1.0.0: Warning: library-dirs: C:\Program doesn't exist or isn't a
directory
test-cabal-0.1.0.0: Warning: dynamic-library-dirs: C:\Program doesn't exist or
isn't a directory
test-cabal-0.1.0.0: Warning: include-dirs: C:\Program doesn't exist or isn't a
directory
test-cabal-0.1.0.0: Warning: include-dirs:
D:\dvorkin_lev\Haskell\test-cabal\Files\ghcup\msys64\mingw64\include doesn't
exist or isn't a directory
test-cabal-0.1.0.0: Warning: include-dirs:
D:\dvorkin_lev\Haskell\test-cabal\dist-newstyle\build\x86_64-windows\ghc-8.10.7\test-cabal-0.1.0.0\build\Files\ghcup\msys64\mingw64\include
doesn't exist or isn't a directory
test-cabal-0.1.0.0: Warning: haddock-interfaces:
D:\dvorkin_lev\Haskell\test-cabal\dist-newstyle\build\x86_64-windows\ghc-8.10.7\test-cabal-0.1.0.0\doc\html\test-cabal\test-cabal.haddock
doesn't exist or isn't a file
test-cabal-0.1.0.0: Warning: haddock-html:
D:\dvorkin_lev\Haskell\test-cabal\dist-newstyle\build\x86_64-windows\ghc-8.10.7\test-cabal-0.1.0.0\doc\html\test-cabal
doesn't exist or isn't a directory
test-cabal-0.1.0.0: library-dirs: Files\ghcup\msys64\mingw64\lib is a relative
path which makes no sense (as there is nothing for it to be relative to). You
can make paths relative to the package database itself by using ${pkgroot}.
(use --force to override)
test-cabal-0.1.0.0: dynamic-library-dirs: Files\ghcup\msys64\mingw64\lib is a
relative path which makes no sense (as there is nothing for it to be relative
to). You can make paths relative to the package database itself by using
${pkgroot}. (use --force to override)
)
```
**System information**
Operating system `Windows 10`
```
cabal-install version 3.6.2.0
compiled using version 3.6.2.0 of the Cabal library
```
Contributor guide
Assessment
This issue has not been assessed yet.