[llvm] [BOLT] Fix LLVM_APPEND_VC_REV support (PR #142410)

Paschalis Mpeis via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 2 13:46:08 PDT 2025


paschalis-mpeis wrote:

Hey Amir,

> We're supposed to set this flag on NFC builder:
> https://github.com/llvm/llvm-zorg/blob/e7c3dc5f8ead5ba5ea8dd819dee243d87f65b375/buildbot/osuosl/master/config/builders.py#L2949



Yes, thanks a lot! That's what brought me to this patch.

> At a time of enabling, I verified that if the changes are not affecting BOLT, it's not rebuilt (which ensures that NFC checks are not triggered). Perhaps it was broken at some point, causing changes in the bolt binary.

I believe this is what happened too. At some point there was a broader CMake change (the one that introduced lowercase `llvm_vc_revision`), that didn't make it properly to BOLT. And unfortunately, there is no straightforward way for us to add a test for this.

Could you consider accepting this PR? Below I list some commands to help with reviewing:

---

```bash
gh pr checkout 142410 # get this patch
```

Before this patch:
```bash
git checkout HEAD~2

# emits sha (correct)
cmake -DLLVM_APPEND_VC_REV=ON ..
bolt --version | grep revision
BOLT revision b71255705bab3bba231c045a9fd101df438a7a72

# emits sha (wrong)
cmake -DLLVM_APPEND_VC_REV=OFF ..
bolt --version | grep revision
BOLT revision b71255705bab3bba231c045a9fd101df438a7a72
```

With this path:
```bash
 # emits sha (correct)
cmake -DLLVM_APPEND_VC_REV=ON ..
bolt --version | grep revision
BOLT revision 8c0ef06a044b9aa9e7c8c79d9331dc2a0a4fe37a

 # emits unknown (correct)
cmake -DLLVM_APPEND_VC_REV=OFF ..
bolt --version | grep revision
BOLT revision <unknown>
```

https://github.com/llvm/llvm-project/pull/142410


More information about the llvm-commits mailing list