Skip to content

Commit 17f50ff

Browse files
committed
wheel-build: Backport consistent interface order for libsystemd
Requested by @arkq.
1 parent 2dc8814 commit 17f50ff

File tree

2 files changed

+40
-7
lines changed

2 files changed

+40
-7
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# SPDX-License-Identifier: LGPL-2.1-or-later
2+
# SPDX-FileCopyrightText: 2025 Arkadiusz Bokowy <[email protected]>
3+
From 998aa62a21c69b34700f6cbbeb540beddffa9c89 Mon Sep 17 00:00:00 2001
4+
From: Arkadiusz Bokowy <[email protected]>
5+
Date: Thu, 12 Jun 2025 16:20:29 +0200
6+
Subject: [PATCH] sd-bus: Preserve interfaces addition order
7+
8+
When adding a new interface to the object add it at the end of the list.
9+
This way, when iterating over the list, e.g., during handling introspect
10+
call, the order of returned interfaces will mach the order in which they
11+
were added.
12+
---
13+
src/libsystemd/sd-bus/bus-objects.c | 3 +++
14+
test/units/TEST-23-UNIT-FILE.oneshot-restart.sh | 2 +-
15+
2 files changed, 4 insertions(+), 1 deletion(-)
16+
17+
diff --git a/src/libsystemd/sd-bus/bus-objects.c b/src/libsystemd/sd-bus/bus-objects.c
18+
index 7309ad621a0a7..cc1ef226f0cdd 100644
19+
--- a/src/libsystemd/sd-bus/bus-objects.c
20+
+++ b/src/libsystemd/sd-bus/bus-objects.c
21+
@@ -1973,6 +1973,9 @@ static int add_object_vtable_internal(
22+
}
23+
}
24+
25+
+ if (!existing)
26+
+ existing = LIST_FIND_TAIL(vtables, n->vtables);
27+
+
28+
s->node_vtable.node = n;
29+
LIST_INSERT_AFTER(vtables, n->vtables, existing, &s->node_vtable);
30+
bus->nodes_modified = true;

wheel-build/run_podman_full_build.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,10 @@
6363
SYSTEMD_TAG = "v255.22"
6464
SYSTEMD_SRC_DIR = Path("/root/systemd")
6565
SYSTEMD_BUILD_DIR = SYSTEMD_SRC_DIR / "build"
66-
SYSTEMD_COMPAT_PATCH_NAME = "systemd_no_gettid_no_getdents64.patch"
67-
SYSTEMD_COMPAT_PATCH_FILE = WHEEL_BUILD_DIR / SYSTEMD_COMPAT_PATCH_NAME
66+
SYSTEMD_COMPAT_PATCHES: list[str] = [
67+
"systemd_no_gettid_no_getdents64.patch",
68+
"consistent_interface_order.patch",
69+
]
6870
SYSTEMD_OPTIONS: list[str] = [
6971
"static-libsystemd=pic",
7072
"tests=false",
@@ -192,11 +194,12 @@ def clone_systemd() -> None:
192194

193195

194196
def apply_systemd_patch() -> None:
195-
podman_cp(SYSTEMD_COMPAT_PATCH_FILE, SYSTEMD_SRC_DIR)
196-
podman_exec(
197-
"git", "apply", SYSTEMD_COMPAT_PATCH_NAME,
198-
cwd=SYSTEMD_SRC_DIR,
199-
)
197+
for patch_filename in SYSTEMD_COMPAT_PATCHES:
198+
podman_cp(WHEEL_BUILD_DIR / patch_filename, SYSTEMD_SRC_DIR)
199+
podman_exec(
200+
"git", "apply", patch_filename,
201+
cwd=SYSTEMD_SRC_DIR,
202+
)
200203

201204

202205
def build_systemd() -> None:

0 commit comments

Comments
 (0)