Skip to content
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

Show warning about path with spaces in windows when running scripts #5001

Closed
jneira opened this issue Aug 14, 2019 · 6 comments · Fixed by #5013
Closed

Show warning about path with spaces in windows when running scripts #5001

jneira opened this issue Aug 14, 2019 · 6 comments · Fixed by #5013

Comments

@jneira
Copy link
Contributor

jneira commented Aug 14, 2019

Steps to reproduce

  1. Set a path with spaces in the local-program-path of %STACK_ROOT%\config.yaml
local-programs-path: D:\bin\s t a c k
  1. Create simple file script example.hs:
 #!/usr/bin/env stack
{- stack
  runghc
  --resolver=lts-14.1
-}
main = putStrLn "Hello"
  1. Run command stack example.hs.

Expected

Show the same warning as you run stack <command>:

PS D:\dev\ws\haskell\stack-test> stack build
Stack's 'programs' path contains a space character and has no alternative short ('8 dot 3') name. This will cause problems with packages that use the GNU project's 'configure' shell script. Use the 'local-programs-path' configuation option to specify an alternative path. The current 'shortest' path is: D:\bin\s t a c k\

Actual

It shows nothing about the possible issues caused by that configuration.

The original issue was in haskell-ide-engine: a user with spaces in %USER_PROFILE% (very common in windows versions below 10 or win 10 migrated from older one) and the default local-programs-path got an error running the script to install hie executable:

install.hs: C:\Users\Arthur: createProcess: does not exist (No such file or directory)

Setting local-programs-path without spaces fixed the error.

(As a side note i found the warning message a little bit weird: '8 dot 3'? The current 'shortest' path is: D:\bin\s t a c k\? and has a typo: configuation)

Stack version

$ stack --version
Version 2.1.3, Git revision 0fa51b9925decd937e4a993ad90cb686f88fa282 (7739 commits) x86_64 hpack-0.31.2

Method of installation

  • Official binary, downloaded from stackage.org or fpcomplete's package repository
@mattaudesse
Copy link
Member

Thanks @jneira! Any interest in submitting a PR?

@jneira
Copy link
Contributor Author

jneira commented Aug 17, 2019

I can to try it out, although i never had to modify stack code.

@dbaynard
Copy link
Contributor

As a side note i found the warning message a little bit weird: '8 dot 3'? The current 'shortest' path is: D:\bin\s t a c k\? and has a typo: configuation

  1. '8 dot 3' is weird, but it does help searching, I guess.
  2. This can be improved.
  3. Would be good to fix.

@jneira
Copy link
Contributor Author

jneira commented Aug 28, 2019

@mattaudesse hi! i think the pr could be merged (if @dbaynard thinks last changes are good)

@mattaudesse
Copy link
Member

Thanks @jneira - I think you covered everything @dbaynard asked for but I'll give him a chance to respond before merging.

@dbaynard
Copy link
Contributor

Thanks, @mattaudesse, and thanks @jneira! Haven't been able to get to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants