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

Cannot install via stack with Windows #2296

Open
clin1234 opened this issue Dec 10, 2024 · 7 comments
Open

Cannot install via stack with Windows #2296

clin1234 opened this issue Dec 10, 2024 · 7 comments
Labels
i18n Internationalisation/localisation-related. packaging Dependencies, version constraints, packaging.. platform:windows tools hledger developer tools, scripts, processes..

Comments

@clin1234
Copy link

C:\Users\שזדס>stack install --keep-going  hledger-ui hledger
ansi-terminal                > configure
ansi-terminal                > Configuring ansi-terminal-1.1.2...
unix-compat                  > configure
clock                        > configure
unix-compat                  > Configuring unix-compat-0.7.3...
clock                        > Configuring clock-0.8.4...
ansi-terminal                > build with ghc-9.8.4
ansi-terminal                > Preprocessing library for ansi-terminal-1.1.2..
unix-compat                  > build with ghc-9.8.4
clock                        > build with ghc-9.8.4
ansi-terminal                > hsc2hs-ghc-9.8.4.exe: fd:3: hGetContents: invalid argument (cannot decode byte sequence starting from 233)
clock                        > Preprocessing library for clock-0.8.4..
unix-compat                  > Preprocessing library for unix-compat-0.7.3..
clock                        > hsc2hs-ghc-9.8.4.exe: fd:3: hGetContents: invalid argument (cannot decode byte sequence starting from 233)
unix-compat                  > hsc2hs-ghc-9.8.4.exe: fd:3: hGetContents: invalid argument (cannot decode byte sequence starting from 233)
Progress 3/31

Error: [S-7282]
       Stack failed to execute the build plan.

       While executing the build plan, Stack encountered the following errors:

       [S-7011]
       While building package unix-compat-0.7.3 (scroll up to its section to see the
       error) using:
       C:\Users\שזדס\AppData\Roaming\stack\setup-exe-cache\x86_64-windows\Cabal-simple_CKvAmRb3_3.10.3.0_ghc-9.8.4.exe --verbose=1 --builddir=.stack-work\dist\f24b2e15 build --ghc-options " -fdiagnostics-color=always"
       Process exited with code: ExitFailure 1

       [S-7011]
       While building package clock-0.8.4 (scroll up to its section to see the error)
       using:
       C:\Users\שזדס\AppData\Roaming\stack\setup-exe-cache\x86_64-windows\Cabal-simple_CKvAmRb3_3.10.3.0_ghc-9.8.4.exe --verbose=1 --builddir=.stack-work\dist\f24b2e15 build --ghc-options " -fdiagnostics-color=always"
       Process exited with code: ExitFailure 1

       [S-7011]
       While building package ansi-terminal-1.1.2 (scroll up to its section to see the
       error) using:
       C:\Users\שזדס\AppData\Roaming\stack\setup-exe-cache\x86_64-windows\Cabal-simple_CKvAmRb3_3.10.3.0_ghc-9.8.4.exe --verbose=1 --builddir=.stack-work\dist\f24b2e15 build --ghc-options " -fdiagnostics-color=always"
       Process exited with code: ExitFailure 1

I've filed bug reports for the broken packages: haskell-pkg-janitors/unix-compat#13, UnkindPartition/ansi-terminal#173, corsis/clock#92

@simonmichael simonmichael added platform:windows packaging Dependencies, version constraints, packaging.. labels Dec 10, 2024
@simonmichael
Copy link
Owner

Thanks for the report @clin1234 !

This is a common problem with haskell tools. They need a suitable locale configured.
See also https://hledger.org/install.html#text-encoding. I see the windows doc link has broken, but perhaps this gives you ideas ?

@simonmichael
Copy link
Owner

I read that this might help in powershell:

$env:LC_ALL = "C.UTF-8"
$env:LANG = "C.UTF-8"

or this in CMD:

set LC_ALL=C.UTF-8
set LANG=C.UTF-8

