Skip to content

Commit 7085048

Browse files
committed
Nix: Update CBCM to experimental branch
See diffblue/cbmc#8830 Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu>
1 parent daf271b commit 7085048

4 files changed

Lines changed: 72 additions & 9 deletions

File tree

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

9797
cbmc_pkgs = pkgs.callPackage ./cbmc {
98-
inherit cbmc bitwuzla z3;
98+
inherit cbmc cadical bitwuzla z3;
9999
};
100100

101101
valgrind_varlat = pkgs.callPackage ./valgrind { };

0 commit comments

Comments
 (0)