[PATCH v3 2/2] gnu: nix: Update to 2.16.1

  • Done
  • quality assurance status badge
Details
4 participants
  • Zhu Zihao
  • jgart
  • Sergey Trofimov
  • Sergei Trofimovich
Owner
unassigned
Submitted by
Zhu Zihao
Severity
normal
Z
Z
Zhu Zihao wrote on 4 Jun 2023 18:29
[PATCH]: gnu: nix: Update to 2.16.0.
(address . guix-patches@gnu.org)
86o7lvfaw1.fsf@163.com
This is a series of patch update nix to 2.16.0.
--
Retrieve my PGP public key:

gpg --recv-keys B3EBC086AB0EBC0F45E0B4D433DB374BCEE4D9DC

Zihao
-----BEGIN PGP SIGNATURE-----

iIsEARYIADMWIQT4UAIrVkIEZilSHr2K2nJqP6LM8gUCZHy8HhUcYWxsX2J1dF9s
YXN0QDE2My5jb20ACgkQitpyaj+izPJD7wD+JySetnMPbjIuTxquXs3rjN/IBmay
eSBrT0ZYJX3uQvUA/1aiV7IzmWqA9WE7FOf3aqgMt55qTQbQr/og0d6dNcoG
=ul6j
-----END PGP SIGNATURE-----

