You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
stack fails unpacking ghc on Windows under non-ASCII path because 7zip version is too old #3987
When on Windows my user name is set to 日 and I want to stack runghc a file, the 7z invocation issued by stack fails with the message:
PS C:\csl> stack --stack-root C:\sr --work-dir .w runghc -- .\log-warper-test.hs
Preparing to install GHC to an isolated location.
This will not interfere with any system-level installation.
Already downloaded.
Already downloaded.
Already downloaded.
7-Zip 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18
Error:
7-Zip cannot find the code that works with archives.
Problem while decompressing C:\Users\µùÑ\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2.tar.xz
Confirming it's a 7zip problem by directly invoking it:
```PS C:\csl> C:\Users\日\AppData\Local\Programs\stack\x86_64-windows\7z.exe l C:\Users\日\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2.tar.xz
7-Zip 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18
Error:
7-Zip cannot find the code that works with archives.```
@bitemyapp got the great idea to check how old that 7zip version obtained by stack is.
PS C:\Users\日\stack-test> stack setup --stack-setup-yaml .\stack-setup-info.yaml
Warning: .\stack-setup-info.yaml: Unrecognized field in GHCDownloadInfo: version
Warning: .\stack-setup-info.yaml: Unrecognized field in SetupInfo: portable-git
Preparing to install GHC to an isolated location.
This will not interfere with any system-level installation.
Already downloaded.
7z.dll: 35.40 KiB / 1.58 MiB ( 2.19%) downloaded...Download expectation failure: content hash (SHA1)
Expected: 168a288d4456f0473f66e86a2d6fec4eb6f4b99a (ByteString)
Actual: ef6a002f0defd1a3320d6f04a0c87bcb63d5672c
For: http://nh2.me:80/7z/7z.dll
PS C:\Users\日\stack-test> stack setup --stack-setup-yaml .\stack-setup-info.yaml
Warning: .\stack-setup-info.yaml: Unrecognized field in GHCDownloadInfo: version
Warning: .\stack-setup-info.yaml: Unrecognized field in SetupInfo: portable-git
Preparing to install GHC to an isolated location.
This will not interfere with any system-level installation.
Already downloaded.
Downloaded 7z.dll.
Preparing to download 7z.exe ...Download expectation failure: ContentLength header
Expected: 73728
Actual: 455168
For: http://nh2.me:80/7z/7z.exe
PS C:\Users\日\stack-test> stack setup --stack-setup-yaml .\stack-setup-info.yaml
Warning: .\stack-setup-info.yaml: Unrecognized field in GHCDownloadInfo: version
Warning: .\stack-setup-info.yaml: Unrecognized field in SetupInfo: portable-git
Preparing to install GHC to an isolated location.
This will not interfere with any system-level installation.
Already downloaded.
Already downloaded.
Downloaded 7z.exe.
7-Zip 18.01 (x64) : Copyright (c) 1999-2018 Igor Pavlov : 2018-01-28
Scanning the drive for archives:
1 file, 152282428 bytes (146 MiB)
Extracting archive: C:\Users\_\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2.tar.xz
--
Path = C:\Users\_\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2.tar.xz
Type = xz
Physical Size = 152282428
Method = LZMA2:23 CRC64
Streams = 1
Blocks = 1
Everything is Ok
Size: 1435248640
Compressed: 152282428
7-Zip 18.01 (x64) : Copyright (c) 1999-2018 Igor Pavlov : 2018-01-28
Scanning the drive for archives:
1 file, 1435248640 bytes (1369 MiB)
Extracting archive: C:\Users\_\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2-tmp22080\ghc-8.0.2.tar
--
Path = C:\Users\_\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2-tmp22080\ghc-8.0.2.tar
Type = tar
Physical Size = 1435248640
Headers Size = 4755968
Code Page = UTF-8
Everything is Ok
Folders: 408
Files: 8819
Size: 1428273210
Compressed: 1435248640
GHC installed to C:\Users\?\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2\
The GHC located at C:\Users\µùÑ\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2\bin\ghc.EXE failed to compile a sa
nity check. Please see:
http://docs.haskellstack.org/en/stable/install_and_upgrade/
for more information. Exception was:
Running C:\Users\µùÑ\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2\bin\ghc.EXE C:\Users\µùÑ\AppData\Local\Temp\2
\stack-sanity-check22080\Main.hs -no-user-package-db in directory C:\Users\µùÑ\AppData\Local\Temp\2\stack-sanity-check22
080\ exited with ExitFailure 1
[1 of 1] Compiling Main ( C:\Users\?\AppData\Local\Temp\2\stack-sanity-check22080\Main.hs, C:\Users\?\AppDat
a\Local\Temp\2\stack-sanity-check22080\Main.o )
<no location info>: error:
Warning: Couldn't figure out C compiler information!
Make sure you're using GNU gcc, or clang
Unable to start C:\Users\?\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2\mingw\bin/realgcc.exe (error code: 123)
`gcc.exe' failed in phase `Assembler'. (Exit code: 1)
The output of the new 7z version seems to be more verbose, we might want to pass a flag if we don't like that. But that's not so important to me.
@nh2, I have updated the Stack-supplied 7-Zip to 7-Zip 22.01. You will have to delete the existing 7z.exe and 7z.dll in your stack path --programs directory, in order for Stack to be prompted to fetch the updated 7-Zip version.
Activity
nh2 commentedon Apr 27, 2018
We should make stack use a newer version of 7zip to fix this issue.
nh2 commentedon Apr 27, 2018
This issue was found as part of the effort to make stack work great under non-ASCII user names: #3988
nh2 commentedon Apr 27, 2018
I also tried with
xzfrom the Windows binary distribution fromxzutils(https://tukaani.org/xz/), just to check whether we should maybe use that one instead of 7zip in general, but in contrast to the latest version of 7zip, the latest version of that one doesn't work:Version is:
nh2 commentedon Apr 28, 2018
I can confirm that upgrading
7zto18.01works with stack.I've saved https://github.com/fpco/stackage-content/blob/edc62c118a7319e6dcd1b39ccf1723e0b5f062d3/stack/stack-setup-2.yaml as
stack-setup-info.yamland adjusted the following sections to contain links to7z.exeand7z.dllversion 18.01:Then I ran:
The output of the new 7z version seems to be more verbose, we might want to pass a flag if we don't like that. But that's not so important to me.
The error at the end is a separate issue.
snoyberg commentedon Apr 2, 2019
Can you open up a PR to include the newer version?
Bump Stack-supplied 7-Zip to 22.01
mpilgrem commentedon Sep 10, 2022
@nh2, I have updated the Stack-supplied 7-Zip to 7-Zip 22.01. You will have to delete the existing
7z.exeand7z.dllin yourstack path --programsdirectory, in order for Stack to be prompted to fetch the updated 7-Zip version.