Skip to content

klee: 3.1 -> 3.1-unstable-2025-07-11, bump to LLVM 18#435927

Merged
numinit merged 4 commits intoNixOS:masterfrom
emilazy:push-rylqusmtuzrp
Sep 1, 2025
Merged

klee: 3.1 -> 3.1-unstable-2025-07-11, bump to LLVM 18#435927
numinit merged 4 commits intoNixOS:masterfrom
emilazy:push-rylqusmtuzrp

Conversation

@emilazy
Copy link
Member

@emilazy emilazy commented Aug 22, 2025

@numinit KLEE officially supports up to LLVM 16, but all versions below 18 are planned to be removed for 25.11. How would you like to handle this one – bumping past the supported version, marking it broken for now in the hopes that there’ll be upstream progress on supporting newer versions, or dropping?

This PR implements the first option. There has been upstream work for supporting newer versions of LLVM (klee/klee#1664, klee/klee#1745, klee/klee#1751), and it does build with LLVM 18 and 19, but it’s clearly a work‐in‐progress (klee/klee#1754) and they don’t have CI for it. With LLVM 18, 330 (77%) of the tests have the expected result, but 96 (23%) have unexpected failures and we need to disable them to make the build go through. (A few more of them fail with LLVM 19, so it could be worse!)

The failures mostly relate to unimplemented intrinsics; I tested KLEE on an extremely basic program and it seemed to worked fine, but I imagine more complicated tests will run into issues. I don’t have enough KLEE experience to judge whether it’s still useful in this state, or whether it’d be more honest just to mark it broken. Hopefully you’re in a better position to figure that out than I am.

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. labels Aug 22, 2025
@numinit
Copy link
Contributor

numinit commented Aug 22, 2025

Oh, yeah, I've been waiting with bated breath for a new release. Thought about doing it this way myself, since it definitely can build with the new version but is not quite stable yet.

Honestly, I think this is fine. If people want to use LLVM 13, they can use an older nixpkgs version.

@emilazy emilazy marked this pull request as ready for review August 22, 2025 21:41
@emilazy
Copy link
Member Author

emilazy commented Aug 22, 2025

I’m cool going with this if it’s still valuable in this form. I tend to be a little hesitant about shipping prerelease code from active upstreams, and in this case there’s a very measurable loss of functionality, but if you think it’s more useful than a dropped package I’m happy with the bump :) I just don’t know KLEE well enough to judge myself whether it can still be used for real tasks like this.

@nix-owners nix-owners bot requested a review from numinit August 22, 2025 21:43
@numinit
Copy link
Contributor

numinit commented Aug 22, 2025

I wonder if the test disabling and asserts can be conditional on LLVM version. That way users can still overlay an older LLVM version if they want to use it. If a hello world still worked, and it was able to solve for some bitcode, that still seems useful, though I'll have to try with some examples I've got to verify how useful.

In any case, these problems will go away with a future Klee update. If we need to break things for now and a backport will fix them, that sounds fairly reasonable. 13 is way too old.

Our LLVM is no longer built with these, so the build system actually
warns about the current default (and it breaks use with LLVM ≥ 18).
@emilazy emilazy force-pushed the push-rylqusmtuzrp branch from b8a85c0 to 821e8ed Compare August 24, 2025 17:01
@emilazy
Copy link
Member Author

emilazy commented Aug 24, 2025

I’m a little hesitant to establish a precedent of in‐tree Nixpkgs expressions exposing functionality for removed versions of dependencies; I figure that anyone adventurous enough to get a removed LLVM building out‐of‐tree can overrideAttrs their way to or copy‐paste the KLEE expression too. The test failures differ across LLVM versions, too, so making this package version‐generic would involve building it for all of 17, 18, 19, 20, and soon 21.

How do you feel about including the disabled tests so that the package will build and run, but marking it as broken for now to signal to users that it’s not in a state upstream considers to be supported? Adventurous users can check the package and see that they can bypass it to get a partially‐functioning KLEE to play around with, even more adventurous users can pass it a removed LLVM version and overrideAttrs their way to a fully‐functional one, but casual users won’t be misled by any issues with the configuration until upstream fixes the issues. I’ve pushed that along with an explanatory comment, if you think it’s a good idea.

@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. and removed 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. labels Aug 24, 2025
@numinit
Copy link
Contributor

numinit commented Aug 26, 2025

That sounds reasonable to me. Let me give this a final review shortly. :-)

Copy link
Contributor

@numinit numinit left a comment

Choose a reason for hiding this comment

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

This works OK on a test program. Hopefully they get the rest of the operations working soon.

@numinit numinit merged commit 6c46327 into NixOS:master Sep 1, 2025
31 of 32 checks passed
@emilazy emilazy deleted the push-rylqusmtuzrp branch September 6, 2025 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants