Skip to content

Commit e731fa5

Browse files
mkannwischerrod-chapman
authored andcommitted
Nix: Update CBCM to experimental branch
See diffblue/cbmc#8830 Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu>
1 parent 8c9405b commit e731fa5

File tree

4 files changed

+71
-9
lines changed

4 files changed

+71
-9
lines changed

flake.nix

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
pkgs-unstable = inputs.nixpkgs-unstable.legacyPackages.${system};
2626
pkgs-2405 = inputs.nixpkgs-2405.legacyPackages.${system};
2727
util = pkgs.callPackage ./nix/util.nix {
28-
inherit (pkgs) cbmc bitwuzla z3;
28+
inherit (pkgs-unstable) cbmc cadical;
29+
inherit (pkgs) bitwuzla z3;
2930
# TODO: switch back to stable python3 for slothy once ortools is fixed in 25.11
3031
python3-for-slothy = pkgs-unstable.python3;
3132
};
@@ -219,7 +220,8 @@
219220
pkgs-unstable = inputs.nixpkgs-unstable.legacyPackages.x86_64-linux;
220221
util = pkgs.callPackage ./nix/util.nix {
221222
inherit pkgs;
222-
inherit (pkgs) cbmc bitwuzla z3;
223+
inherit (pkgs-unstable) cbmc cadical;
224+
inherit (pkgs) bitwuzla z3;
223225
# TODO: switch back to stable python3 for slothy once ortools is fixed in 25.11
224226
python3-for-slothy = pkgs-unstable.python3;
225227
};
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
From c6b6438d3c87ce000b4e80b2eda2389e9473d24c Mon Sep 17 00:00:00 2001
2+
From: wxt <3264117476@qq.com>
3+
Date: Mon, 11 Nov 2024 11:35:03 +0800
4+
Subject: [PATCH] Do not download sources in cmake
5+
6+
---
7+
src/solvers/CMakeLists.txt | 9 +++------
8+
1 file changed, 3 insertions(+), 6 deletions(-)
9+
10+
diff --git a/src/solvers/CMakeLists.txt b/src/solvers/CMakeLists.txt
11+
index ab8d111..d7165e2 100644
12+
--- a/src/solvers/CMakeLists.txt
13+
+++ b/src/solvers/CMakeLists.txt
14+
@@ -102,10 +102,9 @@ foreach(SOLVER ${sat_impl})
15+
message(STATUS "Building solvers with glucose")
16+
17+
download_project(PROJ glucose
18+
- URL https://github.com/BrunoDutertre/glucose-syrup/archive/0bb2afd3b9baace6981cbb8b4a1c7683c44968b7.tar.gz
19+
+ SOURCE_DIR @srcglucose@
20+
PATCH_COMMAND patch -p1 -i ${CBMC_SOURCE_DIR}/scripts/glucose-syrup-patch
21+
COMMAND cmake -E copy ${CBMC_SOURCE_DIR}/scripts/glucose_CMakeLists.txt CMakeLists.txt
22+
- URL_MD5 7c539c62c248b74210aef7414787323a
23+
)
24+
25+
add_subdirectory(${glucose_SOURCE_DIR} ${glucose_BINARY_DIR})
26+
@@ -121,11 +120,10 @@ foreach(SOLVER ${sat_impl})
27+
message(STATUS "Building solvers with cadical")
28+
29+
download_project(PROJ cadical
30+
- URL https://github.com/arminbiere/cadical/archive/rel-3.0.0.tar.gz
31+
+ SOURCE_DIR @srccadical@
32+
PATCH_COMMAND patch -p1 -i ${CBMC_SOURCE_DIR}/scripts/cadical-3.0.0-patch
33+
COMMAND cmake -E copy ${CBMC_SOURCE_DIR}/scripts/cadical_CMakeLists.txt CMakeLists.txt
34+
COMMAND ./configure
35+
- URL_HASH SHA256=282b1c9422fde8631cb721b86450ae94df4e8de0545c17a69a301aaa4bf92fcf
36+
)
37+
38+
add_subdirectory(${cadical_SOURCE_DIR} ${cadical_BINARY_DIR})
39+
@@ -144,10 +142,9 @@ foreach(SOLVER ${sat_impl})
40+
message(STATUS "Building with IPASIR solver linking against: CaDiCaL")
41+
42+
download_project(PROJ cadical
43+
- URL https://github.com/arminbiere/cadical/archive/rel-3.0.0.tar.gz
44+
+ SOURCE_DIR @srccadical@
45+
PATCH_COMMAND patch -p1 -i ${CBMC_SOURCE_DIR}/scripts/cadical-3.0.0-patch
46+
COMMAND ./configure
47+
- URL_HASH SHA256=282b1c9422fde8631cb721b86450ae94df4e8de0545c17a69a301aaa4bf92fcf
48+
)
49+
50+
message(STATUS "Building CaDiCaL")
51+
--
52+
2.47.0

nix/cbmc/default.nix

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,20 @@ buildEnv {
1919
paths =
2020
builtins.attrValues {
2121
cbmc = cbmc.overrideAttrs (old: rec {
22-
version = "6.8.0";
22+
version = "6.8.0"; # tautschnig/smt2-output-stability
2323
src = fetchFromGitHub {
24-
owner = "diffblue";
24+
owner = "tautschnig";
2525
repo = "cbmc";
26-
hash = "sha256-PT6AYiwkplCeyMREZnGZA0BKl4ZESRC02/9ibKg7mYU=";
27-
tag = "cbmc-6.8.0";
26+
rev = "37f2da4d6e2e2646fdd3190949bb68c28612e6d3";
27+
hash = "sha256-VV33r1owrA4T8oZBfhI8F95HCtl7UAP2gXH4PBrZoQA=";
28+
};
29+
srccadical = cadical.src; # 3.0.0 from nixpkgs-unstable
30+
patches = [
31+
(builtins.elemAt old.patches 0) # cudd patch from nixpkgs
32+
./0002-Do-not-download-sources-in-cmake.patch # cadical 3.0.0
33+
];
34+
env = old.env // {
35+
NIX_CFLAGS_COMPILE = (old.env.NIX_CFLAGS_COMPILE or "") + " -Wno-error=switch-enum";
2836
};
2937
});
3038
litani = callPackage ./litani.nix { }; # 1.29.0
@@ -40,7 +48,7 @@ buildEnv {
4048
});
4149

4250
inherit
43-
cadical# 2.2.0
51+
cadical# 3.0.0
4452
bitwuzla# 0.8.2
4553
ninja; # 1.13.2
4654
};

nix/util.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Copyright (c) The mldsa-native project authors
33
# SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT
44

5-
{ pkgs, cbmc, bitwuzla, z3, python3-for-slothy }:
5+
{ pkgs, cbmc, cadical, bitwuzla, z3, python3-for-slothy }:
66
rec {
77
glibc-join = p: p.buildPackages.symlinkJoin {
88
name = "glibc-join";
@@ -94,7 +94,7 @@ rec {
9494
};
9595
};
9696

97-
cbmc_pkgs = pkgs.callPackage ./cbmc { inherit cbmc bitwuzla z3; };
97+
cbmc_pkgs = pkgs.callPackage ./cbmc { inherit cbmc cadical bitwuzla z3; };
9898

9999
valgrind_varlat = pkgs.callPackage ./valgrind { };
100100
hol_light' = pkgs.callPackage ./hol_light { };

0 commit comments

Comments
 (0)