projects/guix·blob perlssl · refs

1266 lines · 53.3 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2014, 2015, 2016, 2017, 2019-2022 Eric Bavier <[email protected]>
3;;; Copyright © 2016-2018, 2020, 2021, 2025 Efraim Flashner <[email protected]>
4;;; Copyright © 2018, 2020 Tobias Geerinckx-Rice <[email protected]>
5;;; Copyright © 2018, 2019 Rutger Helling <[email protected]>
6;;; Copyright © 2019 Pkill -9 <[email protected]>
7;;; Copyright © 2020 Vincent Legoll <[email protected]>
8;;; Copyright © 2020, 2021 Morgan Smith <[email protected]>
9;;; Copyright © 2020, 2025 Maxim Cournoyer <[email protected]>
10;;; Copyright © 2021 Felix Gruber <[email protected]>
11;;; Copyright © 2021 Foo Chuan Wei <[email protected]>
12;;; Copyright © 2022 Michael Rohleder <[email protected]>
13;;; Copyright © 2022 Matthew James Kraai <[email protected]>
14;;; Copyright © 2023 Andy Tai <[email protected]>
15;;; Copyright © 2023 Ricardo Wurmus <[email protected]>
16;;; Copyright © 2024 Raven Hallsby <[email protected]>
17;;; Copyright © 2025-2026 Nguyễn Gia Phong <[email protected]>
18;;; Copyright © 2025 Robin Templeton <[email protected]>
19;;;
20;;; This file is part of GNU Guix.
21;;;
22;;; GNU Guix is free software; you can redistribute it and/or modify it
23;;; under the terms of the GNU General Public License as published by
24;;; the Free Software Foundation; either version 3 of the License, or (at
25;;; your option) any later version.
26;;;
27;;; GNU Guix is distributed in the hope that it will be useful, but
28;;; WITHOUT ANY WARRANTY; without even the implied warranty of
29;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30;;; GNU General Public License for more details.
31;;;
32;;; You should have received a copy of the GNU General Public License
33;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
34
35(define-module (gnu packages debug)
36 #:use-module (guix packages)
37 #:use-module ((guix licenses) #:prefix license:)
38 #:use-module (guix download)
39 #:use-module (guix git-download)
40 #:use-module (guix utils)
41 #:use-module (guix build-system gnu)
42 #:use-module (guix build-system cmake)
43 #:use-module (guix build-system go)
44 #:use-module (guix build-system linux-module)
45 #:use-module (guix build-system pyproject)
46 #:use-module (guix build-system qt)
47 #:use-module (guix gexp)
48 #:use-module (gnu packages)
49 #:use-module (gnu packages attr)
50 #:use-module (gnu packages autotools)
51 #:use-module (gnu packages base)
52 #:use-module (gnu packages bash)
53 #:use-module (gnu packages bison)
54 #:use-module (gnu packages c)
55 #:use-module (gnu packages cpp)
56 #:use-module (gnu packages check)
57 #:use-module (gnu packages cmake)
58 #:use-module (gnu packages code)
59 #:use-module (gnu packages compression)
60 #:use-module (gnu packages digest)
61 #:use-module (gnu packages compiler-tools)
62 #:use-module (gnu packages fontutils)
63 #:use-module (gnu packages gcc)
64 #:use-module (gnu packages gdb)
65 #:use-module (gnu packages glib)
66 #:use-module (gnu packages gtk)
67 #:use-module (gnu packages golang)
68 #:use-module (gnu packages golang-build)
69 #:use-module (gnu packages golang-web)
70 #:use-module (gnu packages golang-xyz)
71 #:use-module (gnu packages image)
72 #:use-module (gnu packages java)
73 #:use-module (gnu packages toolkits)
74 #:use-module (gnu packages libusb)
75 #:use-module (gnu packages linux)
76 #:use-module (gnu packages llvm)
77 #:use-module (gnu packages mail)
78 #:use-module (gnu packages multiprecision)
79 #:use-module (gnu packages ncurses)
80 #:use-module (gnu packages perl)
81 #:use-module (gnu packages pkg-config)
82 #:use-module (gnu packages pretty-print)
83 #:use-module (gnu packages python)
84 #:use-module (gnu packages python-build)
85 #:use-module (gnu packages python-check)
86 #:use-module (gnu packages python-science)
87 #:use-module (gnu packages python-xyz)
88 #:use-module (gnu packages qt)
89 #:use-module (gnu packages readline)
90 #:use-module (gnu packages serialization)
91 #:use-module (gnu packages texinfo)
92 #:use-module (gnu packages time)
93 #:use-module (gnu packages virtualization)
94 #:use-module (gnu packages xdisorg)
95 #:use-module (gnu packages xml)
96 #:use-module (gnu packages xorg)
97 #:use-module (ice-9 match)
98 #:use-module (srfi srfi-1))
99
100(define-public delta
101 (package
102 (name "delta")
103 (version "2006.08.03")
104 (source
105 (origin
106 (method url-fetch)
107 (uri (list
108 (string-append "mirror://debian/pool/main/d/delta/"
109 "delta_" version ".orig.tar.gz")))
110 (sha256
111 (base32
112 "184wh35pf2ddx97319s6sgkzpz48xxkbwzcjpycv009bm53lh61q"))))
113 (build-system gnu-build-system)
114 (inputs ;Installed programs are perl scripts
115 (list perl))
116 (arguments
117 `(#:phases
118 (modify-phases %standard-phases
119 (replace 'install
120 (lambda* (#:key outputs #:allow-other-keys)
121 ;; Makefile contains no install target
122 (let* ((out (assoc-ref outputs "out"))
123 (bin (string-append out "/bin"))
124 (doc (string-append out "/share/doc/delta-" ,version)))
125 (begin
126 (for-each (lambda (h)
127 (install-file h doc))
128 `("License.txt" ,@(find-files "www" ".*\\.html")))
129 (for-each (lambda (b)
130 (install-file b bin))
131 `("delta" "multidelta" "topformflat"))))
132 #t))
133 (delete 'configure)))) ; no configure script
134 (home-page
135 "https://web.archive.org/web/20200701152100/http://delta.tigris.org/")
136 (synopsis "Heuristical file minimizer")
137 (description
138 "Delta assists you in minimizing \"interesting\" files subject to a test
139of their interestingness. A common such situation is when attempting to
140isolate a small failure-inducing substring of a large input that causes your
141program to exhibit a bug.")
142 ;; See License.txt, which is a bsd-3 license, despite the project's
143 ;; home-page pointing to a bsd-2 license.
144 (license license:bsd-3)))
145
146(define-public c-reduce
147 (let ((commit "31e855e290970cba0286e5032971509c0e7c0a80")
148 (revision "0"))
149 (package
150 (name "c-reduce")
151 (version (git-version "2.10.0" revision commit))
152 (source
153 (origin
154 (method git-fetch)
155 (uri (git-reference
156 (url "https://github.com/csmith-project/creduce")
157 (commit commit)))
158 (file-name (git-file-name name version))
159 (sha256
160 (base32 "1yd3wvnkj7qgn2jj5byp58p3qq04w5d6agagrkgi5z5gb6z4qyqk"))))
161 (build-system gnu-build-system)
162 (arguments
163 (list
164 #:phases
165 #~(modify-phases %standard-phases
166 (replace 'check
167 (lambda _
168 (with-directory-excursion "tests"
169 ;; Running all tests can take a looong time, and tests 4 and 5
170 ;; require frama-c or kcc. So run just one for sanity.
171 (invoke "./run_tests" "1"))))
172 (add-after 'install 'set-load-paths
173 (lambda _
174 ;; Tell creduce where to find the perl modules it needs.
175 (wrap-program (string-append #$output "/bin/creduce")
176 `("PERL5LIB" ":" prefix (,(getenv "PERL5LIB")))))))))
177 (native-inputs (list flex))
178 (inputs (list astyle
179 bash-minimal ;for wrap-program
180 llvm-18
181 clang-18
182 indent
183 perl
184 perl-exporter-lite
185 perl-file-which
186 perl-getopt-tabular
187 perl-regexp-common
188 perl-term-readkey))
189 (home-page "https://embed.cs.utah.edu/creduce")
190 (synopsis "Reducer for interesting code")
191 (description
192 "C-Reduce is a tool that takes a large C or C++ program that has a
193property of interest (such as triggering a compiler bug) and automatically
194produces a much smaller C/C++ program that has the same property. It is
195intended for use by people who discover and report bugs in compilers and other
196tools that process C/C++ code.")
197 (license license:ncsa))))
198
199(define-public cppdap
200 (package
201 (name "cppdap")
202 (version "1.58.0-a")
203 (source
204 (origin
205 (method git-fetch)
206 (uri
207 (git-reference
208 (url "https://github.com/google/cppdap")
209 (commit (string-append "dap-" version))))
210 (modules '((guix build utils)))
211 (snippet
212 '(delete-file-recursively "third_party"))
213 (patches (search-patches
214 "cppdap-add-CPPDAP_USE_EXTERNAL_GTEST_PACKAGE.patch"))
215 (file-name (git-file-name name version))
216 (sha256
217 (base32
218 "0fq2w35fw1lb5wya1nny45pk3a13b689k48calk1cmqmqpbcjn2b"))))
219 (build-system cmake-build-system)
220 (arguments
221 (list
222 #:configure-flags
223 #~(list
224 "-DCPPDAP_BUILD_TESTS=ON"
225 "-DCPPDAP_USE_EXTERNAL_GTEST_PACKAGE=ON"
226 ;; Only one of the following three can be enabled at the same time
227 ;; "-DCPPDAP_USE_EXTERNAL_RAPIDJSON_PACKAGE=ON"
228 ;; "-DCPPDAP_USE_EXTERNAL_JSONCPP_PACKAGE=ON"
229 "-DCPPDAP_USE_EXTERNAL_NLOHMANN_JSON_PACKAGE=ON")
230 #:phases
231 (if (target-riscv64?)
232 #~(modify-phases %standard-phases
233 ;; We need to unconditionally link with libatomic on some
234 ;; architectures to successfully build cmake.
235 (add-after 'unpack 'link-with-libatomic
236 (lambda _
237 (substitute* "CMakeLists.txt"
238 (("cppdap_set_target_options\\(cppdap\\)" all)
239 (string-append
240 all "\n\n"
241 "target_link_libraries(cppdap PRIVATE atomic)"))))))
242 #~%standard-phases)))
243 (native-inputs
244 (list googletest))
245 ;; see lib/cmake/cppdap/cppdapConfig.cmake
246 ;; cmake file require propagate this.
247 (propagated-inputs
248 (list
249 ;; Only one of the following three can be enabled at the same time
250 ;; rapidjson
251 ;; jsoncpp
252 nlohmann-json))
253 (home-page "https://github.com/google/cppdap")
254 (synopsis "C++ library for the Debug Adapter Protocol")
255 (description
256 "cppdap is a C++11 library (\"SDK\") implementation of the Debug Adapter
257Protocol, providing an API for implementing a DAP client or server. cppdap
258provides C++ type-safe structures for the full DAP specification, and provides a
259simple way to add custom protocol messages.")
260 (license license:expat)))
261
262(define-public c-vise
263 (package
264 (name "c-vise")
265 (version "2.8.0")
266 (source
267 (origin
268 (method git-fetch)
269 (uri (git-reference
270 (url "https://github.com/marxin/cvise")
271 (commit (string-append "v" version))))
272 (sha256
273 (base32 "1ynhm1d56r25apgvv0wqbdrhjbwigkwrgw92g2czz4nfx77rjxz2"))
274 (file-name (git-file-name name version))))
275 (build-system cmake-build-system)
276 (arguments
277 (list
278 #:phases
279 #~(modify-phases %standard-phases
280 (add-after 'unpack 'fix-linkage
281 (lambda _
282 (substitute* "clang_delta/CMakeLists.txt"
283 (("\\$\\{LLVM_LINK_LLVM_DYLIB\\}")
284 "True")
285 ((" LLVM")
286 " LLVMSupport"))))
287 (add-before 'build 'hardcode-paths
288 (lambda _
289 (substitute* "cvise.py"
290 (("/bin/bash")
291 (which "bash"))
292 (("(.*)# Special case for clang-format" all blank)
293 (format #f "~a# Special case for unifdef
294~aprograms['unifdef'] = ~s
295~a"
296 blank blank (which "unifdef") all)))))
297 (add-after 'install 'wrap
298 (lambda _
299 (let ((python-path (getenv "GUIX_PYTHONPATH")))
300 (wrap-program (string-append #$output "/bin/cvise")
301 `("PYTHONPATH" ":" prefix
302 (,(string-join
303 (filter (lambda (cand)
304 (not (string-contains cand "pytest")))
305 (string-split python-path #\:))
306 ":"))))))))))
307 (native-inputs
308 (list flex
309 python-pytest
310 python-pytest-flake8))
311 (inputs
312 (list bash-minimal
313 clang
314 llvm
315 unifdef
316 python
317 python-pebble
318 python-psutil
319 python-chardet))
320 (home-page "https://github.com/marxin/cvise")
321 (synopsis "Reducer for interesting code")
322 (description
323 "C-Vise is a Python port of the C-Reduce tool that is fully compatible
324and uses the same efficient LLVM-based C/C++ @code{clang_delta} reduction
325tool.")
326 (license license:ncsa)))
327
328(define-public qemu-for-aflplusplus
329 (let ((base qemu-minimal)
330 (commit "7c3bab75c4a9adaed78cefbe1468a6b49c363f58")
331 (revision "2"))
332 (hidden-package
333 (package
334 (inherit base)
335 (name "qemu")
336 (version (git-version "5.2.50" revision commit))
337 (source
338 (origin
339 (method git-fetch)
340 (uri (git-reference (url "https://github.com/AFLplusplus/qemuafl")
341 (commit commit)
342 (recursive? #t)))
343 (file-name (git-file-name name version))
344 (sha256
345 (base32 "03352zbp73wgwyk25f26rw7h5yqyjp6fysl2n7nj32wp16vxmlza"))))
346 (arguments
347 (substitute-keyword-arguments arguments
348 ((#:configure-flags _ #~'())
349 #~(list (string-append
350 "--target-list="
351 ;; AFL++ only supports using a single afl-qemu-trace,
352 ;; so we only build qemu for the native target.
353 (match #$(let-system system system)
354 ("aarch64-linux" "aarch64-linux-user")
355 ("armhf-linux" "arm-linux-user")
356 ("i686-linux" "i386-linux-user")
357 ("mips64el-linux" "mips64el-linux-user")
358 ("powerpc-linux" "ppc-linux-user")
359 ("riscv64-linux" "riscv64-linux-user")
360 ("x86_64-linux" "x86_64-linux-user")))))
361 ((#:phases phases)
362 #~(modify-phases #$phases
363 (delete 'replace-firmwares)
364 (delete 'patch-embedded-shebangs)
365 (delete 'fix-optionrom-makefile)
366 (delete 'disable-unusable-tests)
367 (replace 'configure
368 (lambda* (#:key configure-flags #:allow-other-keys)
369 ;; The `configure' script doesn't understand some of the
370 ;; GNU options. Thus, add a new phase that's compatible.
371 (setenv "SHELL" (which "bash"))
372 ;; The binaries need to be linked against -lrt.
373 (setenv "LDFLAGS" "-lrt")
374 (apply invoke
375 "./configure"
376 (string-append "--cc=" #$(cc-for-target))
377 ;; Some architectures insist on using HOST_CC
378 (string-append "--host-cc=" #$(cc-for-target))
379 "--disable-debug-info" ; save build space
380 (string-append "--prefix=" #$output)
381 (string-append "--sysconfdir=/etc")
382 configure-flags)))
383 (add-after 'install 'install-qasan-header
384 (lambda _
385 (install-file "qemuafl/qasan.h"
386 (string-append #$output "/include"))))
387 (delete 'delete-firmwares)
388 #$@(if (target-riscv64?)
389 '((replace 'disable-some-tests
390 (lambda _
391 ;; qemu.qmp.QMPConnectError:
392 ;; Unexpected empty reply from server
393 (delete-file "tests/qemu-iotests/040")
394 (delete-file "tests/qemu-iotests/041")
395 (delete-file "tests/qemu-iotests/256")
396 ;; No 'PCI' bus found for device 'virtio-scsi-pci'
397 (delete-file "tests/qemu-iotests/127")
398 (delete-file "tests/qemu-iotests/267"))))
399 '())))))
400 (inputs (modify-inputs inputs
401 (delete "dtc")))
402 (home-page "https://github.com/AFLplusplus/qemuafl")
403 (synopsis "QEMU for AFL++")))))
404
405(define-public aflplusplus
406 ;; TODO: Merge the duplicate application of modify-phases,
407 ;; due to the previous inheritance from american-fuzzy-lop.
408 (let* ((machine (match (or (%current-target-system)
409 (%current-system))
410 ("x86_64-linux" "x86_64")
411 ("i686-linux" "i386")
412 ("aarch64-linux" "aarch64")
413 ("armhf-linux" "arm")
414 ("mips64el-linux" "mips64el")
415 ("powerpc-linux" "ppc")
416 ;; Prevent errors when querying this package on unsupported
417 ;; platforms, e.g. when running "guix package --search="
418 (_ "UNSUPPORTED")))
419 (arguments-american-fuzzy-lop
420 `(#:make-flags '()
421 #:phases (modify-phases %standard-phases
422 (add-after 'unpack 'make-git-checkout-writable
423 (lambda _
424 (for-each make-file-writable (find-files "."))
425 #t))
426 (delete 'configure)
427 ,@(if (string=? (%current-system) (or "x86_64-linux"
428 "i686-linux"))
429 '()
430 '((add-before 'build 'set-afl-flag
431 (lambda _ (setenv "AFL_NO_X86" "1") #t))
432 (add-after 'install 'remove-x86-programs
433 (lambda* (#:key outputs #:allow-other-keys)
434 (let* ((out (assoc-ref outputs "out"))
435 (bin (string-append out "/bin/")))
436 (delete-file (string-append bin "afl-gcc"))
437 (delete-file (string-append bin "afl-g++"))
438 (delete-file (string-append bin "afl-clang"))
439 (delete-file (string-append bin "afl-clang++")))
440 #t))))
441 (add-after
442 ;; TODO: Build and install the afl-llvm tool.
443 'install 'install-qemu
444 (lambda* (#:key inputs outputs #:allow-other-keys)
445 (let ((qemu (assoc-ref inputs "qemu"))
446 (out (assoc-ref outputs "out")))
447 (symlink (string-append qemu "/bin/qemu-" ,machine)
448 (string-append out "/bin/afl-qemu-trace"))
449 #t)))
450 (delete 'check))))) ; tests are run during 'install phase
451 (package
452 (name "aflplusplus")
453 (version "4.40c")
454 (source (origin
455 (method git-fetch)
456 (uri (git-reference
457 (url "https://github.com/AFLplusplus/AFLplusplus")
458 (commit (string-append "v" version))))
459 (file-name (git-file-name name version))
460 (sha256
461 (base32
462 "00v174pxkj74pa2rcgkcbvxdq3sax9la33g3ikpjd3x1ck69mla2"))))
463 (build-system gnu-build-system)
464 (arguments
465 (substitute-keyword-arguments arguments-american-fuzzy-lop
466 ((#:make-flags _ ''())
467 #~(list (string-append "PREFIX=" #$output)
468 (string-append "DOC_PATH=" #$output "/share/doc/"
469 #$(package-name this-package) "-"
470 #$(package-version this-package))
471 (string-append "CC=" #$(cc-for-target))
472 (string-append "CXX=" #$(cxx-for-target))
473 (string-append "LLVM_CONFIG="
474 (search-input-file %build-inputs "/bin/llvm-config"))
475 ;; Need to use LLD with the llvm_mode, because LTO in
476 ;; combination with binutils gold is currently broken.
477 ;;
478 ;; See: https://codeberg.org/guix/guix/issues/3307
479 (string-append "AFL_REAL_LD="
480 (search-input-file %build-inputs "/bin/ld.lld"))
481 (string-append "CLANG_BIN="
482 (search-input-file %build-inputs "/bin/clang"))
483 (string-append "CLANGPP_BIN="
484 (search-input-file %build-inputs "/bin/clang++"))
485 "LLVM_LTO=1"
486 "AFL_CLANG_FLTO=-flto=full"))
487 ((#:phases phases '%standard-phases)
488 #~(modify-phases #$phases
489 ;; Ensure that the build fails early if LLVM support fails to
490 ;; compile, makes the build log much easier to understand.
491 (add-after 'unpack 'fatal-llvm-failure
492 (lambda* (#:key inputs #:allow-other-keys)
493 (substitute* "GNUmakefile"
494 (("-\\$\\(MAKE\\) ..* -f GNUmakefile.llvm$" all)
495 (substring all 1))))) ; remove the leading '-'
496 ;; GNUmakefile.llvm tries to find clang/clang++ relative to the
497 ;; --bindir reported by llvm-config, but since llvm and clang
498 ;; have different store paths on Guix, this doesn't work here.
499 (add-after 'unpack 'patch-clang-path
500 (lambda* (#:key inputs #:allow-other-keys)
501 (substitute* "GNUmakefile.llvm"
502 (("^CC *= .*$")
503 (string-append
504 "override CC = "
505 (search-input-file inputs "/bin/clang")
506 "\n"))
507 (("^CXX *= .*$")
508 (string-append
509 "override CXX = "
510 (search-input-file inputs "/bin/clang++")
511 "\n")))))
512 ;; For GCC plugins.
513 (add-after 'unpack 'patch-gcc-path
514 (lambda* (#:key inputs #:allow-other-keys)
515 (substitute* "src/afl-cc.c"
516 (("alt_cc = \"gcc\";")
517 (format #f "alt_cc = \"~a\";"
518 (search-input-file inputs "bin/gcc")))
519 (("alt_cxx = \"g\\+\\+\";")
520 (format #f "alt_cxx = \"~a\";"
521 (search-input-file inputs "bin/g++"))))))
522 (add-after 'build 'build-qasan
523 (lambda* (#:key parallel-build? make-flags #:allow-other-keys)
524 (apply invoke "make" "-C" "qemu_mode/libqasan"
525 "-j" (number->string (if parallel-build?
526 (parallel-job-count)
527 "1"))
528 make-flags)))
529 ;; afl-qemu-trace is a symbolic link to QEMU's binary.
530 ;; Substituting its source code with AFL++'s output path
531 ;; would result in a dependency cycle.
532 (add-after 'install-qemu 'wrap-qemu
533 (lambda _
534 (wrap-program (string-append #$output "/bin/afl-qemu-trace")
535 `("AFL_PATH" = (,(string-append #$output "/lib/afl"))))))))))
536 (inputs (list llvm-20 clang-20 lld-20 gcc gmp python qemu-for-aflplusplus))
537 (native-inputs (list gcc))
538 (home-page "https://aflplus.plus/")
539 (synopsis "Security-oriented fuzzer")
540 (description
541 "AFLplusplus is a security-oriented fuzzer that employs a novel type of
542compile-time instrumentation and genetic algorithms to automatically discover
543clean, interesting test cases that trigger new internal states in the targeted
544binary. This substantially improves the functional coverage for the fuzzed
545code. The compact synthesized corpora produced by the tool are also useful for
546seeding other, more labor- or resource-intensive testing regimes down the road.
547It is a fork of American Fuzzy Lop fuzzer and features:
548@itemize
549@item A more recent qemu version.
550@item More algorithms like collision-free coverage, enhanced laf-intel &
551redqueen, AFLfast++ power schedules, MOpt mutators, unicorn_mode, etc.
552@end itemize")
553 (license license:asl2.0))))
554
555(define-public backward-cpp
556 (package
557 (name "backward-cpp")
558 (version "1.6")
559 (source (origin
560 (method git-fetch)
561 (uri (git-reference
562 (url "https://github.com/bombela/backward-cpp")
563 (commit (string-append "v" version))))
564 (file-name (git-file-name name version))
565 (sha256
566 (base32
567 "1b2h03iwfhcsg8i4f125mlrjf8l1y7qsr2gsbkv0z03i067lykns"))))
568 (arguments
569 (list
570 #:configure-flags
571 #~(list "-DBACKWARD_SHARED=ON")))
572 (build-system cmake-build-system)
573 (inputs
574 (list libiberty zlib))
575 (synopsis "Stack trace pretty printer for C++")
576 (description
577 "Backward-cpp is a stack trace pretty printer for C++.
578It can print annotated stack traces using debug info in the executable.")
579 (home-page "https://github.com/bombela/backward-cpp")
580 (license license:expat)))
581
582(define-public stress-make
583 (let ((commit "97815bed8060de33952475b3498767c91f59ffd9")
584 (revision "2")) ;No official source distribution
585 (package
586 (name "stress-make")
587 (version (git-version "1.0" revision commit))
588 (source
589 (origin
590 (method git-fetch)
591 (uri (git-reference
592 (url "https://github.com/lanl/stress-make")
593 (commit commit)))
594 (file-name (git-file-name name version))
595 (sha256
596 (base32
597 "0k55cy7x0hlc6rgpascl6ibhcfxaash3p9r9r8kwvbm3zag1rmac"))))
598 (build-system gnu-build-system)
599 (native-inputs
600 (list autoconf automake go))
601 (inputs
602 `(("make-source" ,(package-source gnu-make))))
603 (arguments
604 ;; stress-make's configure script insists on having a tarball and does
605 ;; not accept a directory name instead. To let the gnu-build-system's
606 ;; patch-* phases work properly, we unpack the source first, then
607 ;; repack before the configure phase.
608 (let ((make-dir (string-append "make-" (package-version gnu-make))))
609 `(#:configure-flags '("--with-make-tar=./make.tar.xz"
610 "make_cv_sys_gnu_glob=yes")
611 #:phases
612 (modify-phases %standard-phases
613 (add-after 'unpack 'unpack-make
614 (lambda* (#:key inputs #:allow-other-keys)
615 (invoke "tar" "xf" (assoc-ref inputs "make-source"))))
616 (add-after 'unpack-make 'set-default-shell
617 (lambda _
618 ;; Taken mostly directly from (@ (gnu packages base) gnu-make)
619 (substitute* (string-append ,make-dir "/src/job.c")
620 (("default_shell = .*$")
621 (format #f "default_shell = \"~a\";\n"
622 (which "sh"))))))
623 (add-before 'configure 'repack-make
624 (lambda _
625 (invoke "tar" "cJf" "./make.tar.xz" ,make-dir)))
626 (add-before 'build 'setup-go
627 ;; The Go cache is required starting in Go 1.12, and it needs
628 ;; to be writable.
629 (lambda _ (setenv "GOCACHE" "/tmp/go-cache") #t))))))
630 (home-page "https://github.com/lanl/stress-make")
631 (synopsis "Expose race conditions in Makefiles")
632 (description
633 "Stress Make is a customized GNU Make that explicitly manages the order
634in which concurrent jobs are run to provoke erroneous behavior into becoming
635manifest. It can run jobs in the order in which they're launched, in backwards
636order, or in random order. The thought is that if code builds correctly with
637Stress Make, then it is likely that the @code{Makefile} contains no race
638conditions.")
639 ;; stress-make wrapper is under BSD-3-modifications-must-be-indicated,
640 ;; and patched GNU Make is under its own license.
641 (license (list (license:non-copyleft "LICENSE.md")
642 license:gpl3+)))))
643
644(define-public zzuf
645 (package
646 (name "zzuf")
647 (version "0.15")
648 (source
649 (origin
650 (method url-fetch)
651 (uri (string-append
652 "https://github.com/samhocevar/zzuf/releases/download/v"
653 version "/" name "-" version ".tar.gz"))
654 (file-name (string-append name "-" version ".tar.gz"))
655 (sha256
656 (base32
657 "1mpzjaksc2qg2hzqflf39pl06p53qam2dn3hkhkcv6p00d2n4kx3"))))
658 (build-system gnu-build-system)
659 (native-inputs (list gcc-13))
660 (home-page "https://github.com/samhocevar/zzuf")
661 (synopsis "Transparent application input fuzzer")
662 (description "Zzuf is a transparent application input fuzzer. It works by
663intercepting file operations and changing random bits in the program's
664input. Zzuf's behaviour is deterministic, making it easy to reproduce bugs.")
665 (license license:wtfpl2)))
666
667(define-public scanmem
668 (package
669 (name "scanmem")
670 (version "0.17")
671 (source
672 (origin
673 (method git-fetch)
674 (uri (git-reference
675 (url "https://github.com/scanmem/scanmem")
676 (commit (string-append "v" version))))
677 (file-name (git-file-name name version))
678 (sha256
679 (base32
680 "17p8sh0rj8yqz36ria5bp48c8523zzw3y9g8sbm2jwq7sc27i7s9"))))
681 (build-system gnu-build-system)
682 (arguments
683 `(#:configure-flags '("--enable-gui")
684 #:phases
685 (modify-phases %standard-phases
686 (add-before 'configure 'hardcode-python
687 (lambda* (#:key inputs outputs #:allow-other-keys)
688 (substitute* "gui/GameConqueror.py"
689 (("/usr/bin/env python")
690 (search-input-file inputs "/bin/python")))))
691 (add-after 'install 'wrap-gameconqueror
692 (lambda* (#:key inputs outputs #:allow-other-keys)
693 (let ((out (assoc-ref outputs "out"))
694 (gi-typelib-path (getenv "GI_TYPELIB_PATH"))
695 (python-path (getenv "GUIX_PYTHONPATH")))
696 (wrap-program (string-append out "/share/gameconqueror/GameConqueror.py")
697 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))
698 `("GUIX_PYTHONPATH" ":" prefix (,python-path))))
699 #t)))))
700 (native-inputs
701 (list libtool
702 python-wrapper
703 gobject-introspection
704 gtk+
705 intltool
706 automake
707 autoconf))
708 (inputs
709 (list bash-minimal
710 readline))
711 (propagated-inputs
712 (list python-pygobject))
713 (home-page "https://github.com/scanmem/scanmem")
714 (synopsis "Memory scanner")
715 (description "Scanmem is a debugging utility designed to isolate the
716address of an arbitrary variable in an executing process. Scanmem simply
717needs to be told the pid of the process and the value of the variable at
718several different times. After several scans of the process, scanmem isolates
719the position of the variable and allows you to modify its value.")
720 ;; The library is covered by LGPLv3 or later; the application is covered
721 ;; by GPLv3 or later.
722 (license (list license:lgpl3+ license:gpl3+))))
723
724(define-public remake
725 (package (inherit gnu-make)
726 (name "remake")
727 (version "4.3-1.6")
728 (source (origin
729 (method url-fetch)
730 (uri (let ((upstream-version
731 (match (string-split version #\-)
732 ((ver sub) (string-append ver "%2Bdbg-" sub)))))
733 (string-append "mirror://sourceforge/bashdb/"
734 "remake/" upstream-version "/"
735 "remake-" upstream-version ".tar.gz")))
736 (file-name (string-append "remake-" version ".tar.gz"))
737 (sha256
738 (base32
739 "11vvch8bi0yhjfz7gn92b3xmmm0cgi3qfiyhbnnj89frkhbwd87n"))
740 (patches (search-patches "remake-impure-dirs.patch"))))
741 (inputs
742 (modify-inputs inputs
743 (prepend readline)))
744 (home-page "https://bashdb.sourceforge.net/remake/")
745 (description "Remake is an enhanced version of GNU Make that adds improved
746error reporting, better tracing, profiling, and a debugger.")
747 (license license:gpl3+)))
748
749(define-public rr
750 ;; Use a newer commit, which contains unreleased fixes to the
751 ;; zen-pmu-workaround.c kernel module, among others.
752 (let ((commit "7fe1e367c2b4e0df7647e020c20d66827badfad3")
753 (revision "0"))
754 (package
755 (name "rr")
756 (version (git-version "5.9.0" revision commit))
757 (source (origin
758 (method git-fetch)
759 (uri (git-reference
760 (url "https://github.com/mozilla/rr")
761 (commit commit)))
762 (sha256
763 (base32
764 "1zgxk4blwwq0bigi0g8dafgl330aid3kw9ym426825flc3pp1c3m"))
765 (file-name (git-file-name name version))))
766 (build-system cmake-build-system)
767 (arguments
768 `(#:configure-flags
769 ;; The 'rr_exec_stub' is a static binary, which leads CMake to fail
770 ;; with ‘file RPATH_CHANGE could not write new RPATH: ...’.
771 ;; Clear CMAKE_INSTALL_RPATH to avoid that problem.
772 (list "-DCMAKE_INSTALL_RPATH="
773 ;; Satisfy the ‘validate-runpath’ phase. This isn't a direct
774 ;; consequence of clearing CMAKE_INSTALL_RPATH.
775 (string-append "-DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath="
776 (assoc-ref %build-inputs "capnproto")
777 "/lib,-rpath=" (assoc-ref %build-inputs "zlib")
778 "/lib,-rpath=" (assoc-ref %build-inputs "zstd")
779 "/lib")
780 ,@(if (and (not (%current-target-system))
781 (member (%current-system)
782 '("x86_64-linux" "aarch64-linux")))
783 ;; The toolchain doesn't support '-m32'.
784 '("-Ddisable32bit=ON")
785 '()))
786
787 ;; XXX: Most tests fail with:
788 ;;
789 ;; rr needs /proc/sys/kernel/perf_event_paranoid <= 1, but it is 2.
790 ;;
791 ;; This setting cannot be changed from the build environment, so skip
792 ;; the tests.
793 #:tests? #f
794
795 #:phases (modify-phases %standard-phases
796 (add-before 'check 'set-home
797 (lambda _
798 ;; Some tests expect 'HOME' to be set.
799 (setenv "HOME" (getcwd)))))))
800 (native-inputs
801 (list lldb pkg-config which))
802 (inputs
803 (list gdb
804 capnproto
805 python
806 python-pexpect
807 zlib
808 `(,zstd "lib")))
809
810 ;; List of supported systems according to 'src/preload/raw_syscall.S'.
811 (supported-systems '("x86_64-linux" "i686-linux" "aarch64-linux"))
812
813 (home-page "https://rr-project.org/")
814 (synopsis "Record and replay debugging framework")
815 (description
816 "rr is a lightweight tool for recording, replaying and debugging
817execution of applications (trees of processes and threads). Debugging extends
818GDB with very efficient reverse-execution, which in combination with standard
819GDB/x86 features like hardware data watchpoints, makes debugging much more
820fun.")
821 (license license:expat))))
822
823(define-public rr-zen-pmu-workaround
824 (package
825 (name "rr-zen-pmu-workaround")
826 (version (package-version rr))
827 (source (package-source rr))
828 (build-system linux-module-build-system)
829 (arguments
830 (list
831 #:tests? #f ;no tests
832 #:phases
833 #~(modify-phases %standard-phases
834 (add-after 'unpack 'cd
835 (lambda _
836 (chdir "third-party/zen-pmu-workaround"))))))
837 (home-page "https://github.com/rr-debugger/rr/wiki/Zen")
838 (synopsis "AMD Zen workaround kernel module for rr")
839 (description "This is a Linux kernel module that implements
840 workarounds needed for using the @command{rr} debugger with AMD Zen
841@acronym{CPU, Central Processing Unit}.")
842 (license license:gpl2))) ;GPLv2 only, like the kernel
843
844(define-public libbacktrace
845 ;; There are no releases nor tags.
846 (let ((revision "2")
847 (commit "cdb64b688dda93bbbacbc2b1ccf50ce9329d4748"))
848 (package
849 (name "libbacktrace")
850 (version (git-version "1.0" revision commit))
851 (source (origin
852 (method git-fetch)
853 (uri (git-reference
854 (url "https://github.com/ianlancetaylor/libbacktrace")
855 (commit commit)))
856 (file-name (git-file-name name version))
857 (sha256
858 (base32
859 "0iwd41pgr2nxlmghqdfwfwxac27jbqxwxp07jihhq85a8s3igjgr"))))
860 (build-system gnu-build-system)
861 (arguments
862 `(#:parallel-tests? #f ;spurious failures when testing in parallel
863 #:make-flags '("CFLAGS=-fPIC")))
864 (home-page "https://github.com/ianlancetaylor/libbacktrace")
865 (synopsis "C library for producing symbolic backtraces")
866 (description "The @code{libbacktrace} library can be linked into a C/C++
867program to produce symbolic backtraces.")
868 (license license:bsd-3))))
869
870(define-public libleak
871 (package
872 (name "libleak")
873 (version "0.3.6")
874 (source (origin
875 (method git-fetch)
876 (uri (git-reference
877 (url "https://github.com/WuBingzheng/libleak")
878 (commit (string-append "v" version))))
879 (file-name (git-file-name name version))
880 (sha256
881 (base32
882 "1p6x20mm0dym2qn10d6cvwmh71m93xwcd319g94zkv88hj5q17n6"))))
883 (build-system gnu-build-system)
884 (arguments
885 `(#:tests? #f ;no test suite
886 #:parallel-build? #f ;jobserver unavailable
887 #:phases (modify-phases %standard-phases
888 (add-after 'unpack 'unbundle-libwuya
889 (lambda _
890 (substitute* "Makefile"
891 ((".*make -C libwuya.*") ""))
892 #t))
893 (add-before 'build 'set-CC
894 (lambda _
895 (setenv "CC" "gcc")
896 #t))
897 (delete 'configure) ;no configure script
898 (replace 'install
899 (lambda* (#:key outputs #:allow-other-keys)
900 (let* ((out (assoc-ref outputs "out")))
901 (install-file "libleak.so" (string-append out "/lib"))
902 #t))))))
903 (inputs (list libbacktrace libwuya))
904 (home-page "https://github.com/WuBingzheng/libleak")
905 (synopsis "Memory leaks detection tool")
906 (description "The libleak tool detects memory leaks by hooking memory
907functions such as @code{malloc}. It comes as a shared object to be pre-loaded
908via @code{LD_PRELOAD} when launching the application. It prints the full call
909stack at suspicious memory leak points. Modifying or recompiling the target
910program is not required, and the detection can be enabled or disabled while
911the target application is running. The overhead incurred by libleak is
912smaller than that of other tools such as Valgrind, and it aims to be easier to
913use than similar tools like @command{mtrace}.")
914 (license license:gpl2+)))
915
916(define-public cgdb
917 (package
918 (name "cgdb")
919 (version "0.8.0")
920 (source
921 (origin
922 (method url-fetch)
923 (uri (string-append "https://cgdb.me/files/cgdb-" version ".tar.gz"))
924 (sha256
925 (base32 "1w8ib2vg3pg68d9hh97fw5042c73i9nqavdddc87n9bpscjbaf0d"))))
926 (build-system gnu-build-system)
927 (inputs
928 (list bash-minimal ncurses readline gdb))
929 (native-inputs
930 (list flex texinfo))
931 (arguments
932 `(#:configure-flags
933 (list
934 (string-append "ac_cv_rl_version=" ,(package-version readline))
935 "ac_cv_file__dev_ptmx=no"
936 "ac_cv_file__proc_self_status=no"
937 "ac_cv_func_setpgrp_void=no")
938 #:phases
939 (modify-phases %standard-phases
940 (add-after 'unpack 'fix-paths
941 (lambda* (#:key inputs #:allow-other-keys)
942 (let ((gdb (search-input-file inputs "bin/gdb"))
943 (sh (search-input-file inputs "bin/sh")))
944 (substitute* "lib/util/fork_util.cpp"
945 (("GDB = \"gdb\"") (string-append "GDB = \"" gdb "\"")))
946 (substitute* "cgdb/cgdb.cpp" (("/bin/sh") sh))))))))
947 (home-page "https://cgdb.github.io")
948 (synopsis "Console front-end to the GNU debugger")
949 (description
950 "@code{cgdb} is a lightweight curses (terminal-based) interface to the
951GNU Debugger (GDB). In addition to the standard gdb console, cgdb provides
952a split screen view that displays the source code as it executes. The
953keyboard interface is modeled after vim, so vim users should feel at home
954using cgdb.")
955 (license license:gpl2+)))
956
957(define-public mspdebug
958 ;; Last official release was 24 July 2017
959 (let ((commit "4c4d94e43bc4a18ecf82070ff81cd38dd5641e3b")
960 (revision "0"))
961 (package
962 (name "mspdebug")
963 (version (git-version "0.25" revision commit))
964 (source (origin
965 (method git-fetch)
966 (uri (git-reference
967 (url "https://github.com/dlbeer/mspdebug")
968 (commit commit)))
969 (file-name (git-file-name name version))
970 (sha256
971 (base32 "1lgw1dsc1aglyja610ichadvgs5b0df3wlarinczb0ykf431gjln"))))
972 (build-system gnu-build-system)
973 (arguments
974 `(#:tests? #f ; no test suite
975 #:phases
976 (modify-phases %standard-phases
977 (delete 'configure)) ; no configure script
978 #:make-flags
979 (list (string-append "CC=" ,(cc-for-target))
980 "INSTALL=install"
981 (string-append "PREFIX=" %output))))
982 (inputs
983 (list libusb-compat readline))
984 (synopsis "Debugging tool for MSP430 MCUs")
985 (description "MspDebug supports FET430UIF, eZ430, RF2500 and Olimex
986MSP430-JTAG-TINY programmers, as well as many other compatible
987devices. It can be used as a proxy for gdb or as an independent
988debugger with support for programming, disassembly and reverse
989engineering.")
990 (home-page "https://github.com/dlbeer/mspdebug")
991 (license license:gpl2+))))
992
993(define-public seer-gdb
994 (package
995 (name "seer-gdb")
996 (version "2.7")
997 (source
998 (origin
999 (method git-fetch)
1000 (uri (git-reference
1001 (url "https://github.com/epasveer/seer")
1002 (commit (string-append "v" version))))
1003 (file-name (git-file-name name version))
1004 (sha256
1005 (base32 "1szfqybqr5z982vian4f0hpsagiqapzys3axwibyjyg5whjswva1"))))
1006 (build-system qt-build-system)
1007 (arguments
1008 (list
1009 #:tests? #f ;tests are strangely manual
1010 #:phases
1011 #~(modify-phases %standard-phases
1012 (add-after 'unpack 'chdir
1013 (lambda _
1014 (chdir "src"))))))
1015 (inputs
1016 (list gdb qtbase qtcharts qtsvg qtwayland))
1017 (synopsis "GUI frontend for GDB")
1018 (description "This package provides a frontend to GDB, the GNU debugger.")
1019 (home-page "https://github.com/epasveer/seer")
1020 ;; Note: Some icons in src/resources are creative commons 3.0 and/or 4.0.
1021 (license license:gpl3+)))
1022
1023(define-public ddd
1024 (package
1025 (name "ddd")
1026 (version "3.4.1")
1027 (source (origin
1028 (method url-fetch)
1029 (uri (string-append "mirror://gnu/ddd/ddd-" version ".tar.gz"))
1030 (patches (search-patches "ddd-build.patch"))
1031 (sha256
1032 (base32
1033 "12gfyh139rim49m56lxm36ckdyiiz4n3la3y6ik1aqgrqfk1fxdq"))))
1034 (build-system gnu-build-system)
1035 (arguments
1036 (list #:tests? #f ;tests require manual intervention
1037 #:configure-flags
1038 #~(list (string-append "--with-freetype-includes="
1039 #$(this-package-input "freetype") "/include/freetype2"))))
1040 (native-inputs
1041 (list pkg-config bison flex perl))
1042 (inputs
1043 (list libxaw libxft freetype motif ncurses gdb))
1044 (synopsis "Graphical front-end for GDB and other debuggers")
1045 (description "GNU DDD, the Data Display Debugger, is a graphical front-end
1046for command-line debuggers. Many back-end debuggers are supported, notably
1047the GNU debugger, GDB. In addition to usual debugging features such as
1048viewing the source files, DDD has additional graphical, interactive features
1049to aid in debugging.")
1050 (home-page "https://www.gnu.org/software/ddd/")
1051 (license license:gpl3+)))
1052
1053(define-public delve
1054 (package
1055 (name "delve")
1056 (version "1.26.3")
1057 (source
1058 (origin
1059 (method git-fetch)
1060 (uri (git-reference
1061 (url "https://github.com/go-delve/delve")
1062 (commit (string-append "v" version))))
1063 (file-name (git-file-name name version))
1064 (sha256
1065 (base32
1066 "0mf363l7md4193cgrpb6hkhmsgnlnrx44q1bzw3zq0bmjrcg3fj7"))
1067 (snippet
1068 #~(begin (use-modules (guix build utils))
1069 (delete-file-recursively "vendor")))))
1070 (build-system go-build-system)
1071 (arguments
1072 (list
1073 #:install-source? #f
1074 #:import-path "github.com/go-delve/delve/cmd/dlv"
1075 #:unpack-path "github.com/go-delve/delve"
1076 ;; [1] Want mod github.com/go-delve/delve and dep
1077 ;; github.com/google/go-dap in the output.
1078 ;; [2] Output of go tool nm contains MethodByName.
1079 #:test-flags #~(list "-skip" "TestVersion|TestDeadcodeEliminated")))
1080 (native-inputs
1081 (list go-github-com-cilium-ebpf
1082 go-github-com-cosiner-argv
1083 go-github-com-creack-pty
1084 go-github-com-derekparker-trie-v3
1085 go-github-com-go-delve-liner
1086 go-github-com-google-go-dap
1087 go-github-com-hashicorp-golang-lru
1088 go-github-com-mattn-go-colorable
1089 go-github-com-mattn-go-isatty
1090 go-github-com-spf13-cobra
1091 go-github-com-spf13-pflag
1092 go-go-starlark-net
1093 go-golang-org-x-arch
1094 go-golang-org-x-sys
1095 go-golang-org-x-telemetry
1096 go-golang-org-x-tools
1097 go-gopkg-in-yaml-v3))
1098 (home-page "https://github.com/go-delve/delve")
1099 (synopsis "Debugger for the Go programming language")
1100 (description "Delve is a debugger for the Go programming language.")
1101 (license license:expat)))
1102
1103(define-public fandango
1104 (package
1105 (name "fandango")
1106 (version "1.1.1")
1107 (source
1108 (origin
1109 (method git-fetch)
1110 (uri (git-reference
1111 (url "https://github.com/fandango-fuzzer/fandango")
1112 (commit (string-append "v" version))))
1113 (file-name (git-file-name name version))
1114 (sha256 (base32 "0ppx8r9isc772y0ahpgl8g5b3yxka7ffqzlcsa920aib5nj39lrg"))
1115 (modules '((guix build utils)
1116 (ice-9 ftw)
1117 (srfi srfi-26)))
1118 (snippet
1119 #~(begin
1120 (define (delete-all-but directory . preserve)
1121 (with-directory-excursion directory
1122 (let* ((pred (negate (cut member <>
1123 (cons* "." ".." preserve))))
1124 (items (scandir "." pred)))
1125 (for-each (cut delete-file-recursively <>) items))))
1126 (substitute* "pyproject.toml"
1127 ;; Python is linked with GNU readline on all Guix targets.
1128 ((".*gnureadline.*") "")
1129 ;; TODO: update antlr4.
1130 (("antlr4-python3-runtime>=4.13") "antlr4-python3-runtime")
1131 ;; PYTHONHASHSEED is set by the build system.
1132 ((" --pythonhashseed=1") ""))
1133 (delete-all-but "src/fandango/language/cpp_parser"
1134 "FandangoLexerBase.cpp"
1135 "FandangoLexerBase.h")
1136 (delete-all-but "src/fandango/language/parser"
1137 "FandangoLexerBase.py")))))
1138 (build-system pyproject-build-system)
1139 (arguments
1140 (list
1141 #:test-flags
1142 #~(list "--numprocesses" (number->string (parallel-job-count))
1143 ;; Skip expensive tests.
1144 "-k" "not test_cli_max_2 and not test_soft_value")
1145 #:phases
1146 #~(modify-phases %standard-phases
1147 (add-after 'unpack 'generate-parser
1148 (lambda* (#:key inputs #:allow-other-keys)
1149 (substitute* "CMakeLists.txt"
1150 (("(target_link_libraries\\(.*)(\\))" all left right)
1151 (simple-format #f "~a ~a ~a"
1152 left
1153 (search-input-file inputs "lib/libantlr4-runtime.so")
1154 right))
1155 (("\\$\\{CPP_PARSER_DIR\\}/antlr4-cpp-runtime")
1156 (search-input-directory inputs "include/antlr4-runtime")))
1157 (substitute* "Makefile"
1158 ;; Avoid running black.
1159 ((".*\\$\\(BLACK\\).*") ""))
1160 (invoke "make" "parser")))
1161 (add-before 'check 'set-paths
1162 (lambda* (#:key inputs #:allow-other-keys)
1163 (substitute* "evaluation/scriptsizec/scriptsizec_evaluation.py"
1164 (("from tccbox import .*")
1165 "")
1166 (("tcc_bin_path\\(\\)")
1167 (simple-format #f "~s"
1168 (search-input-file inputs "bin/tcc")))))))))
1169 (native-inputs (list antlr4
1170 cmake-minimal
1171 clang ;for tests
1172 python-aiosmtpd ;for tests
1173 python-dateutil ;for tests
1174 python-docutils ;for tests
1175 python-faker ;for tests
1176 python-pytest
1177 python-pytest-benchmark
1178 python-pytest-timeout
1179 python-pytest-xdist
1180 python-scikit-build-core
1181 python-speedy-antlr-tool
1182 python-setuptools
1183 tcc)) ;for tests
1184 (inputs (list cpp-antlr4-runtime
1185 python-antlr4-runtime
1186 python-astar
1187 python-ansi-styles
1188 python-beartype
1189 python-cachedir-tag
1190 python-dill
1191 python-exrex
1192 python-lxml
1193 python-py010parser
1194 python-regex
1195 python-tdigest
1196 python-thefuzz
1197 python-xdg-base-dirs))
1198 (home-page "https://fandango-fuzzer.github.io")
1199 (synopsis "Language-based fuzzer")
1200 (description
1201 "Fandango is a generator of inputs and interactions for software testing.
1202Given the specification of a program's input or interaction language,
1203Fandango generates myriads of valid sample inputs for testing.
1204The specification language combines a grammar with constraints
1205written in Python. Minimization or maximization soft constraints
1206and input distributions can also be expressed in Fandango.")
1207 (license license:eupl1.2)))
1208
1209(define-public fiu
1210 (package
1211 (name "fiu")
1212 (version "1.2")
1213 (source
1214 (origin
1215 (method url-fetch)
1216 (uri (string-append "https://blitiri.com.ar/p/libfiu/files/"
1217 version "/libfiu-" version ".tar.gz"))
1218 (sha256
1219 (base32 "0x4ncvi6sv22rqi9x61byybpmch0z1zvpr6p48axkk890ysv6fim"))))
1220 (build-system gnu-build-system)
1221 (arguments
1222 (list #:make-flags #~(list (string-append "PREFIX=" #$output)
1223 (string-append "CC=" #$(cc-for-target))
1224 (string-append "LDFLAGS=-Wl,-rpath="
1225 #$output "/lib"))
1226 #:phases #~(modify-phases %standard-phases
1227 (delete 'configure)
1228 (add-before 'check 'set-env
1229 ;; Shorten paths to sockets in tests.
1230 (lambda _ (setenv "TMPDIR" "/tmp"))))
1231 #:test-target "test"))
1232 (native-inputs (list python python-setuptools)) ; for tests
1233 (synopsis "Fault injector in userspace")
1234 (description "Fiu provides CLI utilities and a C library
1235to mark points of failure inside your code
1236and to enable/disable the failure of those points.")
1237 (home-page "https://blitiri.com.ar/p/libfiu")
1238 (license license:public-domain)))
1239
1240(define-public python-fiu
1241 (package
1242 (name "python-fiu")
1243 (version "1.2")
1244 (source (package-source fiu))
1245 (build-system pyproject-build-system)
1246 (arguments
1247 (list #:phases #~(modify-phases %standard-phases
1248 (add-after 'unpack 'enter-python-dir
1249 (lambda _ (chdir "bindings/python")))
1250 (add-before 'build 'set-env
1251 (lambda* (#:key inputs #:allow-other-keys)
1252 (setenv "PLIBPATH"
1253 (string-append (assoc-ref inputs "fiu")
1254 "/lib")))))
1255 #:tests? #f)) ; tests run in fiu
1256 (native-inputs (list python-setuptools python-wheel))
1257 (inputs (list fiu))
1258 (synopsis "Python binding for fiu (fault injection in userspace)")
1259 (description "This package includes two Python modules:
1260@enumerate
1261@item @code{fiu} is a wrapper for @code{libfiu}, the fault injection C library.
1262@item @code{fiu_ctrl} provide an easy way run a command
1263with @code{libfiu} enabled, and controlling the failure points dynamically.
1264@end enumerate")
1265 (home-page (package-home-page fiu))
1266 (license (package-license fiu))))