Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

system/nix: Updated to 2.15.3. #125

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
195 changes: 160 additions & 35 deletions system/nix/fix_nix_options.patch
Original file line number Diff line number Diff line change
@@ -1,40 +1,36 @@
diff --git a/doc/manual/local.mk b/doc/manual/local.mk
index f43510b..1e1e62d 100644
index 63e7e61..e131bde 100644
--- a/doc/manual/local.mk
+++ b/doc/manual/local.mk
@@ -24,7 +24,7 @@ dummy-env = env -i \
@@ -31,7 +31,7 @@ dummy-env = env -i \
NIX_STATE_DIR=/dummy \
NIX_CONFIG='cores = 0'

-nix-eval = $(dummy-env) $(bindir)/nix eval --experimental-features nix-command -I nix/corepkgs=corepkgs --store dummy:// --impure --raw
+nix-eval = $(dummy-env) $(nix_DIR)/nix eval --experimental-features nix-command -I nix/corepkgs=corepkgs --store dummy:// --impure --raw

$(d)/%.1: $(d)/src/command-ref/%.md
@printf "Title: %s\n\n" "$$(basename $@ .1)" > $^.tmp
@@ -48,29 +48,29 @@ $(d)/src/SUMMARY.md: $(d)/src/SUMMARY.md.in $(d)/src/command-ref/new-cli
$(trace-gen) cat doc/manual/src/SUMMARY.md.in | while IFS= read line; do if [[ $$line = @manpages@ ]]; then cat doc/manual/src/command-ref/new-cli/SUMMARY.md; else echo "$$line"; fi; done > [email protected]
@mv [email protected] $@
# re-implement mdBook's include directive to make it usable for terminal output and for proper @docroot@ substitution
define process-includes
@@ -89,46 +89,46 @@ $(d)/src/SUMMARY.md: $(d)/src/SUMMARY.md.in $(d)/src/command-ref/new-cli $(d)/sr
@cp $< $@
@$(call process-includes,$@,$@)

