Skip to content

validate[296]: Resolving: not found (extraneous cabal-install output?)

Summary

validate picks up wrong hadrian_cmd resulting in broken build with confusing output:

+ set -e
+ no_clean=0
+ testsuite_only=0
+ build_only=0
+ hpc=NO
+ speed=NORMAL
+ be_quiet=0
+ tar_comp=gzip
+ use_hadrian=YES
+ use_stack=NO
+ hadrian_build_root=_validatebuild
+ [ 0 -gt 0 ]
+ mk/detect-cpu-count.sh
+ CPUS=4
+ [ -d testsuite ]
+ [  =  ]
+ threads=5
+ echo using THREADS=5
+ >&2 
using THREADS=5
+ [ YES = NO ]
+ [ NO = NO ]
+ hadrian/build --help
+ > /dev/null 
+ cd hadrian
+ cabal new-exec -- which hadrian
+ hadrian_cmd=Resolving dependencies...
/home/greg/s/ghc/hadrian/dist-newstyle/build/x86_64-openbsd/ghc-8.10.2/hadrian-0.1.0.0/x/hadrian/build/hadrian/hadrian
+ cd ..
+ hadrian=Resolving dependencies...
...
Configure completed successfully.

   Building GHC version  : 9.1.0.20201111
          Git commit id  : 5506f1342e51bad71a7525ddad0650d1ac63afeb

   Build platform        : x86_64-unknown-openbsd
   Host platform         : x86_64-unknown-openbsd
   Target platform       : x86_64-unknown-openbsd

   Bootstrapping using   : /usr/local/bin/ghc
      which is version   : 8.10.2
      with threaded RTS? : YES

   Using (for bootstrapping) : cc
   Using clang               : cc
      which is version       : 
      linker options         : -fuse-ld=lld
   Building a cross compiler : NO
   Unregisterised            : NO
   TablesNextToCode          : YES
   Build GMP in tree         : NO
   hs-cpp       : cc
   hs-cpp-flags : -E -undef -traditional -Wno-invalid-pp-token -Wno-unicode -Wno-trigraphs
   ar           : ar
   ld           : ld.lld
   nm           : nm
   libtool      : libtool
   objdump      : objdump
   ranlib       : ranlib
   otool        : 
   install_name_tool : 
   windres      : 
   dllwrap      : 
   genlib       : 
   Happy        : /usr/local/bin/happy (1.20.0)
   Alex         : /usr/local/bin/alex (3.2.5)
   sphinx-build : 
   xelatex      : 
   makeinfo     : /usr/bin/makeinfo

   Using LLVM tools
      clang : clang
      llc   : 
      opt   : 

   HsColour was not found; documentation will not contain source links

   Tools to build Sphinx HTML documentation available: NO
   Tools to build Sphinx PDF documentation available: NO
   Tools to build Sphinx INFO documentation available: NO
----------------------------------------------------------------------

For a standard build of GHC (fully optimised with profiling), type (g)make.

To make changes to the default build configuration, copy the file
mk/build.mk.sample to mk/build.mk, and edit the settings in there.

For more information on how to configure your GHC build, see
   https://gitlab.haskell.org/ghc/ghc/wikis/building

+ [ YES = NO ]
+ flavour=validate
+ Resolving dependencies... /home/greg/s/ghc/hadrian/dist-newstyle/build/x86_64-openbsd/ghc-8.10.2/hadrian-0.1.0.0/x/hadrian/build/hadrian/hadrian -j5 --build-root=_validatebuild -V --flavour=validate
./validate[296]: Resolving: not found

Some relevant output:

% hadrian/build --help > /dev/null; cd hadrian; cabal new-exec -- which hadrian
Resolving dependencies...
/home/greg/s/ghc/hadrian/dist-newstyle/build/x86_64-openbsd/ghc-8.10.2/hadrian-0.1.0.0/x/hadrian/build/hadrian/hadrian

Steps to reproduce

On OpenBSD using Git commit id : 5506f134:

% AUTOCONF_VERSION=2.69 AUTOMAKE_VERSION=1.16 sh -x ./validate

Expected behavior

Build ghc.

Environment

  • GHC version used: 8.10.2
  • cabal --version
cabal-install version 3.4.0.0
compiled using version 3.4.0.0 of the Cabal library 
  • My shell: zsh 5.8

Optional:

  • Operating System: x86_64-unknown-openbsd
  • System Architecture: amd64

Potential fix

This worked for me, but I'm not sure how portable this will be:

diff --git a/validate b/validate
index a302781db4..253d49c314 100755
--- a/validate
+++ b/validate
@@ -165,7 +165,7 @@ else
     then
         hadrian/build --help > /dev/null
         cd hadrian
-        hadrian_cmd=$(cabal new-exec -- which hadrian)
+        hadrian_cmd=$(cabal new-exec -- which hadrian | grep '^/')
     else
         if [ $no_clean -eq 0 ]; then
             rm -rf hadrian/.stack-work
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information