Skip to content

Conversation

F-WRunTime
Copy link
Member

@F-WRunTime F-WRunTime commented Sep 12, 2025

Summary

I think this should organize the llvm versions and distros properly hopefully also impove reliability in builds downstream, such as recent K failures.

This PR updates the LLVM version from 15 to 17 across the llvm-backend repository to align with the main K Framework's move to LLVM 17.

Changes Made

INSTALL.md: Updated installation instructions
• clang-15 → clang-17
• lld-15 → lld-17
• llvm-15-tools → llvm-17-tools
• llvm@15 → llvm@17 (macOS Homebrew)
• Updated environment variable paths and CMake compiler flags

package/debian/control.jammy: Updated Debian package dependencies
• clang-15 → clang-17
• lld-15 → lld-17
• llvm-15 → llvm-17
• llvm-15-tools → llvm-17-tools

scripts/clang-tidy.sh: Enhanced LLVM version detection
• Auto-detects available LLVM versions (17, 16, 15, 14)
• Falls back gracefully if versioned tools aren't available
• Works on both macOS and Linux

Related

This change is part of the broader K Framework migration to LLVM 17. The main K Framework repository has already been updated to use LLVM 17 in its GitHub Actions workflows and packaging configurations.

Testing

  • Verify the changes work with LLVM 17 installations
  • Test Debian package builds
  • Verify macOS Homebrew installation instructions
  • Enhanced clang-tidy script handles version detection gracefully

- Update INSTALL.md: clang-15→17, lld-15→17, llvm-15-tools→17, llvm@15→17
- Update package/debian/control.jammy: clang-15→17, lld-15→17, llvm-15→17, llvm-15-tools→17
- Update scripts/clang-tidy.sh: LLVM_VERSION=15→17

This aligns the llvm-backend with the main K Framework's move to LLVM 17.
- Update clang-tidy.sh to auto-detect available LLVM version instead of hardcoding
- Fix Ubuntu Jammy package dependencies to use LLVM 15 (available in Ubuntu 22.04)
- Script now tries versions 17, 16, 15, 14 in order and falls back to default

This resolves the 'run-clang-tidy-17: command not found' error by using
the correct LLVM version based on what's available in the environment.
Copy link
Collaborator

@Robertorosmaninho Robertorosmaninho left a comment

Choose a reason for hiding this comment

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

LGTM.
For LLVM-18, though, we may have this issue: llvm/llvm-project#105223
Let's keep an eye on it!

@F-WRunTime F-WRunTime merged commit 2b55885 into develop Sep 17, 2025
20 checks passed
@F-WRunTime F-WRunTime deleted the update/llvm-17-from-develop branch September 17, 2025 14:45
F-WRunTime pushed a commit to runtimeverification/k that referenced this pull request Sep 17, 2025
This contains our tweaks to the LLVM backend to use consistent LLVM
versions across the project.

Stemming from this PR:
runtimeverification/llvm-backend#1215

---------

Co-authored-by: devops <devops@runtimeverification.com>
F-WRunTime added a commit to runtimeverification/k that referenced this pull request Sep 18, 2025
This PR updates the LLVM version from 15/16 to 17 across the entire K Framework repository to align with modern toolchain requirements and improve performance.

## ⚠️ **IMPORTANT DEPENDENCY**

**This PR requires [llvm-backend PR #1214](runtimeverification/llvm-backend#1214) to be merged first.**

The llvm-backend submodule changes are included in this PR, but the final merge should wait until the llvm-backend PR is merged and released to ensure proper dependency alignment.

## Changes Made

### **GitHub Actions Workflows**
- **`.github/workflows/release.yml`**: Updated all `llvm: 15/16` → `llvm: 17`
- **`.github/workflows/test-pr.yml`**: Updated all `llvm: 15` → `llvm: 17`

### **Debian Package Dependencies**
- **`package/debian/kframework/control.jammy`**:
  - `clang-15` → `clang-17`
  - `lld-15` → `lld-17`
  - `llvm-15` → `llvm-17`
- **`package/debian/kframework/control.noble`**:
  - `clang-16` → `clang-17`
  - `lld-16` → `lld-17`
  - `llvm-17` (already correct)

### **Installation Scripts**
- **`install-build-deps`**: Updated Debian package installation
  - `clang-15` → `clang-17`
  - `lld-15` → `lld-17`
  - `llvm-15-tools` → `llvm-17-tools`

### **macOS Support**
- **`package/macos/brew-install-deps`**: `llvm@15` → `llvm@17`
- **`macos-envrc`**: Updated environment variables for `llvm@17`

### **Submodule Updates**
- **`llvm-backend/src/main/native/llvm-backend`**: Updated to include LLVM 17 changes from [PR #1214](runtimeverification/llvm-backend#1214)

## Testing Strategy

- [x] **CI/CD**: GitHub Actions will test with LLVM 17
- [x] **Debian Packages**: Test builds on Ubuntu Jammy (22.04) and Noble (24.04)
- [ ] **macOS**: Test Homebrew installation with `llvm@17`
- [x] **Submodule**: Verify llvm-backend integration works correctly

## Migration Benefits

1. **Performance**: LLVM 17 includes performance improvements and optimizations
2. **Compatibility**: Better support for modern C++ features and standards
3. **Security**: Latest security patches and bug fixes
4. **Toolchain**: Improved debugging and analysis tools

## Related PRs

- **llvm-backend**: [PR #1214](runtimeverification/llvm-backend#1215) - Update LLVM version from 15 to 17
- **haskell-backend**: May need similar updates (to be determined)

## Checklist

- [x] Update GitHub Actions workflows
- [x] Update Debian package dependencies
- [x] Update installation scripts
- [x] Update macOS Homebrew configuration
- [x] Update llvm-backend submodule
- [x] Wait for llvm-backend PR #1214 to merge
- [ ] Update `deps/llvm-backend_release` after llvm-backend release
- [ ] Final testing and validation
automergerpr-permission-manager bot pushed a commit to runtimeverification/k that referenced this pull request Sep 18, 2025
## Summary

This PR updates the LLVM version from 15/16 to 17 across the entire K
Framework repository to align with modern toolchain requirements and
improve performance.

## ⚠️ **IMPORTANT DEPENDENCY**

**This PR requires [llvm-backend PR
#1214](runtimeverification/llvm-backend#1214) to
be merged first.**

The llvm-backend submodule changes are included in this PR, but the
final merge should wait until the llvm-backend PR is merged and released
to ensure proper dependency alignment.

## Changes Made

### **GitHub Actions Workflows**
- **`.github/workflows/release.yml`**: Updated all `llvm: 15/16` →
`llvm: 17`
- **`.github/workflows/test-pr.yml`**: Updated all `llvm: 15` → `llvm:
17`

### **Debian Package Dependencies**
- **`package/debian/kframework/control.jammy`**:
  - `clang-15` → `clang-17`
  - `lld-15` → `lld-17`
  - `llvm-15` → `llvm-17`
- **`package/debian/kframework/control.noble`**:
  - `clang-16` → `clang-17`
  - `lld-16` → `lld-17`
  - `llvm-17` (already correct)

### **Installation Scripts**
- **`install-build-deps`**: Updated Debian package installation
  - `clang-15` → `clang-17`
  - `lld-15` → `lld-17`
  - `llvm-15-tools` → `llvm-17-tools`

### **macOS Support**
- **`package/macos/brew-install-deps`**: `llvm@15` → `llvm@17`
- **`macos-envrc`**: Updated environment variables for `llvm@17`

### **Submodule Updates**
- **`llvm-backend/src/main/native/llvm-backend`**: Updated to include
LLVM 17 changes from [PR
#1214](runtimeverification/llvm-backend#1214)

## Testing Strategy

- [x] **CI/CD**: GitHub Actions will test with LLVM 17
- [x] **Debian Packages**: Test builds on Ubuntu Jammy (22.04) and Noble
(24.04)
- [ ] **macOS**: Test Homebrew installation with `llvm@17`
- [x] **Submodule**: Verify llvm-backend integration works correctly

## Migration Benefits

1. **Performance**: LLVM 17 includes performance improvements and
optimizations
2. **Compatibility**: Better support for modern C++ features and
standards
3. **Security**: Latest security patches and bug fixes
4. **Toolchain**: Improved debugging and analysis tools

## Related PRs

- **llvm-backend**: [PR
#1214](runtimeverification/llvm-backend#1215) -
Update LLVM version from 15 to 17
- **haskell-backend**: May need similar updates (to be determined)

## Checklist

- [x] Update GitHub Actions workflows
- [x] Update Debian package dependencies
- [x] Update installation scripts
- [x] Update macOS Homebrew configuration
- [x] Update llvm-backend submodule
- [x] Wait for llvm-backend PR #1214 to merge
- [ ] Update `deps/llvm-backend_release` after llvm-backend release
- [ ] Final testing and validation
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