Skip to content

bitcoin-tidy: fix macOS build - #28258

Merged
fanquake merged 1 commit into
bitcoin:masterfrom
theuni:bitcoin-tidy-macos
Aug 14, 2023
Merged

fanquake merged 1 commit into
bitcoin:masterfrom
theuni:bitcoin-tidy-macos

Conversation

@theuni

@theuni theuni commented Aug 11, 2023

Copy link
Copy Markdown
Member

LLVM uses these options for building as well, so there's precedent.

Also fix the shared library extension which was incorrectly being set to dylib.

Thanks to jonatack for reporting and debugging.

LLVM uses these options for building as well, so there's precedent.

Also fix the shared library extension which was incorrectly being set to dylib
@DrahtBot

DrahtBot commented Aug 11, 2023 •

Copy link
Copy Markdown
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK jonatack

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

@jonatack jonatack left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK bb3263d tested with arm64 macos 13.5, llvm 16.0.6 and cmake 3.27.2

Did not test with cmake earlier than 3.27.

Note to testers, see the /contrib/devtools/bitcoin-tidy/README on current master at 3654d84 for the updated example usage docs.

jon|(bb3263d3e3d...):~/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy$ cmake --version                                                                    
cmake version 3.27.2

CMake suite maintained and supported by Kitware (kitware.com/cmake).
jon|(bb3263d3e3d...):~/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy$ cmake -S . -B build -DLLVM_DIR=$(llvm-config --cmakedir) -DCMAKE_BUILD_TYPE=Release
-- Found LLVM 16.0.6
-- Found clang-tidy: /opt/homebrew/Cellar/llvm/16.0.6/bin/clang-tidy
-- Configuring done (0.1s)
-- Generating done (0.0s)
-- Build files have been written to: /Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/build
jon|(bb3263d3e3d...):~/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy$ cmake --build build -j11                                                           
[100%] Built target bitcoin-tidy
jon|(bb3263d3e3d...):~/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy$ rm -rf build                                                                                        
jon|(bb3263d3e3d...):~/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy$ 
jon|(bb3263d3e3d...):~/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy$ cmake --version                                                                    
cmake version 3.27.2

CMake suite maintained and supported by Kitware (kitware.com/cmake).
jon|(bb3263d3e3d...):~/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy$ cmake -S . -B build -DLLVM_DIR=$(llvm-config --cmakedir) -DCMAKE_BUILD_TYPE=Release
-- The C compiler identification is AppleClang 14.0.3.14030022
-- The CXX compiler identification is AppleClang 14.0.3.14030022
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /opt/homebrew/opt/ccache/libexec/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /opt/homebrew/opt/ccache/libexec/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test HAVE_FFI_CALL
-- Performing Test HAVE_FFI_CALL - Success
-- Found FFI: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libffi.tbd  
-- Performing Test Terminfo_LINKABLE
-- Performing Test Terminfo_LINKABLE - Success
-- Found Terminfo: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libcurses.tbd  
-- Found ZLIB: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libz.tbd (found version "1.2.11")  
-- Found zstd: /opt/homebrew/lib/libzstd.dylib  
-- Found LibXml2: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libxml2.tbd (found version "2.9.13") 
-- Found LLVM 16.0.6
-- Found clang-tidy: /opt/homebrew/Cellar/llvm/16.0.6/bin/clang-tidy
-- Configuring done (1.4s)
-- Generating done (0.0s)
-- Build files have been written to: /Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/build
jon|(bb3263d3e3d...):~/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy$ cmake --build build -j11                                                           
[ 66%] Building CXX object CMakeFiles/bitcoin-tidy.dir/logprintf.cpp.o
[ 66%] Building CXX object CMakeFiles/bitcoin-tidy.dir/bitcoin-tidy.cpp.o
/Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/logprintf.cpp:12:1: warning: unused parameter 'Finder' [-Wunused-parameter]
AST_MATCHER(clang::StringLiteral, unterminated)
^
/opt/homebrew/Cellar/llvm/16.0.6/include/clang/ASTMatchers/ASTMatchersMacros.h:112:56: note: expanded from macro 'AST_MATCHER'
      ::clang::ast_matchers::internal::ASTMatchFinder *Finder,                 \
                                                       ^
/Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/logprintf.cpp:12:1: warning: unused parameter 'Builder' [-Wunused-parameter]
/opt/homebrew/Cellar/llvm/16.0.6/include/clang/ASTMatchers/ASTMatchersMacros.h:113:63: note: expanded from macro 'AST_MATCHER'
      ::clang::ast_matchers::internal::BoundNodesTreeBuilder *Builder) const
                                                              ^
2 warnings generated.
[100%] Linking CXX shared module libbitcoin-tidy.so
[100%] Built target bitcoin-tidy
jon|(bb3263d3e3d...):~/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy$ cmake --build build --target bitcoin-tidy-tests -j11                               
[ 75%] Built target bitcoin-tidy
[100%] Building CXX object CMakeFiles/bitcoin-tidy-tests.dir/example_logprintf.cpp.o
/Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/example_logprintf.cpp:65:15: warning: Unterminated format string used with LogPrintf [bitcoin-unterminated-logprintf]
    LogPrintf("hello world!");
              ^
                           \n
/Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/example_logprintf.cpp:22:68: note: expanded from macro 'LogPrintf'
#define LogPrintf(...) LogPrintLevel_(LogFlags::NONE, Level::None, __VA_ARGS__)
                                                                   ^
/Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/example_logprintf.cpp:21:104: note: expanded from macro 'LogPrintLevel_'
#define LogPrintLevel_(category, level, ...) LogPrintf_(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
                                                                                                       ^
/Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/example_logprintf.cpp:69:15: warning: Unterminated format string used with LogPrintf [bitcoin-unterminated-logprintf]
    LogPrintf("");
              ^
               \n
/Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/example_logprintf.cpp:22:68: note: expanded from macro 'LogPrintf'
#define LogPrintf(...) LogPrintLevel_(LogFlags::NONE, Level::None, __VA_ARGS__)
                                                                   ^
/Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/example_logprintf.cpp:21:104: note: expanded from macro 'LogPrintLevel_'
#define LogPrintLevel_(category, level, ...) LogPrintf_(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
                                                                                                       ^
/Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/example_logprintf.cpp:74:15: warning: Unterminated format string used with LogPrintf [bitcoin-unterminated-logprintf]
    LogPrintf("hello world!...");
              ^
                              \n
/Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/example_logprintf.cpp:22:68: note: expanded from macro 'LogPrintf'
#define LogPrintf(...) LogPrintLevel_(LogFlags::NONE, Level::None, __VA_ARGS__)
                                                                   ^
/Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/example_logprintf.cpp:21:104: note: expanded from macro 'LogPrintLevel_'
#define LogPrintLevel_(category, level, ...) LogPrintf_(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
                                                                                                       ^
[100%] Built target bitcoin-tidy-tests
jon|(bb3263d3e3d...):~/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy$ 

@fanquake
fanquake merged commit 6c508ac into bitcoin:master Aug 14, 2023
@bitcoin bitcoin locked and limited conversation to collaborators Aug 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants