error.external.build.failed¶
What happens¶
CMake fatal error with one of the messages:
[hunter ** FATAL ERROR **] Configure step failed (dir: ...)
[hunter ** FATAL ERROR **] Build step failed (dir: ...)
Explanation¶
- Build of some external package failed for some reason
What to do¶
Find a reason of failure. Set HUNTER_STATUS_DEBUG=ON to see a lot of info about build
Take a look at pkg.NAME CI testing table. If similar toolchain is excluded (or not present at all) then the problem is known, hence there is no need to report bug if you’re not planning to fix it yourself. For example if you check the OpenSSL testing:
You can see that toolchain
nmake-vs-12-2013-win64
is excluded already:So there is no need to report “OpenSSL is not working with NMake” issue.
If you want to try to fix the error and want to ask for advice, then prefer reporting it to hunterized repository (if it exist for package). For example report Boost problems to https://github.com/hunter-packages/boost . Stale bugs with label “Broken package” will be closed if there will be no activity there even if problem may not be fixed.
Fixable errors¶
Windows¶
- “Path too long” error with message:
The specified path, file name, or both are too long. The fully qualified
file name must be less than 260 characters, and the directory name must be
less than 248 characters.
Can be fixed by setting HUNTER_ROOT environment variable to some short path,
like C:\_hunter
. Alternatively you can set HUNTER_BINARY_DIR
environment variable. In this case all installed packages will be kept in HUNTER_ROOT
but all builds will be triggered in HUNTER_BINARY_DIR
. Note that if several
Hunter-ID
will be send to HUNTER_BINARY_DIR
they will block each other and
will be build sequentially (builds in HUNTER_ROOT
lock different directories
so different Hunter-ID
instances work in parallel). Note that the problem is
about native build tool (like MSBuild)
and not in CMake. CMake is already using \\?\C:\
extended-length path
format (see source code).
Mac OS X¶
Runtime application error:
Unknown class * in Interface Builder file at path *.nib
Check you have next flags linked to your target:
target_link_libraries(... "-all_load" "-ObjC")
Reproduce and diagnose package building errors manually¶
Warning
This may not work always since Hunter can load extra environment variables in internal scripts.
Once you enabled HUNTER_STATUS_DEBUG
, read the error output in order to find how to build the package manually and to reproduce the error.
Read the output of CMake near the error:
[hunter ** FATAL ERROR **] Build step failed (dir: ~/.hunter/_Base/21f5129/d74d0a3/11f31d2/Build/PocoCpp
[hunter ** FATAL ERROR **] [Directory:~/.hunter/_Base/Download/Hunter/0.19.90/21f5129/Unpacked/cmake/projects/PocoCpp]
------------------------------ WIKI -------------------------------
https://github.com/ruslo/hunter/wiki/error.external.build.failed
-------------------------------------------------------------------
CMake Error at ~/.hunter/_Base/Download/Hunter/0.19.90/21f5129/Unpacked/cmake/modules/hunter_wiki.cmake:12 (message):
Call Stack (most recent call first):
~/.hunter/_Base/Download/Hunter/0.19.90/21f5129/Unpacked/cmake/modules/hunter_fatal_error.cmake:20 (hunter_wiki)
...
Carefully note the directory that is given near the message “build step failed”, and build it, like shown below
# this is the directory given by the error message
cd ~/.hunter/_Base/21f5129/d74d0a3/11f31d2/Build/PocoCpp
cmake --build Build/
Then, you can diagnose more easily the cause of the error, using you standard build tools.