Skip to content

Conversation

Copy link

Copilot AI commented Dec 9, 2025

Fix LLVM being downloaded every time bootstrap runs

  • Understand the problem: install-llvm.sh always downloads LLVM without checking if it exists
  • Identify the solution: Add check in install-llvm.sh to skip download if LLVM is already installed
  • Modify install-llvm.sh to check if LLVM is already installed before downloading
  • Test the fix by running the script multiple times
  • Verify LLVM download is skipped when already installed
  • Address code review feedback to check all three tools
  • Run security checks (N/A for bash scripts)
  • Eliminate code duplication by extracting symlink creation to function
Original prompt

/task I found llvm is always downloaded everytime I run bootstrap, please help me fix it


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits December 9, 2025 06:53
Add check in install-llvm.sh to skip download if LLVM is already installed.
The script now verifies that the installation directory exists and contains
a working clang-format executable before attempting to download LLVM again.

Co-authored-by: zesonzhang <[email protected]>
Update the check to verify all three tools (clang-format, clang-tidy, and
clang-apply-replacements) are present and executable before skipping the
download, ensuring a complete installation.

Co-authored-by: zesonzhang <[email protected]>
Copilot AI changed the title [WIP] Fix llvm download issue during bootstrap Add idempotency check to LLVM installation script Dec 9, 2025
Copilot AI requested a review from zesonzhang December 9, 2025 06:58
@zesonzhang
Copy link
Owner

@copilot these lines are duplicated:
"""
echo "Creating symlinks in /usr/local/bin..."
sudo ln -sf "${INSTALL_DIR}/bin/clang-format" "/usr/local/bin/clang-format-19"
sudo ln -sf "${INSTALL_DIR}/bin/clang-tidy" "/usr/local/bin/clang-tidy-19"
sudo ln -sf "${INSTALL_DIR}/bin/clang-apply-replacements" "/usr/local/bin/clang-apply-replacements-19"
"""

Extract symlink creation logic into a create_symlinks() function to avoid
duplicating the same code in both the early-exit path and the installation
path.

Co-authored-by: zesonzhang <[email protected]>
Copy link
Author

Copilot AI commented Dec 9, 2025

@copilot these lines are duplicated:
"""
echo "Creating symlinks in /usr/local/bin..."...

Fixed in commit 8e5a120. Extracted the symlink creation code into a create_symlinks() function to eliminate the duplication.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants