[bug#54235,v2,3/3] gnu: Add sysbench.
Commit Message
* gnu/packages/benchmark.scm (sysbench): New variable.
---
gnu/packages/benchmark.scm | 137 +++++++++++++++++++++++++++++++++++++
1 file changed, 137 insertions(+)
Comments
Maxim Cournoyer schreef op ma 07-03-2022 om 23:38 [-0500]:
> + (search-input-file inputs
> + "xml/dtd/docbook/catalog.xml")
> + "\n")))
docbook-xml-4.1.2 is in native-inputs, not inputs, so this needs to be
(search-input-file (or native-inputs inputs) ...) such that 'search-
input-file' succeeds even when compiling natively.
Greetings,
Maxime.
Hi,
Maxime Devos <maximedevos@telenet.be> writes:
> Maxim Cournoyer schreef op ma 07-03-2022 om 23:38 [-0500]:
>> + (search-input-file inputs
>> + "xml/dtd/docbook/catalog.xml")
>> + "\n")))
>
>
> docbook-xml-4.1.2 is in native-inputs, not inputs, so this needs to be
> (search-input-file (or native-inputs inputs) ...) such that 'search-
> input-file' succeeds even when compiling natively.
Oops! Good catch. I'd be nice to have all this cross-compilation
gotchas and knowledge captured in a node under 'Contributing'; I keep
forgetting, and I'm sure I'm not alone :-).
Maxim
Maxim Cournoyer schreef op di 08-03-2022 om 09:39 [-0500]:
> > Maxim Cournoyer schreef op ma 07-03-2022 om 23:38 [-0500]:
> > > + (search-input-file inputs
> > > +
> > > "xml/dtd/docbook/catalog.xml")
> > > + "\n")))
> >
> >
> > docbook-xml-4.1.2 is in native-inputs, not inputs, so this needs to
> > be
> > (search-input-file (or native-inputs inputs) ...) such that
> > 'search-
> > input-file' succeeds even when compiling natively.
>
> Oops! Good catch. I'd be nice to have all this cross-compilation
> gotchas and knowledge captured in a node under 'Contributing'; I keep
> forgetting, and I'm sure I'm not alone :-).
FWIW, I've seen a few similar issues with docbook in the past (*)
and it should be feasible to write a linter for these kind of
inputs/native-inputs+docbook issues -- the 'wrapper-inputs' linter
(which checks that 'bash/bash-minimal' is in the inputs whenever
'wrap-program' is used) might be a good starting point.
This also seems like something (guix scripts style) could be taught to
automatically correct but I'm not familiar with that part of Guix.
(*) If I do 'git grep -F xml/dtd/docbook' and select a few cases, I see
quite a few suspicious uses ...
Greetings,
Maxime
Hello!
As discussed some time ago on #guix, you were OK with this series with
in its last revision.
I've pushed the change to docbook-xml-4.1.2 to core-updates, and the
rest to master, after noting that it would build with 'docbook-xml' just
fine.
Thanks for the review!
Closing.
Maxim
@@ -37,19 +37,27 @@ (define-module (gnu packages benchmark)
#:use-module (guix build-system gnu)
#:use-module (guix build-system python)
#:use-module (gnu packages)
+ #:use-module (gnu packages autotools)
+ #:use-module (gnu packages base)
+ #:use-module (gnu packages c)
#:use-module (gnu packages check)
#:use-module (gnu packages compression)
#:use-module (gnu packages kde-frameworks)
+ #:use-module (gnu packages databases)
+ #:use-module (gnu packages docbook)
#:use-module (gnu packages linux)
+ #:use-module (gnu packages lua)
#:use-module (gnu packages maths)
#:use-module (gnu packages mpi)
#:use-module (gnu packages opencl)
#:use-module (gnu packages perl)
+ #:use-module (gnu packages pkg-config)
#:use-module (gnu packages python)
#:use-module (gnu packages python-science)
#:use-module (gnu packages python-web)
#:use-module (gnu packages python-xyz)
#:use-module (gnu packages qt)
+ #:use-module (gnu packages xml)
#:use-module (ice-9 match))
(define-public fio
@@ -430,3 +438,132 @@ (define-public kdiskmark
@item Report generation.
@end itemize")
(license license:gpl3+)))
+
+(define-public sysbench
+ (package
+ (name "sysbench")
+ (version "1.0.20")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/akopytov/sysbench")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (modules '((guix build utils)))
+ (snippet '(begin
+ ;; Ensure no bundled libraries get used.
+ (delete-file-recursively "third_party")
+ (substitute* "configure.ac"
+ (("^third_party/.*")
+ ""))
+ (substitute* "Makefile.am"
+ ((".*(LUAJIT|CK)_DIR =.*")
+ ""))))
+ (sha256
+ (base32
+ "1sanvl2a52ff4shj62nw395zzgdgywplqvwip74ky8q7s6qjf5qy"))))
+ (build-system gnu-build-system)
+ (arguments
+ (list
+ #:configure-flags #~(list "--with-pgsql"
+ ;; Explicitly specify the library directory of
+ ;; MySQL, otherwise `mysql_config` gets
+ ;; consulted and adds unnecessary link
+ ;; directives.
+ (string-append "--with-mysql-libs="
+ #$(this-package-input "mysql")
+ "/lib")
+ "--with-system-luajit"
+ "--with-system-ck"
+ ;; If we let the build tool select the most
+ ;; optimal compiler architecture flag, the
+ ;; build is not reproducible.
+ "--without-gcc-arch")
+ #:phases #~(modify-phases %standard-phases
+ (add-after 'unpack 'patch-test-runner
+ (lambda _
+ (substitute* "tests/test_run.sh"
+ (("/bin/bash")
+ (which "bash"))
+ ;; Do not attempt to invoke the cram command via
+ ;; Python, as on Guix it is a shell script (wrapper).
+ (("\\$\\(command -v cram\\)")
+ "-m cram"))))
+ (add-after 'unpack 'disable-test-installation
+ (lambda _
+ (substitute* "tests/Makefile.am"
+ (("install-data-local")
+ "do-not-install-data-local")
+ (("^test_SCRIPTS.*")
+ ""))))
+ (add-after 'unpack 'fix-docbook
+ (lambda* (#:key inputs #:allow-other-keys)
+ (substitute* "m4/ax_check_docbook.m4"
+ (("DOCBOOK_ROOT=.*" all)
+ (string-append
+ all "XML_CATALOG="
+ (search-input-file inputs
+ "xml/dtd/docbook/catalog.xml")
+ "\n")))
+ (substitute* "doc/xsl/xhtml.xsl"
+ (("http://docbook.sourceforge.net/release/xsl\
+/current/xhtml/docbook.xsl")
+ (search-input-file
+ inputs (string-append "xml/xsl/docbook-xsl-"
+ #$(package-version docbook-xsl)
+ "/xhtml/docbook.xsl"))))
+ (substitute* "doc/xsl/xhtml-chunk.xsl"
+ (("http://docbook.sourceforge.net/release/xsl\
+/current/xhtml/chunk.xsl")
+ (search-input-file
+ inputs (string-append "xml/xsl/docbook-xsl-"
+ #$(package-version docbook-xsl)
+ "/xhtml/chunk.xsl")))))))))
+ (native-inputs (list autoconf
+ automake
+ libtool
+ pkg-config
+ python-cram
+ python-wrapper
+ which
+ ;; For documentation
+ libxml2 ;for XML_CATALOG_FILES
+ libxslt
+ docbook-xml-4.1.2
+ docbook-xsl))
+ (inputs (list ck libaio luajit mysql postgresql))
+ (home-page "https://github.com/akopytov/sysbench/")
+ (synopsis "Scriptable database and system performance benchmark")
+ (description "@command{sysbench} is a scriptable multi-threaded benchmark
+tool based on LuaJIT. It is most frequently used for database benchmarks, but
+can also be used to create arbitrarily complex workloads that do not involve a
+database server. @command{sysbench} comes with the following bundled
+benchmarks:
+@table @file
+@item oltp_*.lua
+A collection of OLTP-like database benchmarks.
+@item fileio
+A filesystem-level benchmark.
+@item cpu
+A simple CPU benchmark.
+@item memory
+A memory access benchmark.
+@item threads
+A thread-based scheduler benchmark.
+@item mutex
+A POSIX mutex benchmark.
+@end table
+It includes features such as:
+@itemize
+@item
+Extensive statistics about rate and latency is available, including latency
+percentiles and histograms.
+@item
+Low overhead even with thousands of concurrent threads. @command{sysbench} is
+capable of generating and tracking hundreds of millions of events per second.
+@item
+New benchmarks can be easily created by implementing pre-defined hooks in
+user-provided Lua scripts.
+@item
+@end itemize")
+ (license license:gpl2+)))