There are also lots of ways to get pre-built binaries for Windows, if you don't need to build your own: https://hledger.org/install.html

@clin1234
Copy link
Author

C:\Users\שזדס>set LC_ALL=C.UTF-8

C:\Users\שזדס>set LANG=C.UTF-8

C:\Users\שזדס>stack install --keep-going  hledger-ui hledger
ansi-terminal                > configure
clock                        > configure
unix-compat                  > configure
clock                        > Configuring clock-0.8.4...
ansi-terminal                > Configuring ansi-terminal-1.1.2...
unix-compat                  > Configuring unix-compat-0.7.3...
clock                        > build with ghc-9.8.4
ansi-terminal                > build with ghc-9.8.4
unix-compat                  > build with ghc-9.8.4
clock                        > Preprocessing library for clock-0.8.4..
unix-compat                  > Preprocessing library for unix-compat-0.7.3..
ansi-terminal                > Preprocessing library for ansi-terminal-1.1.2..
clock                        > hsc2hs-ghc-9.8.4.exe: fd:3: hGetContents: invalid argument (cannot decode byte sequence starting from 233)
unix-compat                  > hsc2hs-ghc-9.8.4.exe: fd:3: hGetContents: invalid argument (cannot decode byte sequence starting from 233)
ansi-terminal                > hsc2hs-ghc-9.8.4.exe: fd:3: hGetContents: invalid argument (cannot decode byte sequence starting from 233)
Progress 3/31

Error: [S-7282]
       Stack failed to execute the build plan.

       While executing the build plan, Stack encountered the following errors:

       [S-7011]
       While building package ansi-terminal-1.1.2 (scroll up to its section to see the
       error) using:
       C:\Users\שזדס\AppData\Roaming\stack\setup-exe-cache\x86_64-windows\Cabal-simple_CKvAmRb3_3.10.3.0_ghc-9.8.4.exe --verbose=1 --builddir=.stack-work\dist\f24b2e15 build --ghc-options " -fdiagnostics-color=always"
       Process exited with code: ExitFailure 1

       [S-7011]
       While building package unix-compat-0.7.3 (scroll up to its section to see the
       error) using:
       C:\Users\שזדס\AppData\Roaming\stack\setup-exe-cache\x86_64-windows\Cabal-simple_CKvAmRb3_3.10.3.0_ghc-9.8.4.exe --verbose=1 --builddir=.stack-work\dist\f24b2e15 build --ghc-options " -fdiagnostics-color=always"
       Process exited with code: ExitFailure 1

       [S-7011]
       While building package clock-0.8.4 (scroll up to its section to see the error)
       using:
       C:\Users\שזדס\AppData\Roaming\stack\setup-exe-cache\x86_64-windows\Cabal-simple_CKvAmRb3_3.10.3.0_ghc-9.8.4.exe --verbose=1 --builddir=.stack-work\dist\f24b2e15 build --ghc-options " -fdiagnostics-color=always"
       Process exited with code: ExitFailure 1

@simonmichael
Copy link
Owner

Related: commercialhaskell/stack#6670 (in progress)

@simonmichael simonmichael added tools hledger developer tools, scripts, processes.. i18n Internationalisation/localisation-related. labels Dec 12, 2024
@clin1234
Copy link
Author

I can report that installing via cabal uses the latest GHC 9.10.1 compiler, and doesn't error at all.

@simonmichael
Copy link
Owner

simonmichael commented Dec 12, 2024

@clin1234 good news. If you have time for additional testing that would be helpful:
Does it also build with stack when using the GHC 9.10 toolchain ?

stack --snapshot nightly-2024-12-12 install hledger

@clin1234
Copy link
Author

Works, no errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
i18n Internationalisation/localisation-related. packaging Dependencies, version constraints, packaging.. platform:windows tools hledger developer tools, scripts, processes..
Projects
None yet
Development

No branches or pull requests

2 participants