[PATCH] gnu: Add csmith.

  • Done
  • quality assurance status badge
Details
3 participants
  • Maxim Cournoyer
  • odion
  • Olivier Dion
Owner
unassigned
Submitted by
Olivier Dion
Severity
normal
O
O
Olivier Dion wrote on 4 Aug 2023 22:58
(address . guix-patches@gnu.org)(name . Olivier Dion)(address . odion@efficios.com)
cccd5b0895b2e14d183a5e303f325e217365bffb.1691182734.git.olivier.dion@polymtl.ca
From: Olivier Dion <odion@efficios.com>

* gnu/packages/linux.scm (csmith): New variable.
---
gnu/packages/linux.scm | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)

Toggle diff (56 lines)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 3aec03a3ec..84ccf5bb13 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -139,6 +139,7 @@ (define-module (gnu packages linux)
#:use-module (gnu packages llvm)
#:use-module (gnu packages lsof)
#:use-module (gnu packages lua)
+ #:use-module (gnu packages m4)
#:use-module (gnu packages man)
#:use-module (gnu packages maths)
#:use-module (gnu packages multiprecision)
@@ -10418,3 +10419,39 @@ (define-public spectre-meltdown-checker
against the several transient execution CVEs that were published since early
2018, and gives guidance as to how to mitigate them.")
(license license:gpl3)))
+
+(define-public csmith
+ (package
+ (name "csmith")
+ (version "2.3.0")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/csmith-project/csmith")
+ (commit (string-append "csmith-" version))))
+ (sha256
+ (base32
+ "0nhrsnv6cny14xz68qb1h30fbwc05adkisk51p3x63mydm60ddl3"))))
+ (build-system gnu-build-system)
+ (native-inputs
+ (list autoconf automake libtool m4 perl))
+ (arguments
+ (list
+ ;; There is no tests.
+ #:tests? #f
+ ;; Do not install headers under include/csmith-VERSION but in include/csmith
+ #:phases
+ `(modify-phases %standard-phases
+ (add-after 'unpack 'patch-includedir
+ (lambda _
+ (substitute* "runtime/Makefile.am"
+ (("\\$\\(includedir\\)/\\$\\(PACKAGE\\)-\\$\\(VERSION\\)")
+ "$(includedir)/$(PACKAGE)"))))
+ (replace 'bootstrap
+ (lambda _
+ (invoke "autoreconf" "-vfi"))))))
+ (home-page "https://github.com/csmith-project/csmith")
+ (synopsis "Random generator of C programs")
+ (description "Csmith primary purpose is to find compiler bugs with random
+programs using differential testing.")
+ (license license:bsd-4)))

base-commit: 17fadbb5ea3b35f962ab1bcd5b8cf4e1d699eb7e
--
2.41.0
M
M
Maxim Cournoyer wrote on 6 Sep 2023 06:54
(name . Olivier Dion)(address . olivier.dion@polymtl.ca)
87h6o79a02.fsf@gmail.com
Hi there!

Olivier Dion <olivier.dion@polymtl.ca> writes:

Toggle quote (45 lines)
> From: Olivier Dion <odion@efficios.com>
>
> * gnu/packages/linux.scm (csmith): New variable.
> ---
> gnu/packages/linux.scm | 37 +++++++++++++++++++++++++++++++++++++
> 1 file changed, 37 insertions(+)
>
> diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
> index 3aec03a3ec..84ccf5bb13 100644
> --- a/gnu/packages/linux.scm
> +++ b/gnu/packages/linux.scm
> @@ -139,6 +139,7 @@ (define-module (gnu packages linux)
> #:use-module (gnu packages llvm)
> #:use-module (gnu packages lsof)
> #:use-module (gnu packages lua)
> + #:use-module (gnu packages m4)
> #:use-module (gnu packages man)
> #:use-module (gnu packages maths)
> #:use-module (gnu packages multiprecision)
> @@ -10418,3 +10419,39 @@ (define-public spectre-meltdown-checker
> against the several transient execution CVEs that were published since early
> 2018, and gives guidance as to how to mitigate them.")
> (license license:gpl3)))
> +
> +(define-public csmith
> + (package
> + (name "csmith")
> + (version "2.3.0")
> + (source (origin
> + (method git-fetch)
> + (uri (git-reference
> + (url "https://github.com/csmith-project/csmith")
> + (commit (string-append "csmith-" version))))
> + (sha256
> + (base32
> + "0nhrsnv6cny14xz68qb1h30fbwc05adkisk51p3x63mydm60ddl3"))))
> + (build-system gnu-build-system)
> + (native-inputs
> + (list autoconf automake libtool m4 perl))
> + (arguments
> + (list
> + ;; There is no tests.
> + #:tests? #f
> + ;; Do not install headers under include/csmith-VERSION but in include/csmith

Please keep line width under 80 chars; end with trailing period.

Toggle quote (11 lines)
> + #:phases
> + `(modify-phases %standard-phases
> + (add-after 'unpack 'patch-includedir
> + (lambda _
> + (substitute* "runtime/Makefile.am"
> + (("\\$\\(includedir\\)/\\$\\(PACKAGE\\)-\\$\\(VERSION\\)")
> + "$(includedir)/$(PACKAGE)"))))
> + (replace 'bootstrap
> + (lambda _
> + (invoke "autoreconf" "-vfi"))))))