Z
Z
Zhu Zihao wrote on 4 Jun 2023 18:34
[PATCH 3/3] gnu: nix: Use HTTPS for package source.
(address . 63893@debbugs.gnu.org)(name . Zhu Zihao)(address . all_but_last@163.com)
8d460978346295701104f12ea7c0877594ca89ea.1685896014.git.all_but_last@163.com
* gnu/packages/package-management.scm (nix)[source]: Use HTTPS.
---
gnu/packages/package-management.scm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (15 lines)
diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
index 238914a955..9c51c3275d 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -736,7 +736,7 @@ (define-public nix
(origin
(method git-fetch)
(uri (git-reference
- (url "http://github.com/NixOS/nix")
+ (url "https://github.com/NixOS/nix")
(commit version)))
(file-name (git-file-name name version))
(sha256
--
2.40.1
Z
Z
Zhu Zihao wrote on 4 Jun 2023 18:37
Re: bug#63893: Acknowledgement ([PATCH]: gnu: nix: Update to 2.16.0.)
(address . 63893@debbugs.gnu.org)
86edmrfait.fsf@163.com
This patch should close https://issues.guix.gnu.org/63546
--
Retrieve my PGP public key:

gpg --recv-keys B3EBC086AB0EBC0F45E0B4D433DB374BCEE4D9DC

Zihao
-----BEGIN PGP SIGNATURE-----

iIsEARYIADMWIQT4UAIrVkIEZilSHr2K2nJqP6LM8gUCZHy9+xUcYWxsX2J1dF9s
YXN0QDE2My5jb20ACgkQitpyaj+izPL89wD6ArGvpk/FRbaXZ8dlNG2wbdIwaJqv
kIqFr1C0TWbukEMA/05VBoD58SUmXxvIeyiKKhlh4EEOJcZDi88pqxHxDhoK
=Xktr
-----END PGP SIGNATURE-----

Z
Z
Zhu Zihao wrote on 4 Jun 2023 18:41
[PATCH 1/3] gnu: Add rapidcheck.
(address . 63893@debbugs.gnu.org)(name . Zhu Zihao)(address . all_but_last@163.com)
89f7dfb39f6e4010d962b392772409c756f0e562.1685896014.git.all_but_last@163.com
* gnu/packages/check.scm (rapidcheck): New variable.
---
gnu/packages/check.scm | 41 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)

Toggle diff (63 lines)
diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index 87728fefa3..470d8c52fa 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -43,6 +43,7 @@
;;; Copyright © 2022 jgart <jgart@dismail.de>
;;; Copyright © 2023 Luis Felipe López Acevedo <luis.felipe.la@protonmail.com>
;;; Copyright © 2023 Timo Wilken <guix@twilken.net>
+;;; Copyright © 2023 Zhu Zihao <all_but_last@163.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -3198,6 +3199,46 @@ (define-public libfaketime
provides a simple way to achieve this.")
(license license:gpl2)))
+(define-public rapidcheck
+ (let ((commit "a5724ea5b0b00147109b0605c377f1e54c353ba2")
+ (revision "0"))
+ (package
+ (name "rapidcheck")
+ (version (git-version "0.0.0" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri
+ (git-reference
+ (url "https://github.com/emil-e/rapidcheck")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0f2dmsym8ibnwkaidxmgp73mg0sdniwsyn6ppskh74246h29bbcy"))))
+ (arguments
+ (list
+ #:tests? #f ;require fetching submodules
+ #:configure-flags #~(list "-DCMAKE_POSITION_INDEPENDENT_CODE=ON")
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'install 'install-extra-headers
+ (lambda _
+ (with-directory-excursion "../source/extras"
+ (for-each
+ (lambda (dir)
+ (let ((dir (string-append dir "/include/rapidcheck/"))
+ (dest (string-append #$output
+ "/include/rapidcheck")))
+ (copy-recursively dir dest)))
+ '("boost" "boost_test" "catch" "gmock" "gtest"))))))))
+ (build-system cmake-build-system)
+ (home-page "https://github.com/emil-e/rapidcheck")
+ (synopsis "Property based testing framework for C++")
+ (description "Rapidcheck is a property based testing framework for C++.
+It works by generating random data to try and find a case breaks your given
+pre-condition.")
+ (license license:bsd-2))))
+
(define-public umockdev
(package
(name "umockdev")

base-commit: ae04b3996be99c89142866afdbba5151099b2064
--
2.40.1
Z
Z
Zhu Zihao wrote on 4 Jun 2023 18:43
[PATCH 2/3] gnu: nix: Update to 2.16.0.
(address . 63893@debbugs.gnu.org)(name . Zhu Zihao)(address . all_but_last@163.com)
98e6750da44a63f49efedbeb602112552c496abc.1685896014.git.all_but_last@163.com
* gnu/packages/package-management.scm (nix): Update to 2.16.0.
[inputs]: Add nlohmann-json.
[native-inputs]: Add rapidcheck.
[arguments]<#:phases>: In phase "check", change the value of environment
variable "NIX_STORE" to "/nix/store" temporarily.

* gnu/packages/patches/nix-dont-build-html-doc.diff: Update.
---
gnu/packages/package-management.scm | 25 +++++++++++---
.../patches/nix-dont-build-html-doc.diff | 33 ++++++++++++++-----
2 files changed, 45 insertions(+), 13 deletions(-)

Toggle diff (134 lines)
diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
index a856ff2726..238914a955 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -20,7 +20,7 @@
;;; Copyright © 2021 Ivan Gankevich <i.gankevich@spbu.ru>
;;; Copyright © 2021, 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2021 John Kehayias <john.kehayias@protonmail.com>
-;;; Copyright © 2022 Zhu Zihao <all_but_last@163.com>
+;;; Copyright © 2022, 2023 Zhu Zihao <all_but_last@163.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -56,6 +56,7 @@ (define-module (gnu packages package-management)
#:use-module (gnu packages compression)
#:use-module (gnu packages cmake)
#:use-module (gnu packages cpio)
+ #:use-module (gnu packages cpp)
#:use-module (gnu packages crypto)
#:use-module (gnu packages curl)
#:use-module (gnu packages databases)
@@ -730,7 +731,7 @@ (define-public guix-modules
(define-public nix
(package
(name "nix")
- (version "2.5.1")
+ (version "2.16.0")
(source
(origin
(method git-fetch)
@@ -739,7 +740,7 @@ (define-public nix
(commit version)))
(file-name (git-file-name name version))
(sha256
- (base32 "1m8rmv8i6lg83pmalvjlq1fn8mcghn3ngjv3kw1kqsa45ymj5sqq"))
+ (base32 "0jizpci4zspqpqqy3n780m4wh8dzhfywaiz953xv70c7in810dra"))
(patches
(search-patches "nix-dont-build-html-doc.diff"))))
(build-system gnu-build-system)
@@ -756,7 +757,19 @@ (define-public nix
(apply invoke "make" "install"
(string-append "sysconfdir=" etc)
(string-append "profiledir=" etc "/profile.d")
- make-flags)))))))
+ make-flags))))
+ (replace 'check
+ (lambda args
+ ;; Some test expect environment variable NIX_STORE to be
+ ;; "/nix/store"
+ (let ((original-NIX_STORE (getenv "NIX_STORE")))
+ (dynamic-wind
+ (lambda ()
+ (setenv "NIX_STORE" "/nix/store"))
+ (lambda ()
+ (apply (assoc-ref %standard-phases 'check) args))
+ (lambda ()
+ (setenv "NIX_STORE" original-NIX_STORE)))))))))
(native-inputs
(list autoconf
autoconf-archive
@@ -766,7 +779,8 @@ (define-public nix
googletest
jq
libtool
- pkg-config))
+ pkg-config
+ rapidcheck))
(inputs
(append (list boost
brotli
@@ -778,6 +792,7 @@ (define-public nix
libseccomp
libsodium
lowdown
+ nlohmann-json
openssl
sqlite
xz
diff --git a/gnu/packages/patches/nix-dont-build-html-doc.diff b/gnu/packages/patches/nix-dont-build-html-doc.diff
index 79142bc215..2eb45117b0 100644
--- a/gnu/packages/patches/nix-dont-build-html-doc.diff
+++ b/gnu/packages/patches/nix-dont-build-html-doc.diff
@@ -3,24 +3,41 @@ We can't simply disable it because we need manpages.
Author: Zhu Zihao <all_but_last@163.com>
-diff --git a/doc/manual/local.mk b/doc/manual/local.mk
-index e43d9f2fb..c323d1847 100644
--- a/doc/manual/local.mk
+++ b/doc/manual/local.mk
-@@ -69,8 +69,6 @@ $(d)/builtins.json: $(bindir)/nix
+@@ -138,11 +138,6 @@
$(trace-gen) $(dummy-env) NIX_PATH=nix/corepkgs=corepkgs $(bindir)/nix __dump-builtins > $@.tmp
@mv $@.tmp $@
-# Generate the HTML manual.
+-.PHONY: manual-html
+-manual-html: $(docdir)/manual/index.html
-install: $(docdir)/manual/index.html
-
+-
# Generate 'nix' manpages.
install: $(mandir)/man1/nix3-manpages
-@@ -94,7 +92,5 @@ doc/manual/generated/man1/nix3-manpages: $(d)/src/command-ref/new-cli
+ man: doc/manual/generated/man1/nix3-manpages
+@@ -167,23 +162,4 @@
done
@touch $@
--$(docdir)/manual/index.html: $(MANUAL_SRCS) $(d)/book.toml $(d)/custom.css $(d)/src/SUMMARY.md $(d)/src/command-ref/new-cli $(d)/src/command-ref/conf-file.md $(d)/src/expressions/builtins.md $(call rwildcard, $(d)/src, *.md)
-- $(trace-gen) RUST_LOG=warn mdbook build doc/manual -d $(DESTDIR)$(docdir)/manual
-
+-$(docdir)/manual/index.html: $(MANUAL_SRCS) $(d)/book.toml $(d)/anchors.jq $(d)/custom.css $(d)/src/SUMMARY.md $(d)/src/command-ref/new-cli $(d)/src/contributing/experimental-feature-descriptions.md $(d)/src/command-ref/conf-file.md $(d)/src/language/builtins.md
+- $(trace-gen) \
+- tmp="$$(mktemp -d)"; \
+- cp -r doc/manual "$$tmp"; \
+- find "$$tmp" -name '*.md' | while read -r file; do \
+- $(call process-includes,$$file,$$file); \
+- done; \
+- find "$$tmp" -name '*.md' | while read -r file; do \
+- docroot="$$(realpath --relative-to="$$(dirname "$$file")" $$tmp/manual/src)"; \
+- sed -i "s,@docroot@,$$docroot,g" "$$file"; \
+- done; \
+- set -euo pipefail; \
+- RUST_LOG=warn mdbook build "$$tmp/manual" -d $(DESTDIR)$(docdir)/manual.tmp 2>&1 \
+- | { grep -Fv "because fragment resolution isn't implemented" || :; }; \
+- rm -rf "$$tmp/manual"
+- @rm -rf $(DESTDIR)$(docdir)/manual
+- @mv $(DESTDIR)$(docdir)/manual.tmp/html $(DESTDIR)$(docdir)/manual
+- @rm -rf $(DESTDIR)$(docdir)/manual.tmp
+-
endif
--
2.40.1
J
[PATCH v2 1/2] gnu: Add rapidcheck.
(address . 63893@debbugs.gnu.org)
c7d35f4b59192643a00aeb9d357ec425f8fb5867.1686492434.git.jgart@dismail.de
* gnu/packages/check.scm (rapidcheck): New variable.
---
gnu/packages/check.scm | 41 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)

Toggle diff (63 lines)
diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index 87728fefa3..470d8c52fa 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -43,6 +43,7 @@
;;; Copyright © 2022 jgart <jgart@dismail.de>
;;; Copyright © 2023 Luis Felipe López Acevedo <luis.felipe.la@protonmail.com>
;;; Copyright © 2023 Timo Wilken <guix@twilken.net>
+;;; Copyright © 2023 Zhu Zihao <all_but_last@163.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -3198,6 +3199,46 @@ (define-public libfaketime
provides a simple way to achieve this.")
(license license:gpl2)))
+(define-public rapidcheck
+ (let ((commit "a5724ea5b0b00147109b0605c377f1e54c353ba2")
+ (revision "0"))
+ (package
+ (name "rapidcheck")
+ (version (git-version "0.0.0" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri
+ (git-reference
+ (url "https://github.com/emil-e/rapidcheck")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0f2dmsym8ibnwkaidxmgp73mg0sdniwsyn6ppskh74246h29bbcy"))))
+ (arguments
+ (list
+ #:tests? #f ;require fetching submodules
+ #:configure-flags #~(list "-DCMAKE_POSITION_INDEPENDENT_CODE=ON")
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'install 'install-extra-headers
+ (lambda _
+ (with-directory-excursion "../source/extras"
+ (for-each
+ (lambda (dir)
+ (let ((dir (string-append dir "/include/rapidcheck/"))
+ (dest (string-append #$output
+ "/include/rapidcheck")))
+ (copy-recursively dir dest)))
+ '("boost" "boost_test" "catch" "gmock" "gtest"))))))))
+ (build-system cmake-build-system)
+ (home-page "https://github.com/emil-e/rapidcheck")
+ (synopsis "Property based testing framework for C++")
+ (description "Rapidcheck is a property based testing framework for C++.
+It works by generating random data to try and find a case breaks your given
+pre-condition.")
+ (license license:bsd-2))))
+
(define-public umockdev
(package
(name "umockdev")

base-commit: 6fe9a004dba2d4ddf69ff6f1714af15ffaa7e62a
--
2.40.1
J
[PATCH v2 2/2] gnu: nix: Update to 2.16.1.
(address . 63893@debbugs.gnu.org)
3400f62ade7fcb01c0e119b62198d1baff42138d.1686492434.git.jgart@dismail.de
* gnu/packages/package-management.scm (nix): Update to 2.16.1.
[source]: Use HTTPS for package source.
[inputs]: Add nlohmann-json.
[native-inputs]: Add rapidcheck.
[arguments]<#:phases>: In phase "check", change the value of environment
variable "NIX_STORE" to "/nix/store" temporarily.

* gnu/packages/patches/nix-dont-build-html-doc.diff: Update.

Co-authored-by: jgart <jgart@dismail.de>
---

Hi Zhu,

Here's a v2 updating your patchset to use nix at 2.16.1. I also squashed
the commit that uses HTTPS in the source field.

all best,

jgart

gnu/packages/package-management.scm | 27 +++++++++++----
.../patches/nix-dont-build-html-doc.diff | 33 ++++++++++++++-----
2 files changed, 46 insertions(+), 14 deletions(-)

Toggle diff (136 lines)
diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
index 4791880375..1dedfe5600 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -20,7 +20,7 @@
;;; Copyright © 2021 Ivan Gankevich <i.gankevich@spbu.ru>
;;; Copyright © 2021, 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2021 John Kehayias <john.kehayias@protonmail.com>
-;;; Copyright © 2022 Zhu Zihao <all_but_last@163.com>
+;;; Copyright © 2022, 2023 Zhu Zihao <all_but_last@163.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -56,6 +56,7 @@ (define-module (gnu packages package-management)
#:use-module (gnu packages compression)
#:use-module (gnu packages cmake)
#:use-module (gnu packages cpio)
+ #:use-module (gnu packages cpp)
#:use-module (gnu packages crypto)
#:use-module (gnu packages curl)
#:use-module (gnu packages databases)
@@ -731,16 +732,16 @@ (define-public guix-modules
(define-public nix
(package
(name "nix")
- (version "2.5.1")
+ (version "2.16.0")
(source
(origin
(method git-fetch)
(uri (git-reference
- (url "http://github.com/NixOS/nix")
+ (url "https://github.com/NixOS/nix")
(commit version)))
(file-name (git-file-name name version))
(sha256
- (base32 "1m8rmv8i6lg83pmalvjlq1fn8mcghn3ngjv3kw1kqsa45ymj5sqq"))
+ (base32 "0jizpci4zspqpqqy3n780m4wh8dzhfywaiz953xv70c7in810dra"))
(patches
(search-patches "nix-dont-build-html-doc.diff"))))
(build-system gnu-build-system)
@@ -757,7 +758,19 @@ (define-public nix
(apply invoke "make" "install"
(string-append "sysconfdir=" etc)
(string-append "profiledir=" etc "/profile.d")
- make-flags)))))))
+ make-flags))))
+ (replace 'check
+ (lambda args
+ ;; Some test expect environment variable NIX_STORE to be
+ ;; "/nix/store"
+ (let ((original-NIX_STORE (getenv "NIX_STORE")))
+ (dynamic-wind
+ (lambda ()
+ (setenv "NIX_STORE" "/nix/store"))
+ (lambda ()
+ (apply (assoc-ref %standard-phases 'check) args))
+ (lambda ()
+ (setenv "NIX_STORE" original-NIX_STORE)))))))))
(native-inputs
(list autoconf
autoconf-archive
@@ -767,7 +780,8 @@ (define-public nix
googletest
jq
libtool
- pkg-config))
+ pkg-config
+ rapidcheck))
(inputs
(append (list boost
brotli
@@ -779,6 +793,7 @@ (define-public nix
libseccomp
libsodium
lowdown
+ nlohmann-json
openssl
sqlite
xz
diff --git a/gnu/packages/patches/nix-dont-build-html-doc.diff b/gnu/packages/patches/nix-dont-build-html-doc.diff
index 79142bc215..2eb45117b0 100644
--- a/gnu/packages/patches/nix-dont-build-html-doc.diff
+++ b/gnu/packages/patches/nix-dont-build-html-doc.diff
@@ -3,24 +3,41 @@ We can't simply disable it because we need manpages.
Author: Zhu Zihao <all_but_last@163.com>
-diff --git a/doc/manual/local.mk b/doc/manual/local.mk
-index e43d9f2fb..c323d1847 100644
--- a/doc/manual/local.mk
+++ b/doc/manual/local.mk
-@@ -69,8 +69,6 @@ $(d)/builtins.json: $(bindir)/nix
+@@ -138,11 +138,6 @@
$(trace-gen) $(dummy-env) NIX_PATH=nix/corepkgs=corepkgs $(bindir)/nix __dump-builtins > $@.tmp
@mv $@.tmp $@
-# Generate the HTML manual.
+-.PHONY: manual-html
+-manual-html: $(docdir)/manual/index.html
-install: $(docdir)/manual/index.html
-
+-
# Generate 'nix' manpages.
install: $(mandir)/man1/nix3-manpages
-@@ -94,7 +92,5 @@ doc/manual/generated/man1/nix3-manpages: $(d)/src/command-ref/new-cli
+ man: doc/manual/generated/man1/nix3-manpages
+@@ -167,23 +162,4 @@
done
@touch $@
--$(docdir)/manual/index.html: $(MANUAL_SRCS) $(d)/book.toml $(d)/custom.css $(d)/src/SUMMARY.md $(d)/src/command-ref/new-cli $(d)/src/command-ref/conf-file.md $(d)/src/expressions/builtins.md $(call rwildcard, $(d)/src, *.md)
-- $(trace-gen) RUST_LOG=warn mdbook build doc/manual -d $(DESTDIR)$(docdir)/manual
-
+-$(docdir)/manual/index.html: $(MANUAL_SRCS) $(d)/book.toml $(d)/anchors.jq $(d)/custom.css $(d)/src/SUMMARY.md $(d)/src/command-ref/new-cli $(d)/src/contributing/experimental-feature-descriptions.md $(d)/src/command-ref/conf-file.md $(d)/src/language/builtins.md
+- $(trace-gen) \
+- tmp="$$(mktemp -d)"; \
+- cp -r doc/manual "$$tmp"; \
+- find "$$tmp" -name '*.md' | while read -r file; do \
+- $(call process-includes,$$file,$$file); \
+- done; \
+- find "$$tmp" -name '*.md' | while read -r file; do \
+- docroot="$$(realpath --relative-to="$$(dirname "$$file")" $$tmp/manual/src)"; \
+- sed -i "s,@docroot@,$$docroot,g" "$$file"; \
+- done; \
+- set -euo pipefail; \
+- RUST_LOG=warn mdbook build "$$tmp/manual" -d $(DESTDIR)$(docdir)/manual.tmp 2>&1 \
+- | { grep -Fv "because fragment resolution isn't implemented" || :; }; \
+- rm -rf "$$tmp/manual"
+- @rm -rf $(DESTDIR)$(docdir)/manual
+- @mv $(DESTDIR)$(docdir)/manual.tmp/html $(DESTDIR)$(docdir)/manual
+- @rm -rf $(DESTDIR)$(docdir)/manual.tmp
+-
endif
--
2.40.1
J
[PATCH v3 1/2] gnu: Add rapidcheck.
(address . 63893@debbugs.gnu.org)
c7d35f4b59192643a00aeb9d357ec425f8fb5867.1686493692.git.jgart@dismail.de
* gnu/packages/check.scm (rapidcheck): New variable.
---
gnu/packages/check.scm | 41 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)

Toggle diff (63 lines)
diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index 87728fefa3..470d8c52fa 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -43,6 +43,7 @@
;;; Copyright © 2022 jgart <jgart@dismail.de>
;;; Copyright © 2023 Luis Felipe López Acevedo <luis.felipe.la@protonmail.com>
;;; Copyright © 2023 Timo Wilken <guix@twilken.net>
+;;; Copyright © 2023 Zhu Zihao <all_but_last@163.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -3198,6 +3199,46 @@ (define-public libfaketime
provides a simple way to achieve this.")
(license license:gpl2)))
+(define-public rapidcheck
+ (let ((commit "a5724ea5b0b00147109b0605c377f1e54c353ba2")
+ (revision "0"))
+ (package
+ (name "rapidcheck")
+ (version (git-version "0.0.0" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri
+ (git-reference
+ (url "https://github.com/emil-e/rapidcheck")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0f2dmsym8ibnwkaidxmgp73mg0sdniwsyn6ppskh74246h29bbcy"))))
+ (arguments
+ (list
+ #:tests? #f ;require fetching submodules
+ #:configure-flags #~(list "-DCMAKE_POSITION_INDEPENDENT_CODE=ON")
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'install 'install-extra-headers
+ (lambda _
+ (with-directory-excursion "../source/extras"
+ (for-each
+ (lambda (dir)
+ (let ((dir (string-append dir "/include/rapidcheck/"))
+ (dest (string-append #$output
+ "/include/rapidcheck")))
+ (copy-recursively dir dest)))
+ '("boost" "boost_test" "catch" "gmock" "gtest"))))))))
+ (build-system cmake-build-system)
+ (home-page "https://github.com/emil-e/rapidcheck")
+ (synopsis "Property based testing framework for C++")
+ (description "Rapidcheck is a property based testing framework for C++.
+It works by generating random data to try and find a case breaks your given
+pre-condition.")
+ (license license:bsd-2))))
+
(define-public umockdev
(package
(name "umockdev")

base-commit: 6fe9a004dba2d4ddf69ff6f1714af15ffaa7e62a
--
2.40.1
J
[PATCH v3 2/2] gnu: nix: Update to 2.16.1.
(address . 63893@debbugs.gnu.org)
1bb01ed6f9710f2cb8cdaac882154de33f56c971.1686493692.git.jgart@dismail.de
* gnu/packages/package-management.scm (nix): Update to 2.16.1.
[source]: Use HTTPS for package source.
[inputs]: Add nlohmann-json.
[native-inputs]: Add rapidcheck.
[arguments]<#:phases>: In phase "check", change the value of environment
variable "NIX_STORE" to "/nix/store" temporarily.

* gnu/packages/patches/nix-dont-build-html-doc.diff: Update.

Co-authored-by: jgart <jgart@dismail.de>
---

Oops v3, forgot to add in the actual changes that were in the staging area ;()

gnu/packages/package-management.scm | 28 ++++++++++++----
.../patches/nix-dont-build-html-doc.diff | 33 ++++++++++++++-----
2 files changed, 47 insertions(+), 14 deletions(-)

Toggle diff (137 lines)
diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
index 4791880375..bd989405c2 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -20,7 +20,8 @@
;;; Copyright © 2021 Ivan Gankevich <i.gankevich@spbu.ru>
;;; Copyright © 2021, 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2021 John Kehayias <john.kehayias@protonmail.com>
-;;; Copyright © 2022 Zhu Zihao <all_but_last@163.com>
+;;; Copyright © 2022, 2023 Zhu Zihao <all_but_last@163.com>
+;;; Copyright © 2023 jgart <jgart@dismail.de>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -56,6 +57,7 @@ (define-module (gnu packages package-management)
#:use-module (gnu packages compression)
#:use-module (gnu packages cmake)
#:use-module (gnu packages cpio)
+ #:use-module (gnu packages cpp)
#:use-module (gnu packages crypto)
#:use-module (gnu packages curl)
#:use-module (gnu packages databases)
@@ -731,16 +733,16 @@ (define-public guix-modules
(define-public nix
(package
(name "nix")
- (version "2.5.1")
+ (version "2.16.1")
(source
(origin
(method git-fetch)
(uri (git-reference
- (url "http://github.com/NixOS/nix")
+ (url "https://github.com/NixOS/nix")
(commit version)))
(file-name (git-file-name name version))
(sha256
- (base32 "1m8rmv8i6lg83pmalvjlq1fn8mcghn3ngjv3kw1kqsa45ymj5sqq"))
+ (base32 "1rca8ljd33dmvh9bqk6sy1zxk97aawcr6k1f7hlm4d1cd9mrcw7x"))
(patches
(search-patches "nix-dont-build-html-doc.diff"))))
(build-system gnu-build-system)
@@ -757,7 +759,19 @@ (define-public nix
(apply invoke "make" "install"
(string-append "sysconfdir=" etc)
(string-append "profiledir=" etc "/profile.d")
- make-flags)))))))
+ make-flags))))
+ (replace 'check
+ (lambda args
+ ;; Some test expect environment variable NIX_STORE to be
+ ;; "/nix/store"
+ (let ((original-NIX_STORE (getenv "NIX_STORE")))
+ (dynamic-wind
+ (lambda ()
+ (setenv "NIX_STORE" "/nix/store"))
+ (lambda ()
+ (apply (assoc-ref %standard-phases 'check) args))
+ (lambda ()
+ (setenv "NIX_STORE" original-NIX_STORE)))))))))
(native-inputs
(list autoconf
autoconf-archive
@@ -767,7 +781,8 @@ (define-public nix
googletest
jq
libtool
- pkg-config))
+ pkg-config
+ rapidcheck))
(inputs
(append (list boost
brotli
@@ -779,6 +794,7 @@ (define-public nix
libseccomp
libsodium
lowdown
+ nlohmann-json
openssl
sqlite
xz
diff --git a/gnu/packages/patches/nix-dont-build-html-doc.diff b/gnu/packages/patches/nix-dont-build-html-doc.diff
index 79142bc215..2eb45117b0 100644
--- a/gnu/packages/patches/nix-dont-build-html-doc.diff
+++ b/gnu/packages/patches/nix-dont-build-html-doc.diff
@@ -3,24 +3,41 @@ We can't simply disable it because we need manpages.
Author: Zhu Zihao <all_but_last@163.com>
-diff --git a/doc/manual/local.mk b/doc/manual/local.mk
-index e43d9f2fb..c323d1847 100644
--- a/doc/manual/local.mk
+++ b/doc/manual/local.mk
-@@ -69,8 +69,6 @@ $(d)/builtins.json: $(bindir)/nix
+@@ -138,11 +138,6 @@
$(trace-gen) $(dummy-env) NIX_PATH=nix/corepkgs=corepkgs $(bindir)/nix __dump-builtins > $@.tmp
@mv $@.tmp $@
-# Generate the HTML manual.
+-.PHONY: manual-html
+-manual-html: $(docdir)/manual/index.html
-install: $(docdir)/manual/index.html
-
+-
# Generate 'nix' manpages.
install: $(mandir)/man1/nix3-manpages
-@@ -94,7 +92,5 @@ doc/manual/generated/man1/nix3-manpages: $(d)/src/command-ref/new-cli
+ man: doc/manual/generated/man1/nix3-manpages
+@@ -167,23 +162,4 @@
done
@touch $@
--$(docdir)/manual/index.html: $(MANUAL_SRCS) $(d)/book.toml $(d)/custom.css $(d)/src/SUMMARY.md $(d)/src/command-ref/new-cli $(d)/src/command-ref/conf-file.md $(d)/src/expressions/builtins.md $(call rwildcard, $(d)/src, *.md)
-- $(trace-gen) RUST_LOG=warn mdbook build doc/manual -d $(DESTDIR)$(docdir)/manual
-
+-$(docdir)/manual/index.html: $(MANUAL_SRCS) $(d)/book.toml $(d)/anchors.jq $(d)/custom.css $(d)/src/SUMMARY.md $(d)/src/command-ref/new-cli $(d)/src/contributing/experimental-feature-descriptions.md $(d)/src/command-ref/conf-file.md $(d)/src/language/builtins.md
+- $(trace-gen) \
+- tmp="$$(mktemp -d)"; \
+- cp -r doc/manual "$$tmp"; \
+- find "$$tmp" -name '*.md' | while read -r file; do \
+- $(call process-includes,$$file,$$file); \
+- done; \
+- find "$$tmp" -name '*.md' | while read -r file; do \
+- docroot="$$(realpath --relative-to="$$(dirname "$$file")" $$tmp/manual/src)"; \
+- sed -i "s,@docroot@,$$docroot,g" "$$file"; \
+- done; \
+- set -euo pipefail; \
+- RUST_LOG=warn mdbook build "$$tmp/manual" -d $(DESTDIR)$(docdir)/manual.tmp 2>&1 \
+- | { grep -Fv "because fragment resolution isn't implemented" || :; }; \
+- rm -rf "$$tmp/manual"
+- @rm -rf $(DESTDIR)$(docdir)/manual
+- @mv $(DESTDIR)$(docdir)/manual.tmp/html $(DESTDIR)$(docdir)/manual
+- @rm -rf $(DESTDIR)$(docdir)/manual.tmp
+-
endif
--
2.40.1
Z
Z
Zhu Zihao wrote on 13 Jun 2023 11:17
Re: [PATCH v2 2/2] gnu: nix: Update to 2.16.1.
(name . jgart)(address . jgart@dismail.de)(address . 63893@debbugs.gnu.org)
86wn07vhys.fsf@163.com
jgart <jgart@dismail.de> writes:

LGTM, thanks a lot!

--
Retrieve my PGP public key:

gpg --recv-keys B3EBC086AB0EBC0F45E0B4D433DB374BCEE4D9DC

Zihao
-----BEGIN PGP SIGNATURE-----

iIsEARYIADMWIQT4UAIrVkIEZilSHr2K2nJqP6LM8gUCZIg0SxUcYWxsX2J1dF9s
YXN0QDE2My5jb20ACgkQitpyaj+izPJuMgEA+/EOfs0+MGoeccFDcvPAfl+WafJS
oYemDAtj0LeIiMMA/incwbx87M9ZWTuUDjihNMXzhp+K2rKSTV1yK1D0HQAL
=ML6W
-----END PGP SIGNATURE-----

Z
Z
Zhu Zihao wrote on 19 Jun 2023 17:47
Re: [PATCH v3 2/2] gnu: nix: Update to 2.16.1.
(name . jgart)(address . jgart@dismail.de)(address . 63893@debbugs.gnu.org)
86a5wvjvtm.fsf@163.com
Hi, jgart!

I think the patch (includes your modification) is quite good for daily
usage, and I don't meet any bugs. Can you help commit these changes? Thanks!

--
Retrieve my PGP public key:

gpg --recv-keys B3EBC086AB0EBC0F45E0B4D433DB374BCEE4D9DC

Zihao
-----BEGIN PGP SIGNATURE-----

iIsEARYIADMWIQT4UAIrVkIEZilSHr2K2nJqP6LM8gUCZJB5JRUcYWxsX2J1dF9s
YXN0QDE2My5jb20ACgkQitpyaj+izPJ5vQD6Axytwx4gcRAlw3jAzuO/WjGSWsav
m8VFcEdUb9gcvboA+gPk67WRxdi+j3TfD4NJtV1n9B8ISPYKrM3tAiZ8N6cL
=4jHj
-----END PGP SIGNATURE-----

J
f36db6173f0f0631619bd05f432ebf81@dismail.de
retitle 63893 [PATCH v3 2/2] gnu: nix: Update to 2.16.1
J
(name . Zhu Zihao)(address . all_but_last@163.com)
539dd9efe4a213ea3f6df97cbb2b2f7a@dismail.de
Hi Trofi,

If you find the time, would you be able to help review this patch series?

I saw that you've done a fare amount of work on guix/nix packaging in nix-guix-gentoo and could use your expertise in this area for reviewing this patch set:


Feel free to send a v4 patch and add yourself as co-author if you'd like to help directly.

Also, feel free to ignore if you don't have the time to review this one or help out on it.

I could particular use some guidance on enabling the tests for rapidcheck. My cmake knowledge is very fresh.

all best,

jgart
J
(address . control@debbugs.gnu.org)(address . control@debbugs.gnu.org)
5b326a51bbfee6d23f23689c92ae928a@dismail.de
block 63546 by 63893
S
S
Sergey Trofimov wrote on 24 Jun 2023 21:34
(name . jgart)(address . jgart@dismail.de)
878rc8zm77.fsf@sarg.org.ru
Hi jgart,

I'm not that trofi you're referencing to. You could find the right
email in their github profile.

"jgart" <jgart@dismail.de> writes:

Toggle quote (12 lines)
> Hi Trofi,
>
> If you find the time, would you be able to help review this
> patch series?
>
> I saw that you've done a fare amount of work on guix/nix
> packaging in
> nix-guix-gentoo and could use your expertise in this area for
> reviewing this
> patch set:
>
> https://github.com/trofi/nix-guix-gentoo
J
(name . Sergey Trofimov)(address . sarg@sarg.org.ru)
e407a6f1232efbd7781bb3ad6b24f016@dismail.de
hi Sergey,

Oh funny, ok, thanks for letting me know ;()
J
gnu: nix: Update to 2.16.1
(address . slyich@gmail.com)(address . 63893@debbugs.gnu.org)
a5891041884498ac454db9187b845212@dismail.de
Hi Trofi,

I saw that you've done a fare amount of work on guix/nix packaging in nix-guix-gentoo and could use your expertise in this area for reviewing this patch set:


If you find the time, would you be able to help review this patch series? It would be much appreciated.

Feel free to send a v4 patch and add yourself as co-author if you'd like to help directly.

Also, feel free to ignore if you don't have the time to review this one or help out on it.

I could particular use some guidance on enabling the tests for rapidcheck. My cmake knowledge is very fresh.

all best,

jgart

https://whereis.???/
S
S
Sergei Trofimovich wrote on 27 Jun 2023 00:16
(name . jgart)(address . jgart@dismail.de)(address . 63893@debbugs.gnu.org)
20230626231608.355b90b1@nz
On Mon, 26 Jun 2023 21:41:21 +0000
"jgart" <jgart@dismail.de> wrote:

Toggle quote (21 lines)
> Hi Trofi,
>
> I saw that you've done a fare amount of work on guix/nix packaging in nix-guix-gentoo and could use your expertise in this area for reviewing this patch set:
>
> https://github.com/trofi/nix-guix-gentoo
>
> If you find the time, would you be able to help review this patch series? It would be much appreciated.
>
> Feel free to send a v4 patch and add yourself as co-author if you'd like to help directly.
>
> Also, feel free to ignore if you don't have the time to review this one or help out on it.
>
> I could particular use some guidance on enabling the tests for rapidcheck. My cmake knowledge is very fresh.
>
> all best,
>
> jgart
>
> https://whereis.???/


Hi Jorge!

I guess you mean this series:


Those look good to me. I did not runtime-test it though.

Note: I don't have push access to `guix` repository and I don't use
`guix` on a daily basis. I mainly maintain `guix` install on top of
gentoo as defined in


I suggest runtime-testing it as well locally: try to install `nix` and
run a few commands like `nix-channel --update` / `nix-shell -p re2c`
just to make sure daemon is configured correctly.

Hope that helps.

Good luck!

--

Sergei
J
(name . Sergei Trofimovich)(address . slyich@gmail.com)(address . 63893@debbugs.gnu.org)
6616df3cc64662087b859521664f3387@dismail.de
Toggle quote (2 lines)
> Those look good to me. I did not runtime-test it though.

Hi Sergei,

Thanks for the message.

Are you running the tests successfully for rapidcheck in your ebuild version?

I don't know portage, unfortunately.

We'd like to get the tests running and passing for rapidcheck but they are currently disabled because we are not sure how to run the test suite for rapidcheck.

Have you had any success running the tests for rapidcheck?

all best,

jgart (Jorge)
S
S
Sergei Trofimovich wrote on 27 Jun 2023 09:05
(name . jgart)(address . jgart@dismail.de)(address . 63893@debbugs.gnu.org)
20230627080542.6e7ed518@nz
On Tue, 27 Jun 2023 06:03:03 +0000
"jgart" <jgart@dismail.de> wrote:

Toggle quote (8 lines)
> > Those look good to me. I did not runtime-test it though.
>
> Hi Sergei,
>
> Thanks for the message.
>
> Are you running the tests successfully for rapidcheck in your ebuild version?

I do not enable `rapidcheck` tests. At least in theory enabling tests
via `-DRC_ENABLE_TESTS=ON` should be enough. In practice
`ext/CMakeLists.txt` implies a certain layout of `check2`, `gtest` and
`boost` dependencies checked out locally:

git submodule:

if (RC_ENABLE_TESTS OR RC_ENABLE_CATCH)
add_subdirectory(catch)
endif()

another git submodule:

if ((RC_ENABLE_GMOCK OR RC_ENABLE_GTEST) AND RC_ENABLE_TESTS)
# On Windows, gmock/gtest defaults to static CRT which is not compatible
# with the way RapidCheck is currently built
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
add_subdirectory(googletest)
endif()

ad-hoc checkout with a stand alone script:

if (RC_ENABLE_BOOST AND RC_ENABLE_TESTS)
if (NOT EXISTS "${CMAKE_CURRENT_LIST_DIR}/boost")
execute_process(
COMMAND "sh" "get_boost.sh"
WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}")
endif()
add_library(boost INTERFACE)
target_include_directories(boost INTERFACE boost)
endif()

I did not try to satisfy these requirements. Ideally upstream should be
fixed to use already installed libraries. But I'm not very well versed
in `cmake` to propose such a change just yet.

Toggle quote (10 lines)
> I don't know portage, unfortunately.
>
> We'd like to get the tests running and passing for rapidcheck but they are currently disabled because we are not sure how to run the test suite for rapidcheck.
>
> Have you had any success running the tests for rapidcheck?
>
> all best,
>
> jgart (Jorge)

--

Sergei
J
Re: [PATCH v3 2/2] gnu: nix: Update to 2.16.1
(address . control@debbugs.gnu.org)
a88fd1fd7af35842e19482e3b7006070@dismail.de
Hi Zhu,

Thanks for the contribution. APPLIED. Sorry for the delay.

I tested this patch series in the following Guix container:

(use-modules (gnu))
(use-package-modules certs package-management)
(use-service-modules nix)

(define %simple-os
(operating-system
(host-name "komputilo")
(timezone "Europe/Berlin")
(locale "en_US.UTF-8")
(bootloader (bootloader-configuration
(bootloader grub-bootloader)
(targets '("/dev/sdX"))))
(file-systems (cons (file-system
(device (file-system-label "my-root"))
(mount-point "/")
(type "ext4"))
%base-file-systems))
(firmware '())
(packages (cons nss-certs %base-packages))
(users (cons (user-account
(name "alice")
(comment "Bob's sister")
(group "users")
(supplementary-groups '("wheel" "audio" "video")))
%base-user-accounts))))

(define-syntax-rule (simple-operating-system user-services ...)
"Return an operating system that includes USER-SERVICES in addition to
%BASE-SERVICES."
(operating-system (inherit %simple-os)
(services (cons* user-services ... %base-services))))

(simple-operating-system (service nix-service-type))


Session:

root@komputilo /# nnn
bash: nnn: command not found
root@komputilo /# ls .
./ ../
root@komputilo /# ls -a
./ ../ bin/ dev/ etc/ gnu/ home/ nix/ proc/ root/ run/ tmp/ usr/ var/
root@komputilo /# cd root
root@komputilo /root# ls
root@komputilo /root# ls -a
./ ../ .Xdefaults .bash_profile .bashrc .cache/ .config/ .guile .nix-channels .nix-defexpr/ .nix-profile .zprofile
root@komputilo /root# ls .nix-profile
bin manifest.nix share
root@komputilo /root# ls .nix-profile/bin/
nnn
root@komputilo /root# .nix-profile/bin/nnn
set HOME
root@komputilo /root# ./.nix-profile/bin/nnn
set HOME
root@komputilo /root# export HOME=/home/root
root@komputilo /root# ./.nix-profile/bin/nnn
root@komputilo /root# nix-env -q
WARNING: terminal is not fully functional
Press RETURN to continue
nnn-4.8
root@komputilo /root# nix-env --version
nix-env (Nix) 2.16.1
Closed
?