aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/manual/src/contributing/hacking.md1
-rw-r--r--flake.nix20
-rw-r--r--package.nix4
-rwxr-xr-xreleng/release-tests.sh36
-rw-r--r--src/libmain/progress-bar.cc4
5 files changed, 61 insertions, 4 deletions
diff --git a/doc/manual/src/contributing/hacking.md b/doc/manual/src/contributing/hacking.md
index 8577a6a2e..37c96a5c0 100644
--- a/doc/manual/src/contributing/hacking.md
+++ b/doc/manual/src/contributing/hacking.md
@@ -175,6 +175,7 @@ These are specified in `crossSystems` in `flake.nix`; feel free to submit change
- `armv6l-linux`
- `armv7l-linux`
+- `aarch64-linux`
- `riscv64-linux`
For example, to cross-compile Lix for `armv6l-linux` from another Linux, use the following:
diff --git a/flake.nix b/flake.nix
index d2eefca76..c29111ed2 100644
--- a/flake.nix
+++ b/flake.nix
@@ -90,6 +90,7 @@
"armv6l-linux"
"armv7l-linux"
"riscv64-linux"
+ "aarch64-linux"
# FIXME: still broken in 24.05: fails to build rustc(??) due to missing -lstdc++ dep
# "x86_64-freebsd"
# FIXME: broken dev shell due to python
@@ -328,6 +329,25 @@
pkgs = nixpkgsFor.x86_64-linux.native;
};
+ releaseTests = lib.foldl lib.recursiveUpdate { } [
+ (lib.genAttrs (linux64BitSystems ++ darwinSystems) (system: {
+ nativeBuild = self.packages.${system}.nix;
+ }))
+ (lib.genAttrs (linux64BitSystems) (system: {
+ staticBuild = self.packages.${system}.nix-static;
+ }))
+ {
+ x86_64-linux = {
+ # TODO add more cross/static release targets?
+ crossBuild.aarch64-linux = self.packages.x86_64-linux.nix-aarch64-linux;
+
+ # TODO wire up a nixos installer test with that lix and
+ # run it, once nixpkgs can actually do that (again). :/
+ # # nix build .#nixosTests.installer.{btrfsSimple,luksroot,lvm,simple,switchToFlake}
+ };
+ }
+ ];
+
# NOTE *do not* add fresh derivations to checks, always add them to
# hydraJobs first (so CI will pick them up) and only link them here
checks = forAvailableSystems (
diff --git a/package.nix b/package.nix
index 600be11e9..453a5f807 100644
--- a/package.nix
+++ b/package.nix
@@ -501,9 +501,9 @@ stdenv.mkDerivation (finalAttrs: {
return
fi
- PATH=$prefix/bin:$PATH
+ PATH=$prefix/bin''${PATH:+:''${PATH}}
unset PYTHONPATH
- export MANPATH=$out/share/man:$MANPATH
+ export MANPATH=$out/share/man''${MANPATH:+:''${MANPATH}}
# Make bash completion work.
XDG_DATA_DIRS+=:$out/share
diff --git a/releng/release-tests.sh b/releng/release-tests.sh
new file mode 100755
index 000000000..c0a9b2e33
--- /dev/null
+++ b/releng/release-tests.sh
@@ -0,0 +1,36 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+shopt -s inherit_errexit failglob
+
+nixpkgss=(
+ "$(nix eval --impure --raw --expr '(import ./flake.nix).inputs.nixpkgs.url')"
+ "github:NixOS/nixpkgs/nixos-unstable-small"
+)
+jobs=(
+ $(nix eval \
+ --json --apply '
+ let f = n: t:
+ if builtins.isAttrs t
+ then (if t.type or "" == "derivation"
+ then [ n ]
+ else builtins.concatMap (m: f "${n}.${m}" t.${m}) (builtins.attrNames t))
+ else [];
+ in f ".#.releaseTests"
+ ' \
+ '.#.releaseTests' \
+ | jq -r '.[]'
+ )
+)
+
+for override in "${nixpkgss}"
+do
+ (
+ set -x
+ nix build \
+ --log-format multiline \
+ --no-link \
+ --override-input nixpkgs "$override" \
+ "${jobs[@]}"
+ )
+done
diff --git a/src/libmain/progress-bar.cc b/src/libmain/progress-bar.cc
index f5a22f41b..48a52f442 100644
--- a/src/libmain/progress-bar.cc
+++ b/src/libmain/progress-bar.cc
@@ -356,7 +356,7 @@ std::chrono::milliseconds ProgressBar::draw(State & state, const std::optional<s
line += "]";
}
if (printMultiline && !line.empty()) {
- writeToStderr(filterANSIEscapes(line, false, width) + "\n");
+ writeToStderr(filterANSIEscapes(line, false, width) + ANSI_NORMAL "\n");
state.lastLines++;
}
@@ -398,7 +398,7 @@ std::chrono::milliseconds ProgressBar::draw(State & state, const std::optional<s
if (printMultiline) {
if (state.lastLines < (height -1)) {
- writeToStderr(filterANSIEscapes(activity_line, false, width) + "\n");
+ writeToStderr(filterANSIEscapes(activity_line, false, width) + ANSI_NORMAL "\n");
state.lastLines++;
} else moreActivities++;
}