Insteadof replacing bootstrap you can just (delete-file "configure") to
have it recreated.

Toggle quote (5 lines)
> + (synopsis "Random generator of C programs")
> + (description "Csmith primary purpose is to find compiler bugs with random
> +programs using differential testing.")

Csmith's or The primary purpose of

The rest LGTM. Could you send a v2?

--
Thanks,
Maxim
M
M
Maxim Cournoyer wrote on 6 Sep 2023 06:54
control message for bug #65059
(address . control@debbugs.gnu.org)
87fs3r99zy.fsf@gmail.com
tags 65059 + moreinfo
quit
O
O
odion wrote on 6 Sep 2023 22:22
[PATCH v2] gnu: Add csmith.
757a92ff2b967614779df2f4c564b96520a2af5a.1694030940.git.olivier.dion@polymtl.ca
From: Olivier Dion <odion@efficios.com>

* gnu/packages/linux.scm (csmith): New variable.
---
gnu/packages/linux.scm | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)

Toggle diff (57 lines)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 2a3fd82891..121ea89fb5 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -141,6 +141,7 @@ (define-module (gnu packages linux)
#:use-module (gnu packages llvm)
#:use-module (gnu packages lsof)
#:use-module (gnu packages lua)
+ #:use-module (gnu packages m4)
#:use-module (gnu packages man)
#:use-module (gnu packages maths)
#:use-module (gnu packages multiprecision)
@@ -10363,3 +10364,40 @@ (define-public spectre-meltdown-checker
against the several transient execution CVEs that were published since early
2018, and gives guidance as to how to mitigate them.")
(license license:gpl3)))
+
+(define-public csmith
+ (package
+ (name "csmith")
+ (version "2.3.0")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/csmith-project/csmith")
+ (commit (string-append "csmith-" version))))
+ (sha256
+ (base32
+ "0nhrsnv6cny14xz68qb1h30fbwc05adkisk51p3x63mydm60ddl3"))))
+ (build-system gnu-build-system)
+ (native-inputs
+ (list autoconf automake libtool m4 perl))
+ (arguments
+ (list
+ ;; There is no tests.
+ #:tests? #f
+ ;; Do not install headers under include/csmith-VERSION but in
+ ;; include/csmith
+ #:phases
+ `(modify-phases %standard-phases
+ (add-after 'unpack 'patch-includedir
+ (lambda _
+ (substitute* "runtime/Makefile.am"
+ (("\\$\\(includedir\\)/\\$\\(PACKAGE\\)-\\$\\(VERSION\\)")
+ "$(includedir)/$(PACKAGE)"))))
+ (add-before 'bootstrap 'force-bootstrap
+ (lambda _
+ (delete-file "configure"))))))
+ (home-page "https://github.com/csmith-project/csmith")
+ (synopsis "Random generator of C programs")
+ (description "Csmith's primary purpose is to find compiler bugs with
+random programs using differential testing.")
+ (license license:bsd-4)))

base-commit: 65dcfb3f3865d08467da747041263fd22460d393
--
2.41.0
M
M
Maxim Cournoyer wrote on 7 Sep 2023 04:33
(address . odion@efficios.com)
87o7ieogpk.fsf@gmail.com
Hello,

odion@efficios.com writes:

Toggle quote (4 lines)
> From: Olivier Dion <odion@efficios.com>
>
> * gnu/packages/linux.scm (csmith): New variable.

Installed as 21e1ba8a, thanks :-).

--
Maxim
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 65059@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 65059
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch