Opened 4 years ago

Last modified 5 months ago

#8228 new bug

GHC built under Windows does not generate dyn_hi files

Reported by: ezyang Owned by: Phyx-
Priority: high Milestone: 8.4.1
Component: Compiler Version: 7.7
Keywords: Cc: Phyx-
Operating System: Windows Architecture: Unknown/Multiple
Type of failure: GHC doesn't work at all Test Case: cabal01
Blocked By: Blocking: #6107
Related Tickets: #7134 Differential Rev(s):
Wiki Page:

Description

I found cabal01 failing with:

=====> cabal01(normal) 1 of 1 [0, 0, 0]                                                        
cd . && $MAKE -s --no-print-directory cabal01 VANILLA=--enable-library-vanilla PROF=--disable-l
ibrary-profiling DYN=--enable-shared     </dev/null >cabal01.run.stdout 2>cabal01.run.stderr   
Wrong exit code (expected 0 , actual 2 )                                                       
Stdout:                                                                                        
                                                                                               
Stderr:                                                                                        
Creating library file: dist\build\libHStest-1.0-ghc7.7.20130904.dll.a                          
setup.exe: Error: Could not find module: A with any suffix: ["dyn_hi"] in the search path: ["dist\\build"]                                                                   
make[2]: *** [cabal01] Error 1                                                                 
                                    

but I bet some of the other failures are due to this. Indeed, in dist/build, there are no dyn_hi files

When I look more closely at the commands being run, I see:

bash.exe-3.1$ c:/Users/ezyang/Dev/ghc-validate/inplace/bin/ghc-stage2.exe --make -fbuilding-ca bal-package -O -static -dynamic-too -dynosuf dyn_o -dynhisuf dyn_hi -outputdir dist/build -odi r dist/build -hidir dist/build -stubdir dist/build -i -idist/build -i. -idist/build/autogen -I dist/build/autogen -Idist/build -optP-include -optPdist/build/autogen/cabal_macros.h -package- name test-1.0 -hide-all-packages -no-user-package-db -package-db local.db -package-db dist/pac kage.conf.inplace -package-id base-4.7.0.0-inplace -XHaskell98 -XForeignFunctionInterface A B. A -fforce-recomp -dcore-lint -dcmm-lint -dno-debug-output -no-user-package-db                  
[1 of 2] Compiling B.A              ( B\A.hs, dist\build\B\A.o )                               
[2 of 2] Compiling A                ( A.hs, dist\build\A.o )  

which should result in dyn_hi files but does not. I haven't traced it any further yet.

Change History (22)

comment:1 Changed 4 years ago by awson

In short, in compiler/main/DynFlags.hs "YES" in ("Support dynamic-too", "YES") should be changed to "NO" for Windows. See the discussion here: http://ghc.haskell.org/trac/ghc/ticket/7134#comment:23.

Version 1, edited 4 years ago by awson (previous) (next) (diff)

comment:2 Changed 4 years ago by shelarcy

comment:3 Changed 4 years ago by thoughtpolice

Owner: set to thoughtpolice

comment:4 Changed 4 years ago by thoughtpolice

Priority: highhighest

comment:5 Changed 3 years ago by thoughtpolice

The most bizarre aspect of this ticket now that I'm looking at it more deeply is that if you don't use --make, i.e. you're using one-shot mode, then GHC does indeed seem to generate dynamic interface files successfully. I have no idea why --make mode would be any different (yet)

comment:6 Changed 3 years ago by Austin Seipp <austin@…>

In 4af1e76c701a7698ebd9b5ca3fb1394dd8b56c8d/ghc:

Add Windows to NoSharedLibsPlatformList

We're punting on full -dynamic and -dynamic-too support for Windows
right now, since it's still unstable. Also, ensure "Support dynamic-too"
in `ghc --info` is set to "NO" for Cabal.

See issues #7134, #8228, and #5987

Signed-off-by: Austin Seipp <austin@well-typed.com>

comment:7 Changed 3 years ago by thoughtpolice

Milestone: 7.8.17.8.2

comment:8 Changed 3 years ago by gidyn

Cc: gideon@… added

comment:9 Changed 3 years ago by thoughtpolice

Milestone: 7.8.27.8.3

comment:10 Changed 3 years ago by thoughtpolice

Priority: highesthigh

comment:11 Changed 3 years ago by thoughtpolice

Milestone: 7.8.37.8.4

Moving to 7.8.4.

comment:12 Changed 3 years ago by thoughtpolice

Milestone: 7.8.47.10.1

Moving (in bulk) to 7.10.4

comment:13 Changed 3 years ago by thomie

Blocking: 6107 added

comment:14 Changed 2 years ago by thoughtpolice

Milestone: 7.10.17.12.1

Moving to 7.12.1

comment:15 Changed 2 years ago by gidyn

Cc: gideon@… removed

comment:16 Changed 21 months ago by thoughtpolice

Milestone: 7.12.18.0.1

Milestone renamed

comment:17 Changed 16 months ago by bgamari

Austin, do you still intend on looking at this?

comment:18 Changed 16 months ago by bgamari

Milestone: 8.0.18.2.1

Punting to 8.2.

comment:19 Changed 5 months ago by bgamari

Cc: Phyx- added
Owner: thoughtpolice deleted

Unassigning.

Phyx, have you seen this?

comment:20 Changed 5 months ago by Phyx-

I don't seem to have this issue with Phab:D2592 but I haven't looked very deeply. But I am able to build with DYNAMIC_TOO set and build dynamic programs fine.

I will rebase that patch and update it most likely next week, should have more free time.

comment:21 Changed 5 months ago by Phyx-

In my patch I do see dyn_hi being generated. So that should be fine now.

comment:22 Changed 5 months ago by Phyx-

Milestone: 8.2.18.4.1
Owner: set to Phyx-
Note: See TracTickets for help on using tickets.