Skip to content

GHC base directory assumptions

GHC and ghc-pkg make some pretty hard assumptions about where they're running on Windows. They assume that they are always running from foo/bin/ghc.exe and that to find the lib folder they can drop bin/ghc.exe from the base path and append lib.

This is already false for the testsuite, which when testing the bindist has one test which puts the binaries in inplace/test spaces.

For some reason before this was either being skipped or mysteriously passing. But as of 2017.02.11 our luck ran out.

the testsuite triggers a failure such as:

[04:16:21][Step 3/6] ghc-pkg.exe: Can't find package database in C:/TeamCity/buildAgent/work/28754042a1be6052/inplace/test   sp\lib
[04:16:22][Step 3/6] ghc-pkg.exe: Can't find package database in C:/TeamCity/buildAgent/work/28754042a1be6052/inplace/test   sp\lib
[04:16:23][Step 3/6] Traceback (most recent call last):
[04:16:23][Step 3/6]   File "../../driver/runtests.py", line 215, in <module>
[04:16:23][Step 3/6]     pkginfo = str(getStdout([config.ghc_pkg, 'dump']))
[04:16:23][Step 3/6]   File "/c/TeamCity/buildAgent/work/28754042a1be6052/testsuite/driver/testutil.py", line 23, in getStdout
[04:16:23][Step 3/6]     raise Exception("Command failed: " + str(cmd_and_args))
[04:16:23][Step 3/6] Exception: Command failed: ['"/c/TeamCity/buildAgent/work/28754042a1be6052/inplace/test   spaces/ghc-pkg.exe"', 'dump']
[04:16:23][Step 3/6] make: *** [../../mk/test.mk:299: test] Error 1
[04:16:23][Step 3/6] 
[04:16:23][Step 3/6] ==== STAGE 1 TESTS ==== 
[04:16:23][Step 3/6] cat: testsuite_summary_stage1.txt: No such file or directory
[04:16:23][Step 3/6] Process exited with code 1

Let's soften the assumption and just check that ../lib exists instead.

Trac metadata
Trac field Value
Version 8.0.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information