Today I got flooded with this error while trying to make depends:
0 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++" "-mmacosx-version-min=10.8" "-stdlib=libc++" -ftemplate-depth-128 -std=c++11 -fvisibility=hidden -I/Users/bitcoin/dev/bitcoin/depends/x86_64-apple-darwin17.6.0/include -O3 -Wall -pedantic -gdwarf-2 -fexceptions -Wno-long-long -Wno-inline -arch x86_64 -DBOOST_ALL_NO_LIB=1 -DBOOST_CHRONO_STATIC_LINK=1 -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_SYSTEM_STATIC_LINK=1 -DBOOST_TIMER_STATIC_LINK=1 -DNDEBUG -I"." -c -o "bin.v2/libs/test/build/darwin-4.2.1/release/link-static/threading-multi/unit_test_log.o" "libs/test/src/unit_test_log.cpp"
1
2In file included from libs/test/src/unit_test_log.cpp:16:
3In file included from ./boost/test/impl/unit_test_log.ipp:19:
4In file included from ./boost/test/unit_test_log.hpp:18:
5In file included from ./boost/test/tree/observer.hpp:17:
6In file included from ./boost/test/detail/global_typedef.hpp:15:
7In file included from ./boost/test/utils/basic_cstring/basic_cstring.hpp:20:
8In file included from ./boost/test/utils/basic_cstring/basic_cstring_fwd.hpp:19:
9In file included from ./boost/detail/workaround.hpp:41:
10In file included from ./boost/config.hpp:57:
11In file included from ./boost/config/platform/macos.hpp:28:
12./boost/config/posix_features.hpp:18:15: fatal error: 'unistd.h' file not found
13# include <unistd.h>
14 ^~~~~~~~~~
151 error generated.
16...failed darwin.compile.c++ bin.v2/libs/test/build/darwin-4.2.1/release/link-static/threading-multi/unit_test_log.o...
A simple Google search reveals others seeing this and pointing out they need to do xcode-select --install
. To add a bit more confusion, this appears to be different from opening Xcode and letting it update command line tools.
For cross compilation the absence of the SDK has also confused people in the past with the same error, e.g. #10926
I wonder if we can detect if Xcode is missing and or xcode-select --install
is in need of being run, for the first time or again because Xcode was updated.