Stack: Show warning about path with spaces in windows when running scripts

Created on 15 Aug 2019  ·  6Comments  ·  Source: commercialhaskell/stack

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
windows help wanted enhancement

All 6 comments

Thanks @jneira! Any interest in submitting a PR?

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

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.

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

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

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

Was this page helpful?
0 / 5 - 0 ratings