Fix build failure#20
Conversation
disable clang-tidy by default since it's strict `--warnings-as-errors=*` flag was causing build to fail.
📝 WalkthroughWalkthroughThe pull request modifies the default build configuration to disable clang-tidy by default and adds a new dependency validation function to the installation script that checks for cmake availability before attempting to build. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@install/install.sh`:
- Around line 13-19: The check_deps() function currently only verifies cmake but
must also verify a usable C++ compiler because CMakeLists.txt declares LANGUAGES
CXX and requires CMAKE_CXX_STANDARD 23; update check_deps() to probe for common
C++ compilers (e.g., c++, g++, clang++) by checking command -v for each or
attempting a simple compiler --version invocation, and if none are found emit an
error like "Missing required dependency: C++ compiler" with an actionable
install hint (e.g., install build-essential or g++) and exit 1 so the configure
step fails early.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 80e87cdf-d2db-4c7b-b212-63cc65e24340
📒 Files selected for processing (2)
CMakeLists.txtinstall/install.sh
| check_deps() { | ||
| if ! command -v cmake &> /dev/null; then | ||
| error "Missing required dependency: cmake" | ||
| echo "Install with: sudo apt install cmake" | ||
| exit 1 | ||
| fi | ||
| } |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# Find CMakeLists.txt and install.sh files
find . -name "CMakeLists.txt" -o -name "install.sh" | head -20Repository: BANANASJIM/flydigi-vader5
Length of output: 126
🏁 Script executed:
# Look at the install/install.sh file to see the context
head -30 install/install.shRepository: BANANASJIM/flydigi-vader5
Length of output: 934
🏁 Script executed:
# Check if CMakeLists.txt exists and examine its first few lines
if [ -f "CMakeLists.txt" ]; then
echo "=== CMakeLists.txt ===" && head -20 CMakeLists.txt
fiRepository: BANANASJIM/flydigi-vader5
Length of output: 554
🏁 Script executed:
# Search for README, BUILD, or documentation files
find . -type f \( -name "README*" -o -name "BUILD*" -o -name "CONTRIBUTING*" -o -name "*.md" \) | head -20Repository: BANANASJIM/flydigi-vader5
Length of output: 1150
🏁 Script executed:
# Check driver/install.sh to see if there's similar logic
cat driver/install.sh | head -40Repository: BANANASJIM/flydigi-vader5
Length of output: 379
🏁 Script executed:
# Check README for build requirements and toolchain info
cat README.md | head -100Repository: BANANASJIM/flydigi-vader5
Length of output: 3144
🏁 Script executed:
# Also check CONTRIBUTING.md for build setup instructions
cat CONTRIBUTING.md | head -80Repository: BANANASJIM/flydigi-vader5
Length of output: 1538
Add C++ compiler check to preflight validation.
The current check_deps() function only verifies cmake, but CMakeLists.txt (line 2) declares LANGUAGES CXX and (line 4) requires CMAKE_CXX_STANDARD 23 with CMAKE_CXX_STANDARD_REQUIRED ON. A machine with cmake but no C++ compiler will still fail during the configure step instead of receiving an early, actionable error. Add a compiler probe to check for any usable C++ compiler (e.g., c++, g++, or clang++).
Suggested fix
check_deps() {
if ! command -v cmake &> /dev/null; then
error "Missing required dependency: cmake"
echo "Install with: sudo apt install cmake"
exit 1
fi
+ if ! command -v c++ &> /dev/null && ! command -v g++ &> /dev/null && ! command -v clang++ &> /dev/null; then
+ error "Missing required dependency: C++ compiler"
+ echo "Please install a C++23-capable compiler and rerun this script."
+ exit 1
+ fi
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| check_deps() { | |
| if ! command -v cmake &> /dev/null; then | |
| error "Missing required dependency: cmake" | |
| echo "Install with: sudo apt install cmake" | |
| exit 1 | |
| fi | |
| } | |
| check_deps() { | |
| if ! command -v cmake &> /dev/null; then | |
| error "Missing required dependency: cmake" | |
| echo "Install with: sudo apt install cmake" | |
| exit 1 | |
| fi | |
| if ! command -v c++ &> /dev/null && ! command -v g++ &> /dev/null && ! command -v clang++ &> /dev/null; then | |
| error "Missing required dependency: C++ compiler" | |
| echo "Please install a C++23-capable compiler and rerun this script." | |
| exit 1 | |
| fi | |
| } |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@install/install.sh` around lines 13 - 19, The check_deps() function currently
only verifies cmake but must also verify a usable C++ compiler because
CMakeLists.txt declares LANGUAGES CXX and requires CMAKE_CXX_STANDARD 23; update
check_deps() to probe for common C++ compilers (e.g., c++, g++, clang++) by
checking command -v for each or attempting a simple compiler --version
invocation, and if none are found emit an error like "Missing required
dependency: C++ compiler" with an actionable install hint (e.g., install
build-essential or g++) and exit 1 so the configure step fails early.
BANANASJIM
left a comment
There was a problem hiding this comment.
Thanks for the PR!
A couple of suggestions:
-
clang-tidy default: When
clang-tidyisn't found,find_programshould already skip it gracefully, so the build failure might have a different root cause. Could you share the error log? Happy to help debug it. -
Dependency check: The
sudo apt install cmakehint won't work on non-Debian distros (e.g. this project is developed on Arch). A more portable approach would be:check_deps() { for cmd in cmake g++; do if ! command -v "$cmd" &> /dev/null; then error "Missing required dependency: $cmd" exit 1 fi done }
This just tells the user what's missing and lets them install it with their own package manager.
|
Sure thing! Here you go |
|
The build failure has been fixed in #26 (replaced |
Summary by CodeRabbit
New Features
Chores