[homebrew] 1.7.1 macOS mojave binary distribution compiled with a different compiler - database error
Dear eosio team,
The homebrew macOS binary for v1.7.0 has been compiled with "4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.10.44.4)" instead of "4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final) " that's been used in previous releases, causing database errors with nodeos.
Is this an intended change ? If not, please consider re-compiling and re-releasing the binary using consistent compiler settings. Of course, I can try to compile the binary myself but downgrading boost from 1.68 to 1.67 using homebrew is a pretty painful process...
Here're the detailed error message when starting nodeos:
info 2019-03-18T00:16:29.773 thread-0 chain_plugin.cpp:333 plugin_initialize ] initializing chain plugin
database created by a different compiler, build, boost version, or operating system
Environment differences (host vs database):
Compiler Version:
342e322e3120436f6d70617469626c65204170706c65204c4c564d2031302e302e302028636c616e672d313030302e31302e34342e3429000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 "4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.10.44.4) "
vs
342e322e3120436f6d70617469626c6520436c616e6720342e302e312028746167732f52454c454153455f3430312f66696e616c2900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 "4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final) "
Debug: 0 vs 0
Apple: 1 vs 1
Windows: 0 vs 0
Boost Version: 106700 vs 106700
warn 2019-03-18T00:16:30.715 thread-0 chain_plugin.cpp:700 plugin_initialize ] 13 N5boost16exception_detail10clone_implINS0_19error_info_injectorISt13runtime_errorEEEE: database created by a different compiler, build, boost version, or operating system
rethrow database created by a different compiler, build, boost version, or operating system:
{"what":"database created by a different compiler, build, boost version, or operating system"}
thread-0 chain_plugin.cpp:700 plugin_initialize
error 2019-03-18T00:16:30.715 thread-0 main.cpp:121 main ] 13 N5boost16exception_detail10clone_implINS0_19error_info_injectorISt13runtime_errorEEEE: database created by a different compiler, build, boost version, or operating system
rethrow database created by a different compiler, build, boost version, or operating system:
{"what":"database created by a different compiler, build, boost version, or operating system"}
thread-0 chain_plugin.cpp:700 plugin_initialize
Same issue persists with the homebrew binary of v1.7.1
We've been sloppy about this, and it is indeed a mistake.
From a quick look at the mojave builds
- 1.7.0 and 1.7.1 use
clang-1000.10.44.4 - 1.5.6, 1.6.0, 1.6.2, 1.6.3, and 1.6.4 use
clang-1000.10.44.2 - 1.4.5 uses
clang-902.0.39.1
In the future we will be more careful about this and ensure all future 1.7.x releases continue to use clang-1000.10.44.4. Releases 1.8.0 and beyond may require a new compiler anyways and if so we will be more careful about locking that for as long as possible. Unfortunately, we've decided not to regress the 1.7.1 or future 1.7.x builds back to an older compiler because that may affect other users who used 1.7.0. To migrate to a newer release you will have to install an older release and create a snapshot however I'm not sure what older release uses 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final).
I believe it is possible to build a nodeos with 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final) by changing the COMPILER variables
https://github.com/EOSIO/eos/blob/73501a46465ca42688bb30c00f4f86e82f6b2dc1/scripts/eosio_build.sh#L253-L264
to /usr/local/Cellar/llvm@4/4.0.1_1/bin/clang++ and /usr/local/Cellar/llvm@4/4.0.1_1/bin/clang however I have not tested it.
For the people on macOS that want to use 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final), just add cmake_policy(SET CMP0074 NEW) to the CMakeList.txt file in eos root directory before running ./scripts/eosio_build.sh -s "EOS".
@spoonincode Is there an easy way to check the host/database version hash using nodeos other than just run it to see if mismatch error occurs ? It would be a great sanity check before upgrading to new binaries.
Thanks in advance !
If you want to see the compiler used for a database file you can usually do strings state/shared_memory.bin | head and spot it toward the top. This isn't ideal since it won't allow you to see boost version. And no, there is no way to get nodeos to report its build environment standalone. That is something worth considering adding...