Opened 13 months ago

Last modified 11 months ago

#16073 new bug

Hadrian build fails on Windows

Reported by: bgamari Owned by:
Priority: high Milestone: 8.8.1
Component: Build System (Hadrian) Version: 8.6.3
Keywords: Cc: snowleopard, alpmestan, angerman
Operating System: Windows Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description (last modified by bgamari)

| Successfully built library 'rts' (Stage1, way v). |
| Library: _build/stage1/rts/build/libHSrts-1.0.a   |
| Run Ld Stage1: _build/stage1/rts/build/c/Adjustor.o (and 117 more) => _build/stage1/rts/build/HSrts-1.0.o
copyFile: does not exist (The system cannot find the file specified.)
shakeArgsWith     0.001s    0%                           
Function shake    0.017s    0%                           
Database read     0.337s    0%                           
With database     0.033s    0%                           
Running rules  4047.874s   99%  =========================
Total          4048.261s  100%                           
Error when running Shake build system:
  at src/Main.hs:58:30-42:
* Depends on: binary-dist
  at src/Rules/BinaryDist.hs:97:9-21:
* Depends on: _build/stage1/lib/package.conf.d/rts-1.0.conf
* Raised the exception:
ExitFailure 1


Change History (9)

comment:1 Changed 13 months ago by bgamari

Description: modified (diff)

comment:2 Changed 13 months ago by alpmestan

Cc: snowleopard alpmestan added

comment:3 Changed 13 months ago by Ben Gamari <ben@…>

In 4147df3a/ghc:

gitlab-ci: Allow Hadrian build on Windows to fail

Due to #16073.

comment:4 Changed 13 months ago by alpmestan

I don't know why, but I just can't reproduce this, I always go past the point of registering the stage 1 RTS. Apparently, Andrey hasn't run into this either since he reported that his Windows builds were working just fine except for the Shake --lint problems from #15971.

What I did run into is a failure to copy _build/stage1/lib/x86_64-windows-ghc-8.7.[...]/rts-1.0/include to _build/bindist/ghc-8.7.[...]-unknown-mingw32, because the former doesn't exist. What does exist is _build/stage1/x86_64-windows-ghc-8.7.[...]/rts-1.0/include, that is, without the lib in the middle. This seems quite wrong.

As a reference, on my usual Linux system, the rts include dir is located under _build/stage1/lib/x86_64-linux-ghc-8.7.20190111/rts-1.0/include. This is from the same GHC commit as the one with which I tried to build a bindist on Windows.

Andrey, I am failing to see where in Hadrian we could be doing things differently on Windows and other systems. Do you have any idea of what's going on?

This doesn't help solve the error that the Windows CI runs into though.

comment:5 Changed 13 months ago by snowleopard

Alp: I can reproduce this on my machine. Indeed, in addition to the directory _build/stage0/lib, I appear to also have _build/stage0/x86_64-windows-ghc-8.4.3, without lib.

If I look at a file like _build/stage0/libraries/ghc-boot-th/build/autogen/Paths_ghc_boot_th.hs, I can see the following directory settings:

bindir     = "${pkgroot}/..\\bin"
libdir     = "${pkgroot}/..\\x86_64-windows-ghc-8.4.3\\ghc-boot-th-8.7"
dynlibdir  = "${pkgroot}/..\\x86_64-windows-ghc-8.4.3"
datadir    = "${pkgroot}/..\\x86_64-windows-ghc-8.4.3\\ghc-boot-th-8.7"
libexecdir = "${pkgroot}/..\\ghc-boot-th-8.7\\x86_64-windows-ghc-8.4.3\\ghc-boot-th-8.7"
sysconfdir = "${pkgroot}/..\\etc"

So, it looks like these settings are computed incorrectly. Is this done by Cabal? Or ghc-pkg? This is the Hadrian corner which I understand very little about.

Could you show the above list of settings on your machine?

Perhaps, Moritz could help figure this out, since I believe he was writing some of the associated code?

Moritz: Any suggestions?

Last edited 13 months ago by snowleopard (previous) (diff)

comment:6 Changed 13 months ago by snowleopard

Cc: angerman added

comment:7 Changed 13 months ago by angerman

This does look like Cabal. Do we know which commit introduced the breaking change? I think Cabal was bumped on master recently. But this could be a wrong lead. I guess some bisect would help pink this down.

comment:8 Changed 13 months ago by snowleopard

Thanks Moritz!

I am not sure the bindist rule ever worked on Windows, because I don't recall testing it myself, and we never had it on CI.

The default build target seems to be OK with incorrect directory settings.

comment:9 Changed 11 months ago by angerman

There is some other windows related issue in Cabal, that slyfox mentioned today:

that might be cross compilation related only though.

Note: See TracTickets for help on using tickets.