Skip to content

Failure of hadrian stage1 libffi: Needed "_validatebuild/stage1/rts/build/libffi.so.9.0" which is not any of libffi's built shared libraries: ["_validatebuild/stage1/libffi/build/inst/lib/libffi.so.9.0"]

Summary

Hadrian build fails on OpenBSD:

| ContextData oracle: resolving data for 'ghc' (Stage1, v)...
# _validatebuild/stage1/compiler/setup-config
# _validatebuild/stage0/utils/haddock/build/Documentation/Haddock.o
# _validatebuild/stage0/utils/haddock/build/Main.o
# _validatebuild/stage0/utils/haddock/build/Documentation/Haddock.o _validatebuild/stage0/utils/haddock/build/Documentation/Haddock.hi
# _validatebuild/stage0/utils/haddock/build/Main.o _validatebuild/stage0/utils/haddock/build/Main.hi
# _validatebuild/stage0/utils/haddock/build/Documentation/Haddock.hi
# _validatebuild/stage1/rts/build/libCffi_thr_l.a
# _validatebuild/stage1/rts/build/libCffi_thr_debug.a
# _validatebuild/stage1/rts/build/libCffi_l.a
# _validatebuild/stage1/rts/build/libCffi_debug.a
# _validatebuild/stage1/rts/build/libCffi_thr.a
# _validatebuild/stage1/rts/build/libCffi.a
# _validatebuild/stage1/rts/build/libffi.so.9.0
Error when running Shake build system:
  at action, called at src/Rules.hs:39:19 in main:Rules
  at need, called at src/Rules.hs:61:5 in main:Rules
* Depends on: _validatebuild/stage1/lib/package.conf.d/ghc-prim-0.8.0.conf
  at apply1, called at src/Development/Shake/Internal/Rules/Oracle.hs:159:32 in shake-0.19.4-956df6a960f412f043f5c30515a600878ff928d4342dfe8839afc8448494863c:Development.Shake.Internal.Rules.Oracle
* Depends on: OracleQ (ContextDataKey (Context {stage = Stage1, package = Package {pkgType = Library, pkgName = "ghc-prim", pkgPath = "libraries/ghc-prim"}, way = v}))
  at need, called at src/Hadrian/Oracles/Cabal/Rules.hs:54:9 in main:Hadrian.Oracles.Cabal.Rules
* Depends on: _validatebuild/stage1/libraries/ghc-prim/setup-config
  at need, called at src/Rules/Library.hs:164:18 in main:Rules.Library
* Depends on: _validatebuild/stage1/rts/build/libffi.so.9.0
  at error, called at src/Rules/Rts.hs:77:18 in main:Rules.Rts
* Raised the exception:
Needed "_validatebuild/stage1/rts/build/libffi.so.9.0" which is not any of libffi's built shared libraries: ["_validatebuild/stage1/libffi/build/inst/lib/libffi.so.9.0"]

Build failed.

Steps to reproduce

I'm using this patched tree (blackgnezdo/ghc@93b01c3d) to avoid #18173 (closed). I start the build and it fails with diagnostics above.

ulimit -d $((10<<20));  AUTOCONF_VERSION=2.71 AUTOMAKE_VERSION=1.16 ./validate  --build-only 

These are the only files to choose from, note the absence of *.so (which is normal on OpenBSD):

% ls -l  _validatebuild/stage1/libffi/build/inst/lib/
total 368
-rw-r--r--  1 greg  wsrc  92662 Nov  7 11:55 libffi.a
-rwxr-xr-x  1 greg  wsrc    947 Nov  7 11:55 libffi.la
-rwxr-xr-x  1 greg  wsrc  65856 Nov  7 11:55 libffi.so.9.0
drwxr-xr-x  2 greg  wsrc    512 Nov  7 11:55 pkgconfig

I suspect hadrian/src/Rules/Rts.hs needs to adapt as this is unlikely to work given the files above:

        buildPath -/- "libffi*.so*"    %> copyLibffiDynamicUnix stage ".so"

Expected behavior

Build goes all the way.

Environment

  • GHC version used: 8.10.6

Optional:

  • Operating System: OpenBSD 7.0-current
  • System Architecture: amd64
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information