fix(nodes): update validator clang requirements#2158
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
📝 WalkthroughWalkthroughUpdated the validator "Run a validator" guide to require Clang 21.0.0 or higher instead of 16.0.0, and replaced the "Update Clang..." section with revised Ubuntu 22.04 and 24.04 installation instructions and a "skip if version 21" note. ChangesClang 21 validator documentation update
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
| wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - | ||
| echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" | sudo tee /etc/apt/sources.list.d/llvm.list | ||
| sudo apt -y update | ||
| sudo apt install -y clang-21 |
There was a problem hiding this comment.
[HIGH] Non-copy-pasteable apt command with unsafe apt-key usage
The Ubuntu 24.04 instructions use sudo apt-key add -, which is deprecated and discouraged in modern Debian/Ubuntu tooling. This conflicts with the style requirement that commands be safe and copy‑pasteable on supported systems, and can fail on newer Ubuntu releases. The same block also hardcodes a repository without using a keyring-based signed-by configuration, which is now the recommended pattern. These issues reduce reliability of the installation instructions and may force readers to troubleshoot outside the guide.
Please leave a reaction 👍/👎 to this suggestion to improve future reviews for everyone!
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
ecosystem/nodes/cpp/run-validator.mdx (1)
76-80: ⚡ Quick winClean up the downloaded
llvm.shscript after installation.The installation script downloads
llvm.shbut doesn't remove it afterward, leaving an executable script in the current directory.🧹 Proposed cleanup addition
# Ubuntu 22.04 sudo apt install lsb-release wget software-properties-common gnupg wget https://apt.llvm.org/llvm.sh chmod +x llvm.sh sudo ./llvm.sh 21 clang + rm llvm.sh🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@ecosystem/nodes/cpp/run-validator.mdx` around lines 76 - 80, After running the LLVM installer steps that download and execute llvm.sh, remove the downloaded script to avoid leaving executables in the working directory; update the install sequence (the block that calls wget https://apt.llvm.org/llvm.sh, chmod +x llvm.sh, and sudo ./llvm.sh 21 clang) to delete llvm.sh afterward (e.g., add a cleanup step that removes the llvm.sh file once the installer completes or on failure).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@ecosystem/nodes/cpp/run-validator.mdx`:
- Around line 82-86: Replace the deprecated apt-key add pipeline by fetching the
LLVM GPG key, dearmoring it into a keyring file and referencing that keyring
with signed-by in the APT source entry: download the key (e.g., with wget or
curl) and run gpg --dearmor > /usr/share/keyrings/llvm-archive-keyring.gpg
(ensure sudo), then change the source line from echo "deb
http://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" | sudo tee ... to echo
"deb [signed-by=/usr/share/keyrings/llvm-archive-keyring.gpg]
http://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" | sudo tee
/etc/apt/sources.list.d/llvm.list, then run sudo apt -y update and sudo apt
install -y clang-21 as before.
---
Nitpick comments:
In `@ecosystem/nodes/cpp/run-validator.mdx`:
- Around line 76-80: After running the LLVM installer steps that download and
execute llvm.sh, remove the downloaded script to avoid leaving executables in
the working directory; update the install sequence (the block that calls wget
https://apt.llvm.org/llvm.sh, chmod +x llvm.sh, and sudo ./llvm.sh 21 clang) to
delete llvm.sh afterward (e.g., add a cleanup step that removes the llvm.sh file
once the installer completes or on failure).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 26c698c0-3301-446d-a1a7-90526bfb527a
📒 Files selected for processing (1)
ecosystem/nodes/cpp/run-validator.mdx
| # Ubuntu 24.04 | ||
| wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - | ||
| echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" | sudo tee /etc/apt/sources.list.d/llvm.list | ||
| sudo apt -y update | ||
| sudo apt install -y clang-21 |
There was a problem hiding this comment.
Replace deprecated apt-key add with modern GPG key management.
The apt-key add command is deprecated since Ubuntu 22.04 and will show warnings or fail on newer systems. Use the modern signed-by approach for GPG key management instead.
🔒 Proposed fix using modern GPG key management
# Ubuntu 24.04
- wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
- echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" | sudo tee /etc/apt/sources.list.d/llvm.list
+ wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/llvm-snapshot.asc
+ echo "deb [signed-by=/etc/apt/trusted.gpg.d/llvm-snapshot.asc] http://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" | sudo tee /etc/apt/sources.list.d/llvm.list
sudo apt -y update
sudo apt install -y clang-21📝 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.
| # Ubuntu 24.04 | |
| wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - | |
| echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" | sudo tee /etc/apt/sources.list.d/llvm.list | |
| sudo apt -y update | |
| sudo apt install -y clang-21 | |
| # Ubuntu 24.04 | |
| wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/llvm-snapshot.asc | |
| echo "deb [signed-by=/etc/apt/trusted.gpg.d/llvm-snapshot.asc] http://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" | sudo tee /etc/apt/sources.list.d/llvm.list | |
| sudo apt -y update | |
| sudo apt install -y clang-21 |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@ecosystem/nodes/cpp/run-validator.mdx` around lines 82 - 86, Replace the
deprecated apt-key add pipeline by fetching the LLVM GPG key, dearmoring it into
a keyring file and referencing that keyring with signed-by in the APT source
entry: download the key (e.g., with wget or curl) and run gpg --dearmor >
/usr/share/keyrings/llvm-archive-keyring.gpg (ensure sudo), then change the
source line from echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-21
main" | sudo tee ... to echo "deb
[signed-by=/usr/share/keyrings/llvm-archive-keyring.gpg]
http://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" | sudo tee
/etc/apt/sources.list.d/llvm.list, then run sudo apt -y update and sudo apt
install -y clang-21 as before.
Closes #2084.
Summary by CodeRabbit