ghcup-hs icon indicating copy to clipboard operation
ghcup-hs copied to clipboard

Set `STACK_ROOT=C:\sr`

Open hasufell opened this issue 1 year ago • 2 comments
trafficstars

https://docs.haskellstack.org/en/stable/stack_root/

On Windows, the length of filepaths may be limited (to MAX_PATH), and things can break when this limit is exceeded. Setting a Stack root with a short path to its location (for example, C:\sr) can help.

We will have to do that in: https://github.com/haskell/ghcup-hs/blob/master/scripts/bootstrap/bootstrap-haskell.ps1

hasufell avatar Apr 23 '24 11:04 hasufell

It is possible that this change causes large breakage, e.g. for github runners, which use ghcup for provisioning: https://github.com/actions/runner-images/blob/main/images/windows/scripts/build/Install-Haskell.ps1

It doesn't appear to install stack, nor does it set STACK_ROOT. It also doesn't seem to use our bootstrap script anymore, so that seems like at least github won't be affected.

Opinions @mpilgrem?

hasufell avatar Apr 23 '24 12:04 hasufell

@hasufell, I am a little lost as to the question I might be able to help with. However: Windows does (by default; it can be removed on Windows 10 and 11) have a maximum path length; Stack tries to keep paths short on Windows (by using hashes); and Stack's binary installer for 64-bit Windows sets STACK_ROOT to C:\sr by default (see etc/scripts/build-stack-installer.hs about line 57; EDIT now documented online).

mpilgrem avatar Apr 23 '24 13:04 mpilgrem