Skip to content

Paths with spaces on Windows in the cabal file are not parsed properly #2407

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

Closed
darthdeus opened this issue Feb 8, 2015 · 2 comments
Closed

Comments

@darthdeus
Copy link

If I add one of the following

  include-dirs: C:\Program Files\MySQL\MySQL Server 5.6\include
  extra-lib-dirs: C:\Program Files\MySQL\MySQL Server 5.6\lib

in my cabal file, it will fail with errors such as Warning: 'include-dirs: 5.6\include' directory does not exist., which looks like the paths are being split on spaces. I've tried adding double quotes around them, but the same thing happens.

I couldn't really find if there's another syntax for specifying paths like this, and I tried cabal-install 1.18 and 1.22, both with the same effect, which is why I'm opening the issue in the cabal repo itself. I've also tried escaping the spaces with \\, but that didn't seem to help either.

@ttuegel ttuegel added this to the Cabal-1.24 milestone Apr 25, 2015
@ttuegel
Copy link
Member

ttuegel commented Apr 25, 2015

Related to #1634.

@phadej phadej mentioned this issue Oct 12, 2015
4 tasks
@dcoutts
Copy link
Contributor

dcoutts commented Oct 16, 2015

@darthdeus .cabal files can use Haskell string syntax for these cases. So in this case that means using "" and escaping the '' chars (or using '/' instead).

include-dirs: "C:\\Program Files\\MySQL\\MySQL Server 5.6\\include"
extra-lib-dirs: "C:\\Program Files\\MySQL\\MySQL Server 5.6\\lib"

FYI, this has been the case since pre-1.0 and is documented in the user guide.

Plausibly we could somehow try and warn about this mistake and suggest the correct solution, i.e. string syntax.

@dcoutts dcoutts closed this as completed Oct 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants