Skip to content

Commit f609feb

Browse files
Merge master into staging-next
2 parents b4e5dc1 + a94100d commit f609feb

File tree

136 files changed

+1629
-1382
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+1629
-1382
lines changed

doc/hooks/cmake.section.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,21 @@ The default value is `build`.
3333
#### `dontUseCmakeConfigure` {#dont-use-cmake-configure}
3434

3535
When set to true, don't use the predefined `cmakeConfigurePhase`.
36+
37+
## Controlling CTest invocation {#cmake-ctest}
38+
39+
By default tests are run by make in [`checkPhase`](#ssec-check-phase) or by [ninja](#ninja) if `ninja` is
40+
available in `nativeBuildInputs`. Makefile and Ninja generators produce the `test` target, which invokes `ctest` under the hood.
41+
This makes passing additional arguments to `ctest` difficult, so it's possible to invoke it directly in `checkPhase`
42+
by adding `ctestCheckHook` to `nativeCheckInputs`.
43+
44+
### CTest Variables {#cmake-ctest-variables}
45+
46+
#### `disabledTests` {#cmake-ctest-disabled-tests}
47+
48+
Allows to disable running a list of tests. Note that regular expressions are not supported by `disabledTests`, but
49+
it can be combined with `--exclude-regex` option.
50+
51+
#### `ctestFlags` {#cmake-ctest-flags}
52+
53+
Additional options passed to `ctest` together with `checkFlags`.

doc/redirects.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@
55
"chap-release-notes": [
66
"release-notes.html#chap-release-notes"
77
],
8+
"cmake-ctest": [
9+
"index.html#cmake-ctest"
10+
],
11+
"cmake-ctest-disabled-tests": [
12+
"index.html#cmake-ctest-disabled-tests"
13+
],
14+
"cmake-ctest-flags": [
15+
"index.html#cmake-ctest-flags"
16+
],
17+
"cmake-ctest-variables": [
18+
"index.html#cmake-ctest-variables"
19+
],
820
"ex-build-helpers-extendMkDerivation": [
921
"index.html#ex-build-helpers-extendMkDerivation"
1022
],

nixos/tests/all-tests.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,6 +1388,7 @@ in
13881388
tuptime = handleTest ./tuptime.nix { };
13891389
turbovnc-headless-server = handleTest ./turbovnc-headless-server.nix { };
13901390
turn-rs = handleTest ./turn-rs.nix { };
1391+
tusd = runTest ./tusd/default.nix;
13911392
tuxguitar = runTest ./tuxguitar.nix;
13921393
twingate = runTest ./twingate.nix;
13931394
typesense = handleTest ./typesense.nix { };

nixos/tests/tusd/default.nix

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{ pkgs, lib, ... }:
2+
3+
let
4+
port = 1080;
5+
6+
client =
7+
{ pkgs, ... }:
8+
{
9+
environment.systemPackages = [ pkgs.curl ];
10+
};
11+
12+
server =
13+
{ pkgs, ... }:
14+
{
15+
# tusd does not have a NixOS service yet.
16+
systemd.services.tusd = {
17+
wantedBy = [ "multi-user.target" ];
18+
19+
serviceConfig = {
20+
ExecStart = ''${pkgs.tusd}/bin/tusd -port "${toString port}" -upload-dir=/data'';
21+
};
22+
};
23+
networking.firewall.allowedTCPPorts = [ port ];
24+
};
25+
in
26+
{
27+
name = "tusd";
28+
meta.maintainers = with lib.maintainers; [
29+
nh2
30+
kalbasit
31+
];
32+
33+
nodes = {
34+
inherit server;
35+
inherit client;
36+
};
37+
38+
testScript = ''
39+
server.wait_for_unit("tusd.service")
40+
server.wait_for_open_port(${toString port})
41+
42+
# Create large file.
43+
client.succeed("${pkgs.coreutils}/bin/truncate --size=100M file-100M.bin")
44+
45+
# Upload it.
46+
client.succeed("${./tus-curl-upload.sh} file-100M.bin http://server:${toString port}/files/")
47+
48+
print("Upload succeeded")
49+
'';
50+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/usr/bin/env bash
2+
3+
# Adapted from:
4+
# - https://github.com/tus/tus.io/issues/96
5+
6+
if [ ! -f "${1}" ]; then
7+
echo -e "\n\033[1;31m✘\033[0m First argument needs to be an existing file.\n"
8+
exit 1
9+
fi
10+
11+
if [ -z "${2}" ]; then
12+
echo -e "\n\033[1;31m✘\033[0m Second argument needs to be the TUS server's URL.\n"
13+
exit 1
14+
fi
15+
16+
file=${1}
17+
TUS_URL=${2}
18+
filename=$(basename "${file}" | base64)
19+
filesize="$(wc -c <"${file}")"
20+
21+
# Apparently 'Location: ..' is terminated by CRLF. grep and awk faithfully
22+
# preserve the line ending, and the shell's $() substitution strips off the
23+
# final LF leaving you with a string that just ends with a CR.
24+
#
25+
# When the CR is printed, the cursor moves to the beginning of the line and
26+
# whatever gets printed next overwrites what was there.
27+
# ... | tr -d '\015'
28+
location=$(curl \
29+
--silent --show-error \
30+
-I \
31+
-X POST \
32+
-H "Tus-Resumable: 1.0.0" \
33+
-H "Content-Length: 0" \
34+
-H "Upload-Length: ${filesize}" \
35+
-H "Upload-Metadata: name ${filename}" \
36+
"${TUS_URL}" | grep 'Location:' | awk '{print $2}' | tr -d '\015')
37+
38+
if [ -n "${location}" ]; then
39+
curl \
40+
-X PATCH \
41+
-H "Tus-Resumable: 1.0.0" \
42+
-H "Upload-Offset: 0" \
43+
-H "Content-Length: ${filesize}" \
44+
-H "Content-Type: application/offset+octet-stream" \
45+
--data-binary "@${file}" \
46+
"${location}" -v
47+
else
48+
echo -e "\n\033[1;31m✘\033[0m File creation failed..\n"
49+
exit 1
50+
fi

nixos/tests/vector/default.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
file-sink = import ./file-sink.nix { inherit system pkgs; };
99
api = import ./api.nix { inherit system pkgs; };
1010
dnstap = import ./dnstap.nix { inherit system pkgs; };
11+
journald-clickhouse = import ./journald-clickhouse.nix { inherit system pkgs; };
1112
nginx-clickhouse = import ./nginx-clickhouse.nix { inherit system pkgs; };
1213
syslog-quickwit = import ./syslog-quickwit.nix { inherit system pkgs; };
1314
}
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
import ../make-test-python.nix (
2+
{ lib, pkgs, ... }:
3+
let
4+
# Take the original journald message and create a new payload which only
5+
# contains the relevant fields - these must match the database columns.
6+
journalVrlRemapTransform = {
7+
journald_remap = {
8+
inputs = [ "journald" ];
9+
type = "remap";
10+
source = ''
11+
m = {}
12+
m.app = .SYSLOG_IDENTIFIER
13+
m.host = .host
14+
m.severity = to_int(.PRIORITY) ?? 0
15+
m.level = to_syslog_level(m.severity) ?? ""
16+
m.message = strip_ansi_escape_codes!(.message)
17+
m.timestamp = .timestamp
18+
m.uid = to_int(._UID) ?? 0
19+
m.pid = to_int(._PID) ?? 0
20+
. = [m]
21+
'';
22+
};
23+
};
24+
in
25+
{
26+
name = "vector-journald-clickhouse";
27+
meta.maintainers = [ pkgs.lib.maintainers.happysalada ];
28+
29+
nodes = {
30+
clickhouse =
31+
{ config, pkgs, ... }:
32+
{
33+
virtualisation.diskSize = 5 * 1024;
34+
virtualisation.memorySize = 4096;
35+
36+
networking.firewall.allowedTCPPorts = [ 6000 ];
37+
38+
services.vector = {
39+
enable = true;
40+
journaldAccess = true;
41+
42+
settings = {
43+
sources = {
44+
journald = {
45+
type = "journald";
46+
};
47+
48+
vector_source = {
49+
type = "vector";
50+
address = "[::]:6000";
51+
};
52+
};
53+
54+
transforms = journalVrlRemapTransform;
55+
56+
sinks = {
57+
clickhouse = {
58+
type = "clickhouse";
59+
inputs = [
60+
"journald_remap"
61+
"vector_source"
62+
];
63+
endpoint = "http://localhost:8123";
64+
database = "journald";
65+
table = "logs";
66+
date_time_best_effort = true;
67+
};
68+
};
69+
};
70+
71+
};
72+
73+
services.clickhouse = {
74+
enable = true;
75+
};
76+
};
77+
78+
vector =
79+
{ config, pkgs, ... }:
80+
{
81+
services.vector = {
82+
enable = true;
83+
journaldAccess = true;
84+
85+
settings = {
86+
sources = {
87+
journald = {
88+
type = "journald";
89+
};
90+
};
91+
92+
transforms = journalVrlRemapTransform;
93+
94+
sinks = {
95+
vector_sink = {
96+
type = "vector";
97+
inputs = [ "journald_remap" ];
98+
address = "clickhouse:6000";
99+
};
100+
};
101+
};
102+
};
103+
};
104+
};
105+
106+
testScript =
107+
let
108+
# work around quote/substitution complexity by Nix, Perl, bash and SQL.
109+
databaseDDL = pkgs.writeText "database.sql" "CREATE DATABASE IF NOT EXISTS journald";
110+
111+
# https://clickhouse.com/blog/storing-log-data-in-clickhouse-fluent-bit-vector-open-telemetry
112+
tableDDL = pkgs.writeText "table.sql" ''
113+
CREATE TABLE IF NOT EXISTS journald.logs (
114+
timestamp DateTime64(6),
115+
app LowCardinality(String),
116+
host LowCardinality(String),
117+
level LowCardinality(String),
118+
severity UInt8,
119+
message String,
120+
uid UInt16,
121+
pid UInt32,
122+
)
123+
ENGINE = MergeTree()
124+
ORDER BY (host, app, timestamp)
125+
PARTITION BY toYYYYMM(timestamp)
126+
'';
127+
128+
selectQuery = pkgs.writeText "select.sql" ''
129+
SELECT COUNT(host) FROM journald.logs
130+
WHERE message LIKE '%Vector has started%'
131+
'';
132+
in
133+
''
134+
clickhouse.wait_for_unit("clickhouse")
135+
clickhouse.wait_for_open_port(6000)
136+
clickhouse.wait_for_open_port(8123)
137+
138+
clickhouse.succeed(
139+
"cat ${databaseDDL} | clickhouse-client"
140+
)
141+
142+
clickhouse.succeed(
143+
"cat ${tableDDL} | clickhouse-client"
144+
)
145+
146+
for machine in clickhouse, vector:
147+
machine.wait_for_unit("vector")
148+
machine.wait_until_succeeds(
149+
"journalctl -o cat -u vector.service | grep 'Vector has started'"
150+
)
151+
152+
clickhouse.wait_until_succeeds(
153+
"cat ${selectQuery} | clickhouse-client | grep 2"
154+
)
155+
'';
156+
}
157+
)

pkgs/applications/audio/zynaddsubfx/default.nix

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
# Test dependencies
4646
cxxtest,
4747
ruby,
48+
ctestCheckHook,
4849
}:
4950

5051
assert builtins.any (g: guiModule == g) [
@@ -151,28 +152,19 @@ stdenv.mkDerivation rec {
151152
nativeCheckInputs = [
152153
cxxtest
153154
ruby
155+
ctestCheckHook
154156
];
155157

156-
# TODO: Update cmake hook to make it simpler to selectively disable cmake tests: #113829
157-
checkPhase =
158-
let
159-
disabledTests =
160-
# PortChecker is non-deterministic. It's fixed in the master
161-
# branch, but backporting would require an update to rtosc, so
162-
# we'll just disable it until the next release.
163-
[ "PortChecker" ]
164-
165-
# Tests fail on aarch64
166-
++ lib.optionals stdenv.hostPlatform.isAarch64 [
167-
"MessageTest"
168-
"UnisonTest"
169-
];
170-
in
171-
''
172-
runHook preCheck
173-
ctest --output-on-failure -E '^${lib.concatStringsSep "|" disabledTests}$'
174-
runHook postCheck
175-
'';
158+
disabledTests =
159+
# PortChecker is non-deterministic. It's fixed in the master
160+
# branch, but backporting would require an update to rtosc, so
161+
# we'll just disable it until the next release.
162+
[ "PortChecker" ]
163+
# Tests fail on aarch64
164+
++ lib.optionals stdenv.hostPlatform.isAarch64 [
165+
"MessageTest"
166+
"UnisonTest"
167+
];
176168

177169
# Use Zyn-Fusion logo for zest build
178170
# An SVG version of the logo isn't hosted anywhere we can fetch, I

pkgs/applications/emulators/libretro/cores/mame2003-plus.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
}:
66
mkLibretroCore {
77
core = "mame2003-plus";
8-
version = "0-unstable-2025-04-16";
8+
version = "0-unstable-2025-05-08";
99

1010
src = fetchFromGitHub {
1111
owner = "libretro";
1212
repo = "mame2003-plus-libretro";
13-
rev = "c2128c3e82d884f39d824b5ef2716ac35dfa406b";
14-
hash = "sha256-acicfUJlDT2Tm3aGTs9tAGaAGCC22ebRXnVLAxgcRI8=";
13+
rev = "d3e54870080f9389b4b3e6c6f717bfa29a2fd7fe";
14+
hash = "sha256-k3YLCP9FNBu5rD+T5bM+hJr1XNbUlXm8a96VRcj7PFw=";
1515
};
1616

1717
makefile = "Makefile";

pkgs/applications/misc/gpxsee/default.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ let
1818
in
1919
stdenv.mkDerivation (finalAttrs: {
2020
pname = "gpxsee";
21-
version = "13.40";
21+
version = "13.42";
2222

2323
src = fetchFromGitHub {
2424
owner = "tumic0";
2525
repo = "GPXSee";
2626
tag = finalAttrs.version;
27-
hash = "sha256-xxMnqUsYfmTD1ZNAm+lFMLvXvo6qRrq88m234ZtYiuA=";
27+
hash = "sha256-94zCDtja1b85Wgz4slG17ETT/TMPPCyXld3WdtGjBzA=";
2828
};
2929

3030
buildInputs =

0 commit comments

Comments
 (0)