-$(d)/src/command-ref/new-cli: $(d)/nix.json $(d)/generate-manpage.nix $(bindir)/nix
+$(d)/src/command-ref/new-cli: $(d)/nix.json $(d)/generate-manpage.nix $(nix_DIR)/nix
@rm -rf $@
$(trace-gen) $(nix-eval) --write-to [email protected] --expr 'import doc/manual/generate-manpage.nix { toplevel = builtins.readFile $<; }'
@# @docroot@: https://nixos.org/manual/nix/unstable/contributing/hacking.html#docroot-variable
$(trace-gen) sed -i [email protected]/*.md -e 's^@docroot@^../..^g'
-$(d)/src/command-ref/new-cli: $(d)/nix.json $(d)/utils.nix $(d)/generate-manpage.nix $(bindir)/nix
+$(d)/src/command-ref/new-cli: $(d)/nix.json $(d)/utils.nix $(d)/generate-manpage.nix $(nix_DIR)/nix
@rm -rf $@ [email protected]
$(trace-gen) $(nix-eval) --write-to [email protected] --expr 'import doc/manual/generate-manpage.nix (builtins.readFile $<)'
@mv [email protected] $@

-$(d)/src/command-ref/conf-file.md: $(d)/conf-file.json $(d)/generate-options.nix $(d)/src/command-ref/conf-file-prefix.md $(bindir)/nix
+$(d)/src/command-ref/conf-file.md: $(d)/conf-file.json $(d)/generate-options.nix $(d)/src/command-ref/conf-file-prefix.md $(nix_DIR)/nix
-$(d)/src/command-ref/conf-file.md: $(d)/conf-file.json $(d)/utils.nix $(d)/src/command-ref/conf-file-prefix.md $(d)/src/command-ref/experimental-features-shortlist.md $(bindir)/nix
+$(d)/src/command-ref/conf-file.md: $(d)/conf-file.json $(d)/utils.nix $(d)/src/command-ref/conf-file-prefix.md $(d)/src/command-ref/experimental-features-shortlist.md $(nix_DIR)/nix
@cat doc/manual/src/command-ref/conf-file-prefix.md > [email protected]
@# @docroot@: https://nixos.org/manual/nix/unstable/contributing/hacking.html#docroot-variable
$(trace-gen) $(nix-eval) --expr 'import doc/manual/generate-options.nix (builtins.fromJSON (builtins.readFile $<))' \
| sed -e 's^@docroot@^..^g'>> [email protected]
$(trace-gen) $(nix-eval) --expr '(import doc/manual/utils.nix).showSettings { useAnchors = true; } (builtins.fromJSON (builtins.readFile $<))' >> [email protected];
@mv [email protected] $@

-$(d)/nix.json: $(bindir)/nix
- $(trace-gen) $(dummy-env) $(bindir)/nix __dump-args > [email protected]
- $(trace-gen) $(dummy-env) $(bindir)/nix __dump-cli > [email protected]
+$(d)/nix.json: $(nix_DIR)/nix
+ $(trace-gen) $(dummy-env) $(nix_DIR)/nix __dump-args > [email protected]
+ $(trace-gen) $(dummy-env) $(nix_DIR)/nix __dump-cli > [email protected]
@mv [email protected] $@

-$(d)/conf-file.json: $(bindir)/nix
Expand All @@ -43,12 +39,28 @@ index f43510b..1e1e62d 100644
+ $(trace-gen) $(dummy-env) $(nix_DIR)/nix show-config --json --experimental-features nix-command > [email protected]
@mv [email protected] $@

-$(d)/src/contributing/experimental-feature-descriptions.md: $(d)/xp-features.json $(d)/utils.nix $(d)/generate-xp-features.nix $(bindir)/nix
+$(d)/src/contributing/experimental-feature-descriptions.md: $(d)/xp-features.json $(d)/utils.nix $(d)/generate-xp-features.nix $(nix_DIR)/nix
@rm -rf $@ [email protected]
$(trace-gen) $(nix-eval) --write-to [email protected] --expr 'import doc/manual/generate-xp-features.nix (builtins.fromJSON (builtins.readFile $<))'
@mv [email protected] $@

-$(d)/src/command-ref/experimental-features-shortlist.md: $(d)/xp-features.json $(d)/utils.nix $(d)/generate-xp-features-shortlist.nix $(bindir)/nix
+$(d)/src/command-ref/experimental-features-shortlist.md: $(d)/xp-features.json $(d)/utils.nix $(d)/generate-xp-features-shortlist.nix $(nix_DIR)/nix
@rm -rf $@ [email protected]
$(trace-gen) $(nix-eval) --write-to [email protected] --expr 'import doc/manual/generate-xp-features-shortlist.nix (builtins.fromJSON (builtins.readFile $<))'
@mv [email protected] $@

-$(d)/xp-features.json: $(bindir)/nix
- $(trace-gen) $(dummy-env) NIX_PATH=nix/corepkgs=corepkgs $(bindir)/nix __dump-xp-features > [email protected]
+$(d)/xp-features.json: $(nix_DIR)/nix
+ $(trace-gen) $(dummy-env) NIX_PATH=nix/corepkgs=corepkgs $(nix_DIR)/nix __dump-xp-features > [email protected]
@mv [email protected] $@

-$(d)/src/language/builtins.md: $(d)/builtins.json $(d)/generate-builtins.nix $(d)/src/language/builtins-prefix.md $(bindir)/nix
+$(d)/src/language/builtins.md: $(d)/builtins.json $(d)/generate-builtins.nix $(d)/src/language/builtins-prefix.md $(nix_DIR)/nix
@cat doc/manual/src/language/builtins-prefix.md > [email protected]
@# @docroot@: https://nixos.org/manual/nix/unstable/contributing/hacking.html#docroot-variable
$(trace-gen) $(nix-eval) --expr 'import doc/manual/generate-builtins.nix (builtins.fromJSON (builtins.readFile $<))' \
@@ -78,8 +78,8 @@ $(d)/src/language/builtins.md: $(d)/builtins.json $(d)/generate-builtins.nix $(d
$(trace-gen) $(nix-eval) --expr 'import doc/manual/generate-builtins.nix (builtins.fromJSON (builtins.readFile $<))' >> [email protected];
@cat doc/manual/src/language/builtins-suffix.md >> [email protected]
@mv [email protected] $@

Expand All @@ -60,42 +72,62 @@ index f43510b..1e1e62d 100644

# Generate the HTML manual.
diff --git a/doc/manual/local.mk b/doc/manual/local.mk
index 1e1e62d..3978847 100644
index e131bde..ba2460d 100644
--- a/doc/manual/local.mk
+++ b/doc/manual/local.mk
@@ -109,12 +109,12 @@ doc/manual/generated/man1/nix3-manpages: $(d)/src/command-ref/new-cli
@@ -161,22 +161,22 @@ doc/manual/generated/man1/nix3-manpages: $(d)/src/command-ref/new-cli
@touch $@

$(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/command-ref/conf-file.md $(d)/src/language/builtins.md
$(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) \
- set -euo pipefail; \
- RUST_LOG=warn mdbook build doc/manual -d $(DESTDIR)$(docdir)/manual.tmp 2>&1 \
- | { grep -Fv "because fragment resolution isn't implemented" || :; }
- 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
+ # $(trace-gen) \
+ # set -euo pipefail; \
+ # RUST_LOG=warn mdbook build doc/manual -d $(DESTDIR)$(docdir)/manual.tmp 2>&1 \
+ # | { grep -Fv "because fragment resolution isn't implemented" || :; }
+ # 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
diff --git a/Makefile b/Makefile
index c1a1ce2..3ec1423 100644
index d6b4947..aead461 100644
--- a/Makefile
+++ b/Makefile
@@ -34,6 +34,8 @@ else
@@ -42,6 +42,8 @@ else
GLOBAL_CXXFLAGS += -O0 -U_FORTIFY_SOURCE
endif

+GLOBAL_CFLAGS += $(CPPFLAGS)
+
include mk/lib.mk

GLOBAL_CXXFLAGS += -g -Wall -include config.h -std=c++17 -I src
GLOBAL_CXXFLAGS += -g -Wall -include config.h -std=c++2a -I src
diff --git a/src/libstore/sqlite.cc b/src/libstore/sqlite.cc
index 871f2f3..21897d0 100644
--- a/src/libstore/sqlite.cc
Expand All @@ -109,3 +141,96 @@ index 871f2f3..21897d0 100644

auto path = sqlite3_db_filename(db, nullptr);
auto errMsg = sqlite3_errmsg(db);
diff --git a/flake.nix b/flake.nix
index 71f6270..86c0a4f 100644
--- a/flake.nix
+++ b/flake.nix
@@ -540,6 +540,8 @@
lcovFilter = [ "*/boost/*" "*-tab.*" ];

hardeningDisable = ["fortify"];
+
+ NIX_CFLAGS_COMPILE = "-DCOVERAGE=1";
};

# API docs for Nix's unstable internal C++ interfaces.
diff --git a/src/libexpr/tests/value/context.cc b/src/libexpr/tests/value/context.cc
index 083359b..88b3f32 100644
--- a/src/libexpr/tests/value/context.cc
+++ b/src/libexpr/tests/value/context.cc
@@ -116,6 +116,8 @@ Gen<NixStringContextElem> Arbitrary<NixStringContextElem>::arbitrary()

namespace nix {

+#ifndef COVERAGE
+
RC_GTEST_FIXTURE_PROP(
NixStringContextElemTest,
prop_round_rip,
@@ -124,4 +126,6 @@ RC_GTEST_FIXTURE_PROP(
RC_ASSERT(o == NixStringContextElem::parse(store(), o.to_string(store())));
}

+#endif
+
}
diff --git a/src/libstore/tests/derived-path.cc b/src/libstore/tests/derived-path.cc
index e6d32db..343f7aa 100644
--- a/src/libstore/tests/derived-path.cc
+++ b/src/libstore/tests/derived-path.cc
@@ -51,6 +51,8 @@ TEST_F(DerivedPathTest, force_init)
{
}

+#ifndef COVERAGE
+
RC_GTEST_FIXTURE_PROP(
DerivedPathTest,
prop_legacy_round_rip,
@@ -67,4 +69,6 @@ RC_GTEST_FIXTURE_PROP(
RC_ASSERT(o == DerivedPath::parse(*store, o.to_string(*store)));
}

+#endif
+
}
diff --git a/src/libstore/tests/outputs-spec.cc b/src/libstore/tests/outputs-spec.cc
index 984d1d9..2832cef 100644
--- a/src/libstore/tests/outputs-spec.cc
+++ b/src/libstore/tests/outputs-spec.cc
@@ -222,6 +222,8 @@ Gen<OutputsSpec> Arbitrary<OutputsSpec>::arbitrary()

namespace nix {

+#ifndef COVERAGE
+
RC_GTEST_PROP(
OutputsSpec,
prop_round_rip,
@@ -230,4 +232,6 @@ RC_GTEST_PROP(
RC_ASSERT(o == OutputsSpec::parse(o.to_string()));
}

+#endif
+
}
diff --git a/src/libstore/tests/path.cc b/src/libstore/tests/path.cc
index 430aa00..efa35ef 100644
--- a/src/libstore/tests/path.cc
+++ b/src/libstore/tests/path.cc
@@ -134,6 +134,8 @@ Gen<StorePath> Arbitrary<StorePath>::arbitrary()

namespace nix {

+#ifndef COVERAGE
+
RC_GTEST_FIXTURE_PROP(
StorePathTest,
prop_regex_accept,
@@ -150,4 +152,6 @@ RC_GTEST_FIXTURE_PROP(
RC_ASSERT(p == store->parseStorePath(store->printStorePath(p)));
}

+#endif
+
}
8 changes: 5 additions & 3 deletions system/nix/nix.SlackBuild
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
cd $(dirname $0) ; CWD=$(pwd)

PRGNAM=nix
VERSION=${VERSION:-2.13.6}
VERSION=${VERSION:-2.15.3}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
Expand Down Expand Up @@ -99,12 +99,13 @@ find -L . \

# - 20220325 bkw: patch from Debian, stops nix from installing
# /usr/bin/nix and its libraries during "make". spamming the real
# root partition is bad, m'kay? (Updated)
# root partition is bad, m'kay? (Updated).
# - The above patch was added thanks to Pragmatic Cypher, along with
# mdbook patch to make it disabled.
# - Added global CFLAGS
# - Added global CFLAGS.
# - Changed to ignore offset, since function hasn't still implemented
# in Slackware 15's sqlite.
# - Disabled rapidcheck tests in the coverage run.
patch -p1 < $CWD/fix_nix_options.patch

autoreconf -vfim
Expand All @@ -117,6 +118,7 @@ CXXFLAGS="$SLKCFLAGS" \
--mandir=/usr/man \
--docdir=/usr/doc/$PRGNAM-$VERSION \
--sysconfdir=/etc \
--enable-static=rapidcheck \
--build=$ARCH-slackware-linux \
--host=$ARCH-slackware-linux

Expand Down
8 changes: 4 additions & 4 deletions system/nix/nix.info
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
PRGNAM="nix"
VERSION="2.13.6"
VERSION="2.15.3"
HOMEPAGE="http://nixos.org/nix"
DOWNLOAD="https://github.com/NixOS/nix/archive/2.13.6/nix-2.13.6.tar.gz"
MD5SUM="8fd7108b28c2716e87bbac8797de46a1"
DOWNLOAD="https://github.com/NixOS/nix/archive/2.15.3/nix-2.15.3.tar.gz"
MD5SUM="2b5404f762f40f116fb57226001a7933"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES="graphviz gtest jq libeditline lowdown libcpuid nlohmann_json"
REQUIRES="graphviz gtest jq libcpuid libeditline librapidcheck lowdown nlohmann_json"
MAINTAINER="Pouria Rezaei"
EMAIL="[email protected]"
Loading