Closed mcandre closed 6 years ago
I have no idea what the problem is here. Anyone able to help?
I'm building with stack, on windows, and have issues with happy, too: this is the appveyor output : https://ci.appveyor.com/project/OlivierSohn/hamazed/build/1.0.111
@OlivierSohn's issue seems to be different from the original issue.
Its actually possible to copy and paste the output from AppVeyor like this:
C:\Users\appveyor\AppData\Local\Temp\1\stack1404\happy-1.19.9\.stack-work\dist\ba067387\setup\Main.o )
C:\Users\appveyor\AppData\Local\Temp\1\stack1404\happy-1.19.9\Setup.lhs:48:22: warning: [-Wdeprecations]
In the use of `rawSystemProgramConf'
(imported from Distribution.Simple.Program):
Deprecated: "use runDbProgram instead. This symbol will be removed in Cabal-3.0 (est. Oct 2018)."
|
48 | let runProgram p = rawSystemProgramConf (fromFlagOrDefault normal (buildVerbosity flags))
| ^^^^^^^^^^^^^^^^^^^^
which to me looks like it may be using version 2.2 of Cabal the library.
Might be worth trying to build happy with the following patch:
diff --git a/happy.cabal b/happy.cabal
index 4cff02c..c60c71e 100644
--- a/happy.cabal
+++ b/happy.cabal
@@ -129,7 +129,7 @@ extra-source-files:
tests/typeclass_monad_lexer.y
custom-setup
- setup-depends: Cabal <2.4,
+ setup-depends: Cabal <2.2,
base >=4.6 && <5,
directory <1.4,
filepath <1.5
That warning obviously wasn't the issue. I suspect its actually dying running the program compiled from Setup.lhs
.
I too thought that the warning was not the issue, and that the issue was coming later, but the logs were somehow truncated by appveyor logging system.
Here is the end of the log:
echo "" | stack --resolver nightly-2018-06-07 --skip-msys --with-gcc=c:\msys64\MINGW32\bin\gcc --no-terminal --extra-lib-dirs c:\msys64\MINGW32\lib\ --extra-lib-dirs C:\stack\portaudio-build\Release\ --extra-include-dirs c:\msys64\MINGW32\include\ --extra-include-dirs C:\stack\portaudio\include\ test imj-music --jobs 1
Cloning 89a5657db7cf0a6b95a6fba8467445208f9313e6 from https://github.com/OlivierSohn/mwc-random.git
Cloning into '/c/stack/.stack-work/downloaded/jNmoFavzvthp'...
': not a valid identifier
[1 of 2] Compiling Main ( C:\sr\setup-exe-src\setup-Z6RU0evB.hs, C:\sr\setup-exe-src\setup-Z6RU0evB.o )
[2 of 2] Compiling StackSetupShim ( C:\sr\setup-exe-src\setup-shim-Z6RU0evB.hs, C:\sr\setup-exe-src\setup-shim-Z6RU0evB.o )
Linking C:\sr\setup-exe-cache\i386-windows\tmp-Cabal-simple_Z6RU0evB_2.2.0.1_ghc-8.4.3.exe ...
clock-0.7.2: download
clock-0.7.2: configure
clock-0.7.2: build
clock-0.7.2: copy/register
happy-1.19.9: download
happy-1.19.9: configure
happy-1.19.9: build
hashable-1.2.7.0: download
hashable-1.2.7.0: configure
hashable-1.2.7.0: build
hashable-1.2.7.0: copy/register
async-2.2.1: download
async-2.2.1: configure
async-2.2.1: build
async-2.2.1: copy/register
haskell-lexer-1.0.1: download
haskell-lexer-1.0.1: configure
haskell-lexer-1.0.1: build
haskell-lexer-1.0.1: copy/register
imj-bindings-audio-types-0.1.0.3: configure (lib)
imj-bindings-audio-types-0.1.0.3: build (lib)
imj-bindings-audio-types-0.1.0.3: copy/register
primitive-0.6.3.0: download
primitive-0.6.3.0: configure
primitive-0.6.3.0: build
primitive-0.6.3.0: copy/register
strict-concurrency-0.2.4.2: download
strict-concurrency-0.2.4.2: configure
strict-concurrency-0.2.4.2: build
strict-concurrency-0.2.4.2: copy/register
unliftio-core-0.1.1.0: download
unliftio-core-0.1.1.0: configure
unliftio-core-0.1.1.0: build
unliftio-core-0.1.1.0: copy/register
unliftio-0.2.7.0: download
unliftio-0.2.7.0: configure
unliftio-0.2.7.0: build
unliftio-0.2.7.0: copy/register
vector-0.12.0.1: download
vector-0.12.0.1: configure
vector-0.12.0.1: build
vector-0.12.0.1: copy/register
imj-bindings-audio-0.1.0.3: configure (lib)
imj-bindings-audio-0.1.0.3: build (lib)
imj-bindings-audio-0.1.0.3: copy/register
-- While building custom Setup.hs for package happy-1.19.9 using:
C:\Users\appveyor\AppData\Local\Temp\1\stack1404\happy-1.19.9\.stack-work\dist\ba067387\setup\setup --builddir=.stack-work\dist\ba067387 build --ghc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure (-1073741819)
Logs have been written to: C:\stack\.stack-work\logs\happy-1.19.9.log
[1 of 2] Compiling Main ( C:\Users\appveyor\AppData\Local\Temp\1\stack1404\happy-1.19.9\Setup.lhs, C:\Users\appveyor\AppData\Local\Temp\1\stack1404\happy-1.19.9\.stack-work\dist\ba067387\setup\Main.o )
C:\Users\appveyor\AppData\Local\Temp\1\stack1404\happy-1.19.9\Setup.lhs:48:22: warning: [-Wdeprecations]
In the use of `rawSystemProgramConf'
(imported from Distribution.Simple.Program):
Deprecated: "use runDbProgram instead. This symbol will be removed in Cabal-3.0 (est. Oct 2018)."
|
48 | let runProgram p = rawSystemProgramConf (fromFlagOrDefault normal (buildVerbosity flags))
| ^^^^^^^^^^^^^^^^^^^^
[2 of 2] Compiling StackSetupShim ( C:\sr\setup-exe-src\setup-shim-Z6RU0evB.hs, C:\Users\appveyor\AppData\Local\Temp\1\stack1404\happy-1.19.9\.stack-work\dist\ba067387\setup\StackSetupShim.o )
Linking C:\Users\appveyor\AppData\Local\Temp\1\stack1404\happy-1.19.9\.stack-work\dist\ba067387\setup\setup.exe ...
Warning: happy.cabal:25:2: Tabs used as indentation at 25:2, 26:2, 27:2, 28:2,
29:2, 30:2, 31:2, 32:2, 33:2, 34:2, 35:2, 36:2, 37:2, 38:2, 39:2, 40:2, 41:2,
42:2, 43:2, 44:2, 45:2, 46:2, 47:2, 48:2, 49:2, 50:2, 51:2, 52:2, 53:2, 54:2,
55:2, 56:2, 57:2, 58:2, 59:2, 60:2, 61:2, 62:2, 63:2, 64:2, 65:2, 66:2, 67:2,
68:2, 69:2, 70:2, 71:2, 72:2, 73:2, 74:2, 75:2, 76:2, 77:2, 78:2, 79:2, 80:2,
81:2, 82:2, 83:2, 84:2, 85:2, 86:2, 87:2, 88:2, 89:2, 90:2, 91:2, 92:2, 93:2,
94:2, 95:2, 96:2, 97:2, 98:2, 99:2, 100:2, 101:2, 102:2, 103:2, 104:2, 105:2,
106:2, 107:2, 108:2, 109:2, 110:2, 111:2, 112:2, 113:2, 114:2, 115:2, 116:2,
117:2, 118:2, 119:2, 120:2, 121:2, 122:2
Configuring happy-1.19.9...
Command exited with code 1
@erikd in the first log of the original poster, I found this :
Reading available packages of hackage.haskell.org...
Using most recent state specified from most recent cabal update
index-state(hackage.haskell.org) = 2018-05-17T01:00:29Z
Failed to query pkg-config, Cabal will continue without solving for pkg-config
constraints: dieVerbatim: user error (CallStack (from HasCallStack):
die', called at .\Distribution\Simple\Program\Db.hs:423:28 in
Cabal-2.2.0.1-498b1ffb97317cbfc8432b5b6c862cebeca566be:Distribution.Simple.Program.Db
requireProgram, called at .\Distribution\Solver\Types\PkgConfigDb.hs:65:21 in
main:Distribution.Solver.Types.PkgConfigDb
cabal: The program 'pkg-config' is required but it could not be found.
)
which indicates cabal 2.2 is used.
I'll see if I can now point to your fork of happy apply your patch and relauch my build, to see if your changes fix the problem
@erikd The cabal version wasn't the issue, actually Cabal 2.2 is the right version when building with ghc 8.4.x ! Here are the logs : https://ci.appveyor.com/project/OlivierSohn/hamazed
Thanks for the suggestion anyway :)
If it helps, -1073741819
is a segfault. Haskell exit codes are signed, while windows error codes are unsigned. -1073741819 == 0xc0000005
which is the system code for segfault.
I don't think the error is happy related, we've been having a persistent segfault on the 32bit build of GHC which seems to only happen every so often. But AppVeyor seems to regularly trigger it. Unfortunately I have yet to be able to reproduce it locally which makes debugging very hard.. I'm waiting for information from a few people to see if I can get dumps or information to reproduce it.
from the output and the crash location this seems to be https://ghc.haskell.org/trac/ghc/ticket/15154
So maybe my issue is different (I'm building with ghc 8.4.3, the ticket says ghc 8.4.2 is fine)
Then my problem comes from stack maybe? (when building happy on my machine, it's fine with stack + ghc8.2, but broken with stack + ghc8.4.3 with a 'couldn't find happy' error)
GHC 8.4.3
isn't free of the problem, it's just easier to reproduce on certain versions/environments.
However in your case it's not a segfault, the exit code is 1. That I don't know what's going on since I don't know how to debug stack.
But the original issue from @mcandre is the memory corruption that's been in the 32 bit versions of ghc for a while now. Unfortunately reproducing it on any of my machines has been unsuccessful... So any dumps I can get would be very helpful.
@OlivierSohn looking at your log again, you do have the same issue
-- While building custom Setup.hs for package happy-1.19.9 using:
C:\Users\appveyor\AppData\Local\Temp\1\stack3016\happy-1.19.9\.stack-work\dist\ba067387\setup\setup --builddir=.stack-work\dist\ba067387 build --ghc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure (-1073741819)
Logs have been written to: C:\stack\.stack-work\logs\happy-1.19.9.log
is a bit higher up in the build log.
It may also be https://ghc.haskell.org/trac/ghc/ticket/15095 where unlit
seems to be segfaulting on the 32 bit builds. AppVeyor seems to reasonably deterministically trigger these but I don't know why.. Without any sort of a dump I don't even know where to begin here...
Would it be possible to get dumps from appveyor?
Yes, you can set up remote desktop to the instance https://www.appveyor.com/docs/how-to/rdp-to-build-worker/
and then replay the command that failed, in your case C:\Users\appveyor\AppData\Local\Temp\1\stack3016\happy-1.19.9\.stack-work\dist\ba067387\setup\setup --builddir=.stack-work\dist\ba067387 build --ghc-options " -ddump-hi -ddump-to-file"
instructions are in https://ghc.haskell.org/trac/ghc/ticket/15154
I see. I'm afraid I won't be able to retry this anytime soon, but anyone can fork my repo and use appveyor to reproduce it / grab the dump.
I can confirm that using the 64-bit ghc fixes the issue for me!
Found the cause, I'll fix it this sometime this week. This ticket can be closed as it's a GHC bug, the progress can be tracked on the trac link above.
I can install happy in Windows 10 x86_64, and I can install other packages like Shake in Windows 10 x86, however when I try to install happy in Windows 10 x86, I get a strange error.
Trace