projects/guix·blob java-team · refs

1270 lines · 53.6 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-13
314 llvm-13
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 "d4a7b70af4d387a9a57c743ef1827b2347aa7d7c")
331 (revision "3"))
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 "1h1z1zfrcv2mns4vkfb4hmjlcci1m4ba51p5hml5pzmvn9dmfkj7"))))
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 (add-after 'unpack 'set-addr2line-path
365 (lambda* (#:key inputs #:allow-other-keys)
366 (substitute* "accel/tcg/tcg-runtime.c"
367 (("\"addr2line")
368 (string-append
369 "\"" (search-input-file inputs "bin/addr2line"))))))
370 (delete 'patch-embedded-shebangs)
371 (delete 'fix-optionrom-makefile)
372 (delete 'disable-unusable-tests)
373 (replace 'configure
374 (lambda* (#:key configure-flags #:allow-other-keys)
375 ;; The `configure' script doesn't understand some of the
376 ;; GNU options. Thus, add a new phase that's compatible.
377 (setenv "SHELL" (which "bash"))
378 ;; The binaries need to be linked against -lrt.
379 (setenv "LDFLAGS" "-lrt")
380 (apply invoke
381 "./configure"
382 (string-append "--cc=" #$(cc-for-target))
383 ;; Some architectures insist on using HOST_CC
384 (string-append "--host-cc=" #$(cc-for-target))
385 "--disable-debug-info" ; save build space
386 (string-append "--prefix=" #$output)
387 (string-append "--sysconfdir=/etc")
388 configure-flags)))
389 (add-after 'install 'install-qasan-header
390 (lambda _
391 (install-file "qemuafl/qasan.h"
392 (string-append #$output "/include"))))
393 (delete 'delete-firmwares)
394 #$@(if (target-riscv64?)
395 '((replace 'disable-some-tests
396 (lambda _
397 ;; qemu.qmp.QMPConnectError:
398 ;; Unexpected empty reply from server
399 (delete-file "tests/qemu-iotests/040")
400 (delete-file "tests/qemu-iotests/041")
401 (delete-file "tests/qemu-iotests/256")
402 ;; No 'PCI' bus found for device 'virtio-scsi-pci'
403 (delete-file "tests/qemu-iotests/127")
404 (delete-file "tests/qemu-iotests/267"))))
405 '())))))
406 (inputs (modify-inputs inputs
407 (append gcc)
408 (delete "dtc")))
409 (home-page "https://github.com/AFLplusplus/qemuafl")
410 (synopsis "QEMU for AFL++")))))
411
412(define-public aflplusplus
413 ;; TODO: Merge the duplicate application of modify-phases,
414 ;; due to the previous inheritance from american-fuzzy-lop.
415 (let* ((machine (match (or (%current-target-system)
416 (%current-system))
417 ("x86_64-linux" "x86_64")
418 ("i686-linux" "i386")
419 ("aarch64-linux" "aarch64")
420 ("armhf-linux" "arm")
421 ("mips64el-linux" "mips64el")
422 ("powerpc-linux" "ppc")
423 ;; Prevent errors when querying this package on unsupported
424 ;; platforms, e.g. when running "guix package --search="
425 (_ "UNSUPPORTED")))
426 (arguments-american-fuzzy-lop
427 `(#:make-flags '()
428 #:phases (modify-phases %standard-phases
429 (add-after 'unpack 'make-git-checkout-writable
430 (lambda _
431 (for-each make-file-writable (find-files "."))
432 #t))
433 (delete 'configure)
434 ,@(if (string=? (%current-system) (or "x86_64-linux"
435 "i686-linux"))
436 '()
437 '((add-before 'build 'set-afl-flag
438 (lambda _ (setenv "AFL_NO_X86" "1") #t))
439 (add-after 'install 'remove-x86-programs
440 (lambda* (#:key outputs #:allow-other-keys)
441 (let* ((out (assoc-ref outputs "out"))
442 (bin (string-append out "/bin/")))
443 (delete-file (string-append bin "afl-gcc"))
444 (delete-file (string-append bin "afl-g++"))
445 (delete-file (string-append bin "afl-clang"))
446 (delete-file (string-append bin "afl-clang++")))
447 #t))))
448 (add-after
449 ;; TODO: Build and install the afl-llvm tool.
450 'install 'install-qemu
451 (lambda* (#:key inputs outputs #:allow-other-keys)
452 (let ((qemu (assoc-ref inputs "qemu"))
453 (out (assoc-ref outputs "out")))
454 (symlink (string-append qemu "/bin/qemu-" ,machine)
455 (string-append out "/bin/afl-qemu-trace"))
456 #t)))
457 (delete 'check))))) ; tests are run during 'install phase
458 (package
459 (name "aflplusplus")
460 (version "5.02c")
461 (source (origin
462 (method git-fetch)
463 (uri (git-reference
464 (url "https://github.com/AFLplusplus/AFLplusplus")
465 (commit (string-append "v" version))))
466 (file-name (git-file-name name version))
467 (sha256
468 (base32
469 "14wnydymr19qwyc1dq1klm0ify37rvv69msh86hcw588g4gh3hbq"))))
470 (build-system gnu-build-system)
471 (arguments
472 (substitute-keyword-arguments arguments-american-fuzzy-lop
473 ((#:make-flags _ ''())
474 #~(list (string-append "PREFIX=" #$output)
475 (string-append "DOC_PATH=" #$output "/share/doc/"
476 #$(package-name this-package) "-"
477 #$(package-version this-package))
478 (string-append "CC=" #$(cc-for-target))
479 (string-append "CXX=" #$(cxx-for-target))
480 (string-append "LLVM_CONFIG="
481 (search-input-file %build-inputs "/bin/llvm-config"))
482 ;; Need to use LLD with the llvm_mode, because LTO in
483 ;; combination with binutils gold is currently broken.
484 ;;
485 ;; See: https://codeberg.org/guix/guix/issues/3307
486 (string-append "AFL_REAL_LD="
487 (search-input-file %build-inputs "/bin/ld.lld"))
488 (string-append "CLANG_BIN="
489 (search-input-file %build-inputs "/bin/clang"))
490 (string-append "CLANGPP_BIN="
491 (search-input-file %build-inputs "/bin/clang++"))
492 "LLVM_LTO=1"
493 "AFL_CLANG_FLTO=-flto=full"))
494 ((#:phases phases '%standard-phases)
495 #~(modify-phases #$phases
496 ;; Ensure that the build fails early if LLVM support fails to
497 ;; compile, makes the build log much easier to understand.
498 (add-after 'unpack 'fatal-llvm-failure
499 (lambda* (#:key inputs #:allow-other-keys)
500 (substitute* "GNUmakefile"
501 (("-\\$\\(MAKE\\) ..* -f GNUmakefile.llvm$" all)
502 (substring all 1))))) ; remove the leading '-'
503 ;; GNUmakefile.llvm tries to find clang/clang++ relative to the
504 ;; --bindir reported by llvm-config, but since llvm and clang
505 ;; have different store paths on Guix, this doesn't work here.
506 (add-after 'unpack 'patch-clang-path
507 (lambda* (#:key inputs #:allow-other-keys)
508 (substitute* "GNUmakefile.llvm"
509 (("^CC *= .*$")
510 (string-append
511 "override CC = "
512 (search-input-file inputs "/bin/clang")
513 "\n"))
514 (("^CXX *= .*$")
515 (string-append
516 "override CXX = "
517 (search-input-file inputs "/bin/clang++")
518 "\n")))))
519 ;; For GCC plugins.
520 (add-after 'unpack 'patch-gcc-path
521 (lambda* (#:key inputs #:allow-other-keys)
522 (substitute* "src/afl-cc.c"
523 (("alt_cc = \"gcc\";")
524 (format #f "alt_cc = \"~a\";"
525 (search-input-file inputs "bin/gcc")))
526 (("alt_cxx = \"g\\+\\+\";")
527 (format #f "alt_cxx = \"~a\";"
528 (search-input-file inputs "bin/g++"))))))
529 (add-after 'build 'build-qasan
530 (lambda* (#:key parallel-build? make-flags #:allow-other-keys)
531 (apply invoke "make" "-C" "qemu_mode/libqasan"
532 "-j" (number->string (if parallel-build?
533 (parallel-job-count)
534 "1"))
535 make-flags)))
536 ;; afl-qemu-trace is a symbolic link to QEMU's binary.
537 ;; Substituting its source code with AFL++'s output path
538 ;; would result in a dependency cycle.
539 (add-after 'install-qemu 'wrap-qemu
540 (lambda _
541 (wrap-program (string-append #$output "/bin/afl-qemu-trace")
542 `("AFL_PATH" = (,(string-append #$output "/lib/afl"))))))))))
543 (inputs (list llvm-20 clang-20 lld-20 gcc gmp python qemu-for-aflplusplus))
544 (native-inputs (list gcc))
545 (home-page "https://aflplus.plus/")
546 (synopsis "Security-oriented fuzzer")
547 (description
548 "AFLplusplus is a security-oriented fuzzer that employs a novel type of
549compile-time instrumentation and genetic algorithms to automatically discover
550clean, interesting test cases that trigger new internal states in the targeted
551binary. This substantially improves the functional coverage for the fuzzed
552code. The compact synthesized corpora produced by the tool are also useful for
553seeding other, more labor- or resource-intensive testing regimes down the road.
554It is a fork of American Fuzzy Lop fuzzer and features:
555@itemize
556@item A more recent qemu version.
557@item More algorithms like collision-free coverage, enhanced laf-intel &
558redqueen, AFLfast++ power schedules, MOpt mutators, unicorn_mode, etc.
559@end itemize")
560 (license license:asl2.0))))
561
562(define-public backward-cpp
563 (package
564 (name "backward-cpp")
565 (version "1.6")
566 (source (origin
567 (method git-fetch)
568 (uri (git-reference
569 (url "https://github.com/bombela/backward-cpp")
570 (commit (string-append "v" version))))
571 (file-name (git-file-name name version))
572 (sha256
573 (base32
574 "1b2h03iwfhcsg8i4f125mlrjf8l1y7qsr2gsbkv0z03i067lykns"))))
575 (arguments
576 (list
577 #:configure-flags
578 #~(list "-DBACKWARD_SHARED=ON")))
579 (build-system cmake-build-system)
580 (inputs
581 (list libiberty zlib))
582 (synopsis "Stack trace pretty printer for C++")
583 (description
584 "Backward-cpp is a stack trace pretty printer for C++.
585It can print annotated stack traces using debug info in the executable.")
586 (home-page "https://github.com/bombela/backward-cpp")
587 (license license:expat)))
588
589(define-public stress-make
590 (let ((commit "97815bed8060de33952475b3498767c91f59ffd9")
591 (revision "2")) ;No official source distribution
592 (package
593 (name "stress-make")
594 (version (git-version "1.0" revision commit))
595 (source
596 (origin
597 (method git-fetch)
598 (uri (git-reference
599 (url "https://github.com/lanl/stress-make")
600 (commit commit)))
601 (file-name (git-file-name name version))
602 (sha256
603 (base32
604 "0k55cy7x0hlc6rgpascl6ibhcfxaash3p9r9r8kwvbm3zag1rmac"))))
605 (build-system gnu-build-system)
606 (native-inputs
607 (list autoconf automake go))
608 (inputs
609 `(("make-source" ,(package-source gnu-make))))
610 (arguments
611 ;; stress-make's configure script insists on having a tarball and does
612 ;; not accept a directory name instead. To let the gnu-build-system's
613 ;; patch-* phases work properly, we unpack the source first, then
614 ;; repack before the configure phase.
615 (let ((make-dir (string-append "make-" (package-version gnu-make))))
616 `(#:configure-flags '("--with-make-tar=./make.tar.xz"
617 "make_cv_sys_gnu_glob=yes")
618 #:phases
619 (modify-phases %standard-phases
620 (add-after 'unpack 'unpack-make
621 (lambda* (#:key inputs #:allow-other-keys)
622 (invoke "tar" "xf" (assoc-ref inputs "make-source"))))
623 (add-after 'unpack-make 'set-default-shell
624 (lambda _
625 ;; Taken mostly directly from (@ (gnu packages base) gnu-make)
626 (substitute* (string-append ,make-dir "/src/job.c")
627 (("default_shell = .*$")
628 (format #f "default_shell = \"~a\";\n"
629 (which "sh"))))))
630 (add-before 'configure 'repack-make
631 (lambda _
632 (invoke "tar" "cJf" "./make.tar.xz" ,make-dir)))
633 (add-before 'build 'setup-go
634 ;; The Go cache is required starting in Go 1.12, and it needs
635 ;; to be writable.
636 (lambda _ (setenv "GOCACHE" "/tmp/go-cache") #t))))))
637 (home-page "https://github.com/lanl/stress-make")
638 (synopsis "Expose race conditions in Makefiles")
639 (description
640 "Stress Make is a customized GNU Make that explicitly manages the order
641in which concurrent jobs are run to provoke erroneous behavior into becoming
642manifest. It can run jobs in the order in which they're launched, in backwards
643order, or in random order. The thought is that if code builds correctly with
644Stress Make, then it is likely that the @code{Makefile} contains no race
645conditions.")
646 ;; stress-make wrapper is under BSD-3-modifications-must-be-indicated,
647 ;; and patched GNU Make is under its own license.
648 (license (list (license:non-copyleft "LICENSE.md")
649 license:gpl3+)))))
650
651(define-public zzuf
652 (package
653 (name "zzuf")
654 (version "0.15")
655 (source
656 (origin
657 (method url-fetch)
658 (uri (string-append
659 "https://github.com/samhocevar/zzuf/releases/download/v"
660 version "/" name "-" version ".tar.gz"))
661 (file-name (string-append name "-" version ".tar.gz"))
662 (sha256
663 (base32
664 "1mpzjaksc2qg2hzqflf39pl06p53qam2dn3hkhkcv6p00d2n4kx3"))))
665 (build-system gnu-build-system)
666 (native-inputs (list gcc-13))
667 (home-page "https://github.com/samhocevar/zzuf")
668 (synopsis "Transparent application input fuzzer")
669 (description "Zzuf is a transparent application input fuzzer. It works by
670intercepting file operations and changing random bits in the program's
671input. Zzuf's behaviour is deterministic, making it easy to reproduce bugs.")
672 (license license:wtfpl2)))
673
674(define-public scanmem
675 (package
676 (name "scanmem")
677 (version "0.17")
678 (source
679 (origin
680 (method git-fetch)
681 (uri (git-reference
682 (url "https://github.com/scanmem/scanmem")
683 (commit (string-append "v" version))))
684 (file-name (git-file-name name version))
685 (sha256
686 (base32
687 "17p8sh0rj8yqz36ria5bp48c8523zzw3y9g8sbm2jwq7sc27i7s9"))))
688 (build-system gnu-build-system)
689 (arguments
690 `(#:configure-flags '("--enable-gui")
691 #:phases
692 (modify-phases %standard-phases
693 (add-before 'configure 'hardcode-python
694 (lambda* (#:key inputs outputs #:allow-other-keys)
695 (substitute* "gui/GameConqueror.py"
696 (("/usr/bin/env python")
697 (search-input-file inputs "/bin/python")))))
698 (add-after 'install 'wrap-gameconqueror
699 (lambda* (#:key inputs outputs #:allow-other-keys)
700 (let ((out (assoc-ref outputs "out"))
701 (gi-typelib-path (getenv "GI_TYPELIB_PATH"))
702 (python-path (getenv "GUIX_PYTHONPATH")))
703 (wrap-program (string-append out "/share/gameconqueror/GameConqueror.py")
704 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))
705 `("GUIX_PYTHONPATH" ":" prefix (,python-path))))
706 #t)))))
707 (native-inputs
708 (list libtool
709 python-wrapper
710 gobject-introspection
711 gtk+
712 intltool
713 automake
714 autoconf))
715 (inputs
716 (list bash-minimal
717 readline))
718 (propagated-inputs
719 (list python-pygobject))
720 (home-page "https://github.com/scanmem/scanmem")
721 (synopsis "Memory scanner")
722 (description "Scanmem is a debugging utility designed to isolate the
723address of an arbitrary variable in an executing process. Scanmem simply
724needs to be told the pid of the process and the value of the variable at
725several different times. After several scans of the process, scanmem isolates
726the position of the variable and allows you to modify its value.")
727 ;; The library is covered by LGPLv3 or later; the application is covered
728 ;; by GPLv3 or later.
729 (license (list license:lgpl3+ license:gpl3+))))
730
731(define-public remake
732 (package (inherit gnu-make)
733 (name "remake")
734 (version "4.3-1.6")
735 (source (origin
736 (method url-fetch)
737 (uri (let ((upstream-version
738 (match (string-split version #\-)
739 ((ver sub) (string-append ver "%2Bdbg-" sub)))))
740 (string-append "mirror://sourceforge/bashdb/"
741 "remake/" upstream-version "/"
742 "remake-" upstream-version ".tar.gz")))
743 (file-name (string-append "remake-" version ".tar.gz"))
744 (sha256
745 (base32
746 "11vvch8bi0yhjfz7gn92b3xmmm0cgi3qfiyhbnnj89frkhbwd87n"))
747 (patches (search-patches "remake-impure-dirs.patch"))))
748 (inputs
749 (modify-inputs inputs
750 (prepend readline)))
751 (home-page "https://bashdb.sourceforge.net/remake/")
752 (description "Remake is an enhanced version of GNU Make that adds improved
753error reporting, better tracing, profiling, and a debugger.")
754 (license license:gpl3+)))
755
756(define-public rr
757 ;; Use a newer commit, which contains unreleased fixes to the
758 ;; zen-pmu-workaround.c kernel module, among others.
759 (let ((commit "7fe1e367c2b4e0df7647e020c20d66827badfad3")
760 (revision "0"))
761 (package
762 (name "rr")
763 (version (git-version "5.9.0" revision commit))
764 (source (origin
765 (method git-fetch)
766 (uri (git-reference
767 (url "https://github.com/mozilla/rr")
768 (commit commit)))
769 (sha256
770 (base32
771 "1zgxk4blwwq0bigi0g8dafgl330aid3kw9ym426825flc3pp1c3m"))
772 (file-name (git-file-name name version))))
773 (build-system cmake-build-system)
774 (arguments
775 `(#:configure-flags
776 ;; The 'rr_exec_stub' is a static binary, which leads CMake to fail
777 ;; with ‘file RPATH_CHANGE could not write new RPATH: ...’.
778 ;; Clear CMAKE_INSTALL_RPATH to avoid that problem.
779 (list "-DCMAKE_INSTALL_RPATH="
780 ;; Satisfy the ‘validate-runpath’ phase. This isn't a direct
781 ;; consequence of clearing CMAKE_INSTALL_RPATH.
782 (string-append "-DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath="
783 (assoc-ref %build-inputs "capnproto")
784 "/lib,-rpath=" (assoc-ref %build-inputs "zlib")
785 "/lib,-rpath=" (assoc-ref %build-inputs "zstd")
786 "/lib")
787 ,@(if (and (not (%current-target-system))
788 (member (%current-system)
789 '("x86_64-linux" "aarch64-linux")))
790 ;; The toolchain doesn't support '-m32'.
791 '("-Ddisable32bit=ON")
792 '()))
793
794 ;; XXX: Most tests fail with:
795 ;;
796 ;; rr needs /proc/sys/kernel/perf_event_paranoid <= 1, but it is 2.
797 ;;
798 ;; This setting cannot be changed from the build environment, so skip
799 ;; the tests.
800 #:tests? #f
801
802 #:phases (modify-phases %standard-phases
803 (add-before 'check 'set-home
804 (lambda _
805 ;; Some tests expect 'HOME' to be set.
806 (setenv "HOME" (getcwd)))))))
807 (native-inputs
808 (list lldb pkg-config which))
809 (inputs
810 (list gdb
811 capnproto
812 python
813 python-pexpect
814 zlib
815 `(,zstd "lib")))
816
817 ;; List of supported systems according to 'src/preload/raw_syscall.S'.
818 (supported-systems '("x86_64-linux" "i686-linux" "aarch64-linux"))
819
820 (home-page "https://rr-project.org/")
821 (synopsis "Record and replay debugging framework")
822 (description
823 "rr is a lightweight tool for recording, replaying and debugging
824execution of applications (trees of processes and threads). Debugging extends
825GDB with very efficient reverse-execution, which in combination with standard
826GDB/x86 features like hardware data watchpoints, makes debugging much more
827fun.")
828 (license license:expat))))
829
830(define-public rr-zen-pmu-workaround
831 (package
832 (name "rr-zen-pmu-workaround")
833 (version (package-version rr))
834 (source (package-source rr))
835 (build-system linux-module-build-system)
836 (arguments
837 (list
838 #:tests? #f ;no tests
839 #:phases
840 #~(modify-phases %standard-phases
841 (add-after 'unpack 'cd
842 (lambda _
843 (chdir "third-party/zen-pmu-workaround"))))))
844 (home-page "https://github.com/rr-debugger/rr/wiki/Zen")
845 (synopsis "AMD Zen workaround kernel module for rr")
846 (description "This is a Linux kernel module that implements
847 workarounds needed for using the @command{rr} debugger with AMD Zen
848@acronym{CPU, Central Processing Unit}.")
849 (license license:gpl2))) ;GPLv2 only, like the kernel
850
851(define-public libbacktrace
852 ;; There are no releases nor tags.
853 (let ((revision "2")
854 (commit "cdb64b688dda93bbbacbc2b1ccf50ce9329d4748"))
855 (package
856 (name "libbacktrace")
857 (version (git-version "1.0" revision commit))
858 (source (origin
859 (method git-fetch)
860 (uri (git-reference
861 (url "https://github.com/ianlancetaylor/libbacktrace")
862 (commit commit)))
863 (file-name (git-file-name name version))
864 (sha256
865 (base32
866 "0iwd41pgr2nxlmghqdfwfwxac27jbqxwxp07jihhq85a8s3igjgr"))))
867 (build-system gnu-build-system)
868 (arguments
869 `(#:parallel-tests? #f ;spurious failures when testing in parallel
870 #:make-flags '("CFLAGS=-fPIC")))
871 (home-page "https://github.com/ianlancetaylor/libbacktrace")
872 (synopsis "C library for producing symbolic backtraces")
873 (description "The @code{libbacktrace} library can be linked into a C/C++
874program to produce symbolic backtraces.")
875 (license license:bsd-3))))
876
877(define-public libleak
878 (package
879 (name "libleak")
880 (version "0.3.6")
881 (source (origin
882 (method git-fetch)
883 (uri (git-reference
884 (url "https://github.com/WuBingzheng/libleak")
885 (commit (string-append "v" version))))
886 (file-name (git-file-name name version))
887 (sha256
888 (base32
889 "1p6x20mm0dym2qn10d6cvwmh71m93xwcd319g94zkv88hj5q17n6"))))
890 (build-system gnu-build-system)
891 (arguments
892 `(#:tests? #f ;no test suite
893 #:parallel-build? #f ;jobserver unavailable
894 #:phases (modify-phases %standard-phases
895 (add-after 'unpack 'unbundle-libwuya
896 (lambda _
897 (substitute* "Makefile"
898 ((".*make -C libwuya.*") ""))
899 #t))
900 (add-before 'build 'set-CC
901 (lambda _
902 (setenv "CC" "gcc")
903 #t))
904 (delete 'configure) ;no configure script
905 (replace 'install
906 (lambda* (#:key outputs #:allow-other-keys)
907 (let* ((out (assoc-ref outputs "out")))
908 (install-file "libleak.so" (string-append out "/lib"))
909 #t))))))
910 (inputs (list libbacktrace libwuya))
911 (home-page "https://github.com/WuBingzheng/libleak")
912 (synopsis "Memory leaks detection tool")
913 (description "The libleak tool detects memory leaks by hooking memory
914functions such as @code{malloc}. It comes as a shared object to be pre-loaded
915via @code{LD_PRELOAD} when launching the application. It prints the full call
916stack at suspicious memory leak points. Modifying or recompiling the target
917program is not required, and the detection can be enabled or disabled while
918the target application is running. The overhead incurred by libleak is
919smaller than that of other tools such as Valgrind, and it aims to be easier to
920use than similar tools like @command{mtrace}.")
921 (license license:gpl2+)))
922
923(define-public cgdb
924 (package
925 (name "cgdb")
926 (version "0.8.0")
927 (source
928 (origin
929 (method url-fetch)
930 (uri (string-append "https://cgdb.me/files/cgdb-" version ".tar.gz"))
931 (sha256
932 (base32 "1w8ib2vg3pg68d9hh97fw5042c73i9nqavdddc87n9bpscjbaf0d"))))
933 (build-system gnu-build-system)
934 (inputs
935 (list bash-minimal ncurses readline gdb))
936 (native-inputs
937 (list flex texinfo))
938 (arguments
939 `(#:configure-flags
940 (list
941 (string-append "ac_cv_rl_version=" ,(package-version readline))
942 "ac_cv_file__dev_ptmx=no"
943 "ac_cv_file__proc_self_status=no"
944 "ac_cv_func_setpgrp_void=no")
945 #:phases
946 (modify-phases %standard-phases
947 (add-after 'unpack 'fix-paths
948 (lambda* (#:key inputs #:allow-other-keys)
949 (let ((gdb (search-input-file inputs "bin/gdb"))
950 (sh (search-input-file inputs "bin/sh")))
951 (substitute* "lib/util/fork_util.cpp"
952 (("GDB = \"gdb\"") (string-append "GDB = \"" gdb "\"")))
953 (substitute* "cgdb/cgdb.cpp" (("/bin/sh") sh))))))))
954 (home-page "https://cgdb.github.io")
955 (synopsis "Console front-end to the GNU debugger")
956 (description
957 "@code{cgdb} is a lightweight curses (terminal-based) interface to the
958GNU Debugger (GDB). In addition to the standard gdb console, cgdb provides
959a split screen view that displays the source code as it executes. The
960keyboard interface is modeled after vim, so vim users should feel at home
961using cgdb.")
962 (license license:gpl2+)))
963
964(define-public mspdebug
965 ;; Last official release was 24 July 2017
966 (let ((commit "4c4d94e43bc4a18ecf82070ff81cd38dd5641e3b")
967 (revision "0"))
968 (package
969 (name "mspdebug")
970 (version (git-version "0.25" revision commit))
971 (source (origin
972 (method git-fetch)
973 (uri (git-reference
974 (url "https://github.com/dlbeer/mspdebug")
975 (commit commit)))
976 (file-name (git-file-name name version))
977 (sha256
978 (base32 "1lgw1dsc1aglyja610ichadvgs5b0df3wlarinczb0ykf431gjln"))))
979 (build-system gnu-build-system)
980 (arguments
981 `(#:tests? #f ; no test suite
982 #:phases
983 (modify-phases %standard-phases
984 (delete 'configure)) ; no configure script
985 #:make-flags
986 (list (string-append "CC=" ,(cc-for-target))
987 "INSTALL=install"
988 (string-append "PREFIX=" %output))))
989 (inputs
990 (list libusb-compat readline))
991 (synopsis "Debugging tool for MSP430 MCUs")
992 (description "MspDebug supports FET430UIF, eZ430, RF2500 and Olimex
993MSP430-JTAG-TINY programmers, as well as many other compatible
994devices. It can be used as a proxy for gdb or as an independent
995debugger with support for programming, disassembly and reverse
996engineering.")
997 (home-page "https://github.com/dlbeer/mspdebug")
998 (license license:gpl2+))))
999
1000(define-public seer-gdb
1001 (package
1002 (name "seer-gdb")
1003 (version "2.7")
1004 (source
1005 (origin
1006 (method git-fetch)
1007 (uri (git-reference
1008 (url "https://github.com/epasveer/seer")
1009 (commit (string-append "v" version))))
1010 (file-name (git-file-name name version))
1011 (sha256
1012 (base32 "1szfqybqr5z982vian4f0hpsagiqapzys3axwibyjyg5whjswva1"))))
1013 (build-system qt-build-system)
1014 (arguments
1015 (list
1016 #:tests? #f ;tests are strangely manual
1017 #:phases
1018 #~(modify-phases %standard-phases
1019 (add-after 'unpack 'chdir
1020 (lambda _
1021 (chdir "src"))))))
1022 (inputs
1023 (list gdb qtbase qtcharts qtsvg qtwayland))
1024 (synopsis "GUI frontend for GDB")
1025 (description "This package provides a frontend to GDB, the GNU debugger.")
1026 (home-page "https://github.com/epasveer/seer")
1027 ;; Note: Some icons in src/resources are creative commons 3.0 and/or 4.0.
1028 (license license:gpl3+)))
1029
1030(define-public ddd
1031 (package
1032 (name "ddd")
1033 (version "3.4.1")
1034 (source (origin
1035 (method url-fetch)
1036 (uri (string-append "mirror://gnu/ddd/ddd-" version ".tar.gz"))
1037 (patches (search-patches "ddd-build.patch"))
1038 (sha256
1039 (base32
1040 "12gfyh139rim49m56lxm36ckdyiiz4n3la3y6ik1aqgrqfk1fxdq"))))
1041 (build-system gnu-build-system)
1042 (arguments
1043 (list #:tests? #f ;tests require manual intervention
1044 #:configure-flags
1045 #~(list (string-append "--with-freetype-includes="
1046 #$(this-package-input "freetype") "/include/freetype2"))))
1047 (native-inputs
1048 (list pkg-config bison flex perl))
1049 (inputs
1050 (list libxaw libxft freetype motif ncurses gdb))
1051 (synopsis "Graphical front-end for GDB and other debuggers")
1052 (description "GNU DDD, the Data Display Debugger, is a graphical front-end
1053for command-line debuggers. Many back-end debuggers are supported, notably
1054the GNU debugger, GDB. In addition to usual debugging features such as
1055viewing the source files, DDD has additional graphical, interactive features
1056to aid in debugging.")
1057 (home-page "https://www.gnu.org/software/ddd/")
1058 (license license:gpl3+)))
1059
1060(define-public delve
1061 (package
1062 (name "delve")
1063 (version "1.27.0")
1064 (source
1065 (origin
1066 (method git-fetch)
1067 (uri (git-reference
1068 (url "https://github.com/go-delve/delve")
1069 (commit (string-append "v" version))))
1070 (file-name (git-file-name name version))
1071 (sha256
1072 (base32 "0xdawy3vlr74zna1dhqkrdil5dyrfn13d24clxycsrsrx65z5cl3"))
1073 (snippet
1074 #~(begin (use-modules (guix build utils))
1075 (delete-file-recursively "vendor")))))
1076 (build-system go-build-system)
1077 (arguments
1078 (list
1079 #:install-source? #f
1080 #:import-path "github.com/go-delve/delve/cmd/dlv"
1081 #:unpack-path "github.com/go-delve/delve"
1082 ;; [1] Want mod github.com/go-delve/delve and dep
1083 ;; github.com/google/go-dap in the output.
1084 ;; [2] Output of go tool nm contains MethodByName.
1085 #:test-flags #~(list "-skip" "TestVersion|TestDeadcodeEliminated")))
1086 (native-inputs
1087 (list go-github-com-cilium-ebpf
1088 go-github-com-cosiner-argv
1089 go-github-com-creack-pty
1090 go-github-com-derekparker-trie-v3
1091 go-github-com-go-delve-liner
1092 go-github-com-google-go-dap
1093 go-github-com-mattn-go-colorable
1094 go-github-com-mattn-go-isatty
1095 go-github-com-spf13-cobra
1096 go-github-com-spf13-pflag
1097 go-go-starlark-net
1098 go-go-yaml-in-yaml-v3
1099 go-golang-org-x-arch
1100 go-golang-org-x-sys
1101 go-golang-org-x-telemetry))
1102 (home-page "https://github.com/go-delve/delve")
1103 (synopsis "Debugger for the Go programming language")
1104 (description "Delve is a debugger for the Go programming language.")
1105 (license license:expat)))
1106
1107(define-public fandango
1108 (package
1109 (name "fandango")
1110 (version "1.1.1")
1111 (source
1112 (origin
1113 (method git-fetch)
1114 (uri (git-reference
1115 (url "https://github.com/fandango-fuzzer/fandango")
1116 (commit (string-append "v" version))))
1117 (file-name (git-file-name name version))
1118 (sha256 (base32 "0ppx8r9isc772y0ahpgl8g5b3yxka7ffqzlcsa920aib5nj39lrg"))
1119 (modules '((guix build utils)
1120 (ice-9 ftw)
1121 (srfi srfi-26)))
1122 (snippet
1123 #~(begin
1124 (define (delete-all-but directory . preserve)
1125 (with-directory-excursion directory
1126 (let* ((pred (negate (cut member <>
1127 (cons* "." ".." preserve))))
1128 (items (scandir "." pred)))
1129 (for-each (cut delete-file-recursively <>) items))))
1130 (substitute* "pyproject.toml"
1131 ;; Python is linked with GNU readline on all Guix targets.
1132 ((".*gnureadline.*") "")
1133 ;; TODO: update antlr4.
1134 (("antlr4-python3-runtime>=4.13") "antlr4-python3-runtime")
1135 ;; PYTHONHASHSEED is set by the build system.
1136 ((" --pythonhashseed=1") ""))
1137 (delete-all-but "src/fandango/language/cpp_parser"
1138 "FandangoLexerBase.cpp"
1139 "FandangoLexerBase.h")
1140 (delete-all-but "src/fandango/language/parser"
1141 "FandangoLexerBase.py")))))
1142 (build-system pyproject-build-system)
1143 (arguments
1144 (list
1145 #:test-flags
1146 #~(list "--numprocesses" (number->string (parallel-job-count))
1147 ;; Skip expensive tests.
1148 "-k" "not test_cli_max_2 and not test_soft_value")
1149 #:phases
1150 #~(modify-phases %standard-phases
1151 (add-after 'unpack 'generate-parser
1152 (lambda* (#:key inputs #:allow-other-keys)
1153 (substitute* "CMakeLists.txt"
1154 (("(target_link_libraries\\(.*)(\\))" all left right)
1155 (simple-format #f "~a ~a ~a"
1156 left
1157 (search-input-file inputs "lib/libantlr4-runtime.so")
1158 right))
1159 (("\\$\\{CPP_PARSER_DIR\\}/antlr4-cpp-runtime")
1160 (search-input-directory inputs "include/antlr4-runtime")))
1161 (substitute* "Makefile"
1162 ;; Avoid running black.
1163 ((".*\\$\\(BLACK\\).*") ""))
1164 (invoke "make" "parser")))
1165 (add-before 'check 'set-paths
1166 (lambda* (#:key inputs #:allow-other-keys)
1167 (substitute* "evaluation/scriptsizec/scriptsizec_evaluation.py"
1168 (("from tccbox import .*")
1169 "")
1170 (("tcc_bin_path\\(\\)")
1171 (simple-format #f "~s"
1172 (search-input-file inputs "bin/tcc")))))))))
1173 (native-inputs (list antlr4
1174 cmake-minimal
1175 clang-13 ;for tests
1176 python-aiosmtpd ;for tests
1177 python-dateutil ;for tests
1178 python-docutils ;for tests
1179 python-faker ;for tests
1180 python-pytest
1181 python-pytest-benchmark
1182 python-pytest-timeout
1183 python-pytest-xdist
1184 python-scikit-build-core
1185 python-speedy-antlr-tool
1186 python-setuptools
1187 tcc)) ;for tests
1188 (inputs (list cpp-antlr4-runtime
1189 python-antlr4-runtime
1190 python-astar
1191 python-ansi-styles
1192 python-beartype
1193 python-cachedir-tag
1194 python-dill
1195 python-exrex
1196 python-lxml
1197 python-py010parser
1198 python-regex
1199 python-tdigest
1200 python-thefuzz
1201 python-xdg-base-dirs))
1202 (home-page "https://fandango-fuzzer.github.io")
1203 (synopsis "Language-based fuzzer")
1204 (description
1205 "Fandango is a generator of inputs and interactions for software testing.
1206Given the specification of a program's input or interaction language,
1207Fandango generates myriads of valid sample inputs for testing.
1208The specification language combines a grammar with constraints
1209written in Python. Minimization or maximization soft constraints
1210and input distributions can also be expressed in Fandango.")
1211 (license license:eupl1.2)))
1212
1213(define-public fiu
1214 (package
1215 (name "fiu")
1216 (version "1.2")
1217 (source
1218 (origin
1219 (method url-fetch)
1220 (uri (string-append "https://blitiri.com.ar/p/libfiu/files/"
1221 version "/libfiu-" version ".tar.gz"))
1222 (sha256
1223 (base32 "0x4ncvi6sv22rqi9x61byybpmch0z1zvpr6p48axkk890ysv6fim"))))
1224 (build-system gnu-build-system)
1225 (arguments
1226 (list #:make-flags #~(list (string-append "PREFIX=" #$output)
1227 (string-append "CC=" #$(cc-for-target))
1228 (string-append "LDFLAGS=-Wl,-rpath="
1229 #$output "/lib"))
1230 #:phases #~(modify-phases %standard-phases
1231 (delete 'configure)
1232 (add-before 'check 'set-env
1233 ;; Shorten paths to sockets in tests.
1234 (lambda _ (setenv "TMPDIR" "/tmp"))))
1235 #:test-target "test"))
1236 (native-inputs (list python python-setuptools)) ; for tests
1237 (synopsis "Fault injector in userspace")
1238 (description "Fiu provides CLI utilities and a C library
1239to mark points of failure inside your code
1240and to enable/disable the failure of those points.")
1241 (home-page "https://blitiri.com.ar/p/libfiu")
1242 (license license:public-domain)))
1243
1244(define-public python-fiu
1245 (package
1246 (name "python-fiu")
1247 (version "1.2")
1248 (source (package-source fiu))
1249 (build-system pyproject-build-system)
1250 (arguments
1251 (list #:phases #~(modify-phases %standard-phases
1252 (add-after 'unpack 'enter-python-dir
1253 (lambda _ (chdir "bindings/python")))
1254 (add-before 'build 'set-env
1255 (lambda* (#:key inputs #:allow-other-keys)
1256 (setenv "PLIBPATH"
1257 (string-append (assoc-ref inputs "fiu")
1258 "/lib")))))
1259 #:tests? #f)) ; tests run in fiu
1260 (native-inputs (list python-setuptools python-wheel))
1261 (inputs (list fiu))
1262 (synopsis "Python binding for fiu (fault injection in userspace)")
1263 (description "This package includes two Python modules:
1264@enumerate
1265@item @code{fiu} is a wrapper for @code{libfiu}, the fault injection C library.
1266@item @code{fiu_ctrl} provide an easy way run a command
1267with @code{libfiu} enabled, and controlling the failure points dynamically.
1268@end enumerate")
1269 (home-page (package-home-page fiu))
1270 (license (package-license fiu))))