Open Lev135 opened 2 years ago
Upd. v1-build
fails when trying to add extra libraries with similar errors:
mintty-0.1.4-AFZfdEdKJet3r0mUOoGb3u failed 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:
mintty-0.1.4: Warning: library-dirs: C:\Program doesn't exist or isn't a
directory
mintty-0.1.4: Warning: dynamic-library-dirs: C:\Program doesn't exist or isn't
a directory
mintty-0.1.4: Warning: include-dirs: C:\Program doesn't exist or isn't a
directory
mintty-0.1.4: Warning: haddock-interfaces: C:\Program
Files\cabal\doc\x86_64-windows-ghc-8.10.7\mintty-0.1.4\html\mintty.haddock
doesn't exist or isn't a file
mintty-0.1.4: Warning: haddock-html: C:\Program
Files\cabal\doc\x86_64-windows-ghc-8.10.7\mintty-0.1.4\html doesn't exist or
isn't a directory
mintty-0.1.4: 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)
mintty-0.1.4: 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)
)
It seems at least some of the messages come from program ghc-pkg
, but I couldn't find a ticket in the ghc bug tracker.
Thank you for the bug report
Although the bug should be investigated, the immediate workaround is use a short, without spaces directory for installing ghcup (iirc the default in Windows is X:\ghcup
, precisely to avoid these kind of issues)
Yes I've done so and all works for me now. Thank you
I seem to be able to reproduce with:
extra-lib-dirs: C:\Users\Javier\extra lib dirs
Which get passed to cabal as:
--extra-lib-dirs=C:\Users\Javier\extra --extra-lib-dirs=lib
--extra-lib-dirs=dirs
Does this also happen on Linux?
I believe you're supposed to use quotes? extra-lib-dirs: "C:\Users\Javier\extra lib dirs"
Nope, no double quotes nor single quotes make it work
It seems to work on Linux without quotes. I assume the parser starts with the first non-space and takes everything until the comma or next newline or something along these lines.
I didn't figure out how to check it most thoroughly, but what I did was:
cabal init -nm
extra-lib-dirs: my sub dir
in the library component in the cabal file.cabal build >out
shows a warning:
Warning: 'extra-lib-dirs: my sub dir' specifies a directory which does not exist.
mkdir "my sub dir"
cabal clean && cabal build >out
is clean.It is a little mind-boggling that this is platform-dependent, but maybe my imagination is too weak.
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
cabal init
cabal v2-build
Expected behavior Executable will be successfuly built.
Log
System information Operating system
Windows 10