Repository navigation
GHC 8.4 syntax error (on Windows specifically; Linux and OS X are fine) #313
Description
Activity
- changed the title
[-]GHC 8.4 syntax error[/-][+]GHC 8.4 syntax error (on Windows specifically; Linux and OS X are fine)[/+]on Mar 13, 2018 Strange. AppVeyor works well for the 2.6 branch.
@Mistuke Do you have any ideas?
The module is deferring
#include <HsNetDef.h>(note the two #), sohsc2hswon't process the preprocessor macro.Since it's been deferred you need to enable
CPPto have GHC preprocess the hs file.
So add{-# LANGUAGE CPP #-}at the top and that should fix it.@chrisdone Could you modify files according to @Mistuke's suggestion, confirm and send a PR?
I am not able to reproduce this error on my windows machine.
stack unpack network-2.6.3.4 cd network-2.6.3.4 notepad.exe stack.yaml # resolver: nightly-2018-03-16 stack build
Instead I merely get warnings that say:
* the 'stdcall' calling convention is unsupported on this platform treating as ccallstack-1.6.5 (windows 64 bit version)
Windows 10 Home edition (64 bit)I am using 32bit GHC, which might be the difference
That's a different issue, that issue is that the definition of CALLCONV is wrong, it checks for
_WIN32which is also defined when the target is a 64 bit target https://msdn.microsoft.com/en-us/library/b0084kay.aspxIt should instead check for the GHC Macros we put out for this stuff like Win32 does or check
_WIN64first.In that case, I'm extremely confused as to what is causing the original issue since, if I'm reading that correctly,
CALLCONVshould always be defined to something?(I am also unable to reproduce the issue with 32-bit GHC 8.4.1.)
- CALLCONV is never included correctly. I'm more confused by why it has been working thus far. The only time a preprocessor runs over this file is when it's told to skip processing of the include. So this shouldn't have ever worked. Unless hsc2hs had a bug or unexpected behavior…On Sat, Mar 17, 2018, 00:13 Ryan Scott ***@***.***> wrote: In that case, I'm extremely confused as to what is causing the original issue since, if I'm reading that correctly, CALLCONV should always be defined to *something*? (I am also unable to reproduce the issue with 32-bit GHC 8.4.1.) — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#313 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ABH3KeWQ2xTpdQoe_EzIOzsAcA4PQA5cks5tfFU2gaJpZM4SoYfD> .
Yes but whatever is processing the cabal file is not passing it along to the compiler as the preprocessor is not running. so my suggestion would still work.
I can't reproduce this issue with
cabal-installnor withghc 8.4. So it's not a network problem or a problem with the ghc HQ produced bindists.the warning @ndmitchell is seeing I'll fix.
It's not a warning, it's an error, and I'm seeing it with Stack i386 on Windows.
I meant the warning @DanBurton is seeing about the calling convention.
I don't think the error your seeing is a network bug.
You can try adding something like#error footoHsNetDef.hto see if the preprocessor is being ran at all.If you can paste the command the ghc command it's running for compiling
Compiling Network.Socket.Typesor the ghc -v3 output for this module that would help figure out what's wrong.I can't reproduce locally, but it very definitely happens on Appveyor repeatedly.
- Can you pass -v3 to ghc and link back the appveyors log? Which windows is your appveyor instance based on? I remember there being two options.…On Mon, Mar 19, 2018, 19:22 Neil Mitchell ***@***.***> wrote: I can't reproduce locally, but it very definitely happens on Appveyor repeatedly. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#313 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ABH3KSAwFgMU_FjtK7t3bTjjyyxrLcghks5tgAVhgaJpZM4SoYfD> .
27 remaining items
I think it's pretty clear this is a stack issue. I think we should close this as there's nothing we can do about it downstream. Master no longer uses this approach, so a possible solution is to update to a newer network?
@Mistuke - is there a release using the new approach?
@ndmitchell I believe the 2.7 release should work.
Ah no, looking at the tag it doesn't. @kazu-yamamoto maybe it's worth including the
CALLCONVchanges into the2.7.0.1release in #322 ? That should fixnetworkonstack.@Mistuke Would you make a PR?
Allright, sure
Done, see #323
I would like to close this. Please reopen this if necessary.
@kazu-yamamoto @Mistuke Not sure if i m writing where it is needed but i got the same problem while building network-2.6.3.6 on windows 10. ghc 8.4.3.
@AndreiChugunov You should use 2.7, that should be working.
@Mistuke I'm sorry i'm new to stack and haskell overall. I have dependencies in my package.yaml:
dependencies:- base >= 4.7 && < 5
- servant-server
- aeson
- wai
- warp
Is seems like aeson needs a network library. How can i specify i need network-2.7 not 2.6.3.6? Can i just simply write it down in dependecies section in package.yaml? Thanks a lot for your fast reply and help!
- Hmm sorry I'm not that familiar with stack. You probably need a newer resolver? With cabal it would be `--allow-newer`. Maybe someone else here knows how to get 2.7 with stack.…On Sun, Oct 14, 2018, 13:41 AndreiChugunov ***@***.***> wrote: @Mistuke <https://github.com/Mistuke> I'm sorry i'm new to stack and haskell overall. I have dependencies in my package.yaml: dependencies: - base >= 4.7 && < 5 - servant-server - aeson - wai - warp Is seems like aeson needs a network library. How can i specify i need network-2.7 not 2.6.3.6? Can i just simply write it down in dependecies section in package.yaml? Thanks a lot for your fast reply and help! — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#313 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ABH3KQ2HwMx-8or4j0cfy23xZ0ek3dlfks5ukzEQgaJpZM4SoYfD> .
@Mistuke ugh. I specified version of network to 2.7.0.2. And it seems to build successfully but for now i get the following error " unable to load package network-2.7.0.2 ":
`Error:
-- While building custom Setup.hs for package wai-app-static-3.1.6.2 using:
C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_2.2.0.1_ghc-8.4.3.exe --builddir=.stack-work\dist\7d103d30 build --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
Process exited with code: ExitFailure 1
Logs have been written to: C:\Users\809279\Desktop\testBuild\testProj.stack-work\logs\wai-app-static-3.1.6.2.logConfiguring wai-app-static-3.1.6.2... Preprocessing library for wai-app-static-3.1.6.2.. Building library for wai-app-static-3.1.6.2.. [1 of 9] Compiling WaiAppStatic.Types ( WaiAppStatic\Types.hs, .stack-work\dist\7d103d30\build\WaiAppStatic\Types.o ) [2 of 9] Compiling Util ( Util.hs, .stack-work\dist\7d103d30\build\Util.o ) [3 of 9] Compiling WaiAppStatic.Listing ( WaiAppStatic\Listing.hs, .stack-work\dist\7d103d30\build\WaiAppStatic\Listing.o ) WaiAppStatic\Listing.hs:67:34: warning: [-Wname-shadowing] This binding for `pieces' shadows the existing binding bound at WaiAppStatic\Listing.hs:27:16 | 67 | showFolder' hasTrailingSlash pieces = showFolder hasTrailingSlash (unsafeToPiece "root" : pieces) | ^^^^^^ WaiAppStatic\Listing.hs:120:24: warning: [-Wunused-local-binds] Defined but not used: `isFile' | 120 | let isFile = either (const False) (const True) md | ^^^^^^ [4 of 9] Compiling WaiAppStatic.Storage.Filesystem ( WaiAppStatic\Storage\Filesystem.hs, .stack-work\dist\7d103d30\build\WaiAppStatic\Storage\Filesystem.o ) [5 of 9] Compiling WaiAppStatic.Storage.Embedded.TH ( WaiAppStatic\Storage\Embedded\TH.hs, .stack-work\dist\7d103d30\build\WaiAppStatic\Storage\Embedded\TH.o ) WaiAppStatic\Storage\Embedded\TH.hs:10:1: warning: [-Wunused-imports] The import of `Control.Applicative' is redundant except perhaps to import instances from `Control.Applicative' To import instances alone, use: import Control.Applicative() | 10 | import Control.Applicative | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [6 of 9] Compiling WaiAppStatic.Storage.Embedded.Runtime ( WaiAppStatic\Storage\Embedded\Runtime.hs, .stack-work\dist\7d103d30\build\WaiAppStatic\Storage\Embedded\Runtime.o ) [7 of 9] Compiling WaiAppStatic.Storage.Embedded ( WaiAppStatic\Storage\Embedded.hs, .stack-work\dist\7d103d30\build\WaiAppStatic\Storage\Embedded.o ) [8 of 9] Compiling Network.Wai.Application.Static ( Network\Wai\Application\Static.hs, .stack-work\dist\7d103d30\build\Network\Wai\Application\Static.o ) ghc.EXE: unable to load package `network-2.7.0.2' ghc.EXE: | C:\Users\809279\Desktop\testBuild\testProj\.stack-work\install\c4f08ade\lib\x86_64-windows-ghc-8.4.3\network-2.7.0.2-HRKpEmrZF0Z7oBCs9x5PCR\HSnetwork-2.7.0.2-HRKpEmrZF0Z7oBCs9x5PCR.o: unknown symbol `acceptNewSock'`Is it a known error? Seems like it is the last error i have to fix :<
- Seems like the preprocessor went wrong. See https://www.fpcomplete.com/blog/2018/06/sed-a-debugging-story if the fix there works for you.…On Sun, Oct 14, 2018, 16:07 AndreiChugunov ***@***.***> wrote: @Mistuke <https://github.com/Mistuke> ugh. I specified version of network to 2.7.0.2. And it seems to build successfully but for now i get the following error " unable to load package network-2.7.0.2' ":Error: -- While building custom Setup.hs for package wai-app-static-3.1.6.2 using: C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_2.2.0.1_ghc-8.4.3.exe --builddir=.stack-work\dist\7d103d30 build --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always" Process exited with code: ExitFailure 1 Logs have been written to: C:\Users\809279\Desktop\testBuild\testProj.stack-work\logs\wai-app-static-3.1.6.2.log Configuring wai-app-static-3.1.6.2... Preprocessing library for wai-app-static-3.1.6.2.. Building library for wai-app-static-3.1.6.2.. [1 of 9] Compiling WaiAppStatic.Types ( WaiAppStatic\Types.hs, .stack-work\dist\7d103d30\build\WaiAppStatic\Types.o ) [2 of 9] Compiling Util ( Util.hs, .stack-work\dist\7d103d30\build\Util.o ) [3 of 9] Compiling WaiAppStatic.Listing ( WaiAppStatic\Listing.hs, .stack-work\dist\7d103d30\build\WaiAppStatic\Listing.o ) WaiAppStatic\Listing.hs:67:34: warning: [-Wname-shadowing] This binding for `pieces' shadows the existing binding bound at WaiAppStatic\Listing.hs:27:16 | 67 | showFolder' hasTrailingSlash pieces = showFolder hasTrailingSlash (unsafeToPiece "root" : pieces) | ^^^^^^ WaiAppStatic\Listing.hs:120:24: warning: [-Wunused-local-binds] Defined but not used: `isFile' | 120 | let isFile = either (const False) (const True) md | ^^^^^^ [4 of 9] Compiling WaiAppStatic.Storage.Filesystem ( WaiAppStatic\Storage\Filesystem.hs, .stack-work\dist\7d103d30\build\WaiAppStatic\Storage\Filesystem.o ) [5 of 9] Compiling WaiAppStatic.Storage.Embedded.TH ( WaiAppStatic\Storage\Embedded\TH.hs, .stack-work\dist\7d103d30\build\WaiAppStatic\Storage\Embedded\TH.o ) WaiAppStatic\Storage\Embedded\TH.hs:10:1: warning: [-Wunused-imports] The import of `Control.Applicative' is redundant except perhaps to import instances from `Control.Applicative' To import instances alone, use: import Control.Applicative() | 10 | import Control.Applicative | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [6 of 9] Compiling WaiAppStatic.Storage.Embedded.Runtime ( WaiAppStatic\Storage\Embedded\Runtime.hs, .stack-work\dist\7d103d30\build\WaiAppStatic\Storage\Embedded\Runtime.o ) [7 of 9] Compiling WaiAppStatic.Storage.Embedded ( WaiAppStatic\Storage\Embedded.hs, .stack-work\dist\7d103d30\build\WaiAppStatic\Storage\Embedded.o ) [8 of 9] Compiling Network.Wai.Application.Static ( Network\Wai\Application\Static.hs, .stack-work\dist\7d103d30\build\Network\Wai\Application\Static.o ) ghc.EXE: unable to load package `network-2.7.0.2' ghc.EXE: | C:\Users\809279\Desktop\testBuild\testProj\.stack-work\install\c4f08ade\lib\x86_64-windows-ghc-8.4.3\network-2.7.0.2-HRKpEmrZF0Z7oBCs9x5PCR\HSnetwork-2.7.0.2-HRKpEmrZF0Z7oBCs9x5PCR.o: unknown symbol `acceptNewSock'` Is it a known error? Seems like it is the last error i have to fix :< — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#313 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ABH3KQsWoxYoPWPmCHRUg_aIUALKDvfeks5uk1McgaJpZM4SoYfD> .
The following syntax error happens when compiling network-2.6.3.4 on Windows https://ci.appveyor.com/project/chrisdone/intero/build/1.0.260#L34319
I suppose that calling convention syntax isn't allowed on Windows?