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

Build failure with GHC-7.8.4 (x86) #138

Open
phadej opened this issue Dec 23, 2019 · 5 comments
Open

Build failure with GHC-7.8.4 (x86) #138

phadej opened this issue Dec 23, 2019 · 5 comments

Comments

@phadej
Copy link

phadej commented Dec 23, 2019

https://ci.appveyor.com/project/hvr/paths/builds/29725968/job/q88c02jr7k66i2sp

Edit: cabal seems to use hsc2hc-0.68.3, maybe that's relevant.

On x86-64 version it seems to build fine.

Preprocessing library for Win32-2.8.4.0..
Types.hsc: In function '_hsc2hs_test41':
Types.hsc:217:20: error: storage size of 'test_array' isn't constant
Types.hsc:217:20: warning: unused variable 'test_array'
Types.hsc:217:20: error: storage size of 'test_array' isn't constant
Types.hsc:217:20: warning: unused variable 'test_array'
Types.hsc:217:20: error: storage size of 'test_array' isn't constant
Types.hsc:217:20: warning: unused variable 'test_array'
Types.hsc:217:20: error: storage size of 'test_array' isn't constant
Types.hsc:217:20: warning: unused variable 'test_array'
compilation failed
cabal.exe: Failed to build Win32-2.8.4.0 (which is required by paths-0.2.0.0).
See the build log above for details.
Command exited with code 1
@Mistuke
Copy link
Contributor

Mistuke commented Dec 27, 2019

I haven't been able to reproduce this locally but I do see it on AppVeyor too.. by the speed which hsc2hs seems to be working here I think it thinks it has to cross compile.. I'll take a look.

@Mistuke
Copy link
Contributor

Mistuke commented Dec 29, 2019

Right, this seems to be a cabal bug. Cabal has at some point decided to start passing -x to hsc2hs which is asking it to cross compile.

"C:\ProgramData\chocolatey\lib\ghc\tools\ghc-8.6.2\bin\hsc2hs.exe" "-x" "@C:\WORK\dist-newstyle\build\i386-windows\ghc-8.6.2\Win32-2.8.4.0\build\Graphics\Win32\GDI\hsc41.txt"

This is very slow and hit and mess for win32.. I could maybe change the declarations so it generates something hsc2hs would accept in cross compile mode, but that's just working around the issues. hsc2hs should do this resolving differently and cabal shouldn't pass -x.

@Mistuke
Copy link
Contributor

Mistuke commented Dec 29, 2019

Actually, looking at https://ci.appveyor.com/project/hvr/paths/builds/29725968/job/q88c02jr7k66i2sp I see the issue

cabal v3.0.0.0 [Approved]
cabal package files install completed. Performing other installation steps.
Downloading cabal 64 bit
  from 'https://downloads.haskell.org/cabal/cabal-install-3.0.0.0/cabal-install-3.0.0.0-x86_64-unknown-mingw32.zip'

So it downloads a 64-bit cabal version and tries to use the 32-bit toolchain. Cabal doesn't detect that the toolchain it's calling it already 32-bits so it instructs hsc2hs to cross compile.

The fix is to download the 32-bit version of cabal too.

choco install -y cabal %CHOCOPTS%

needs to be

choco install -y cabal %GHCOPTS% %CHOCOPTS%

I think this example may have come from my blog, I'll check and update it later

@Mistuke
Copy link
Contributor

Mistuke commented Dec 29, 2019

I've corrected the example at https://hub.zhox.com/posts/introducing-haskell-dev/

bgamari pushed a commit to bgamari/win32 that referenced this issue Sep 10, 2020
@andreasabel
Copy link
Member

Is this issue fixed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants