Skip to content

Commit 4b02bc1

Browse files
ryanofskyfanquake
authored andcommitted
test: Avoid interface_ipc.py Duplicate ID errors
This change should fix issue bitcoin#33417 reported by zaidmstrr. It's possible to reproduce the `mp/proxy.capnp:0: failed: Duplicate ID @0xcc316e3f71a040fb` error by installing libmultiprocess system-wide, or to one of the locations listed in the python test's `imports` list before the local libmultiprocess subtree, and then running the test. Github-Pull: bitcoin#33420 Rebased-From: e9c5227
1 parent 52bcf62 commit 4b02bc1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/functional/interface_ipc.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@ def load_capnp_modules(self):
3535
capnp_dir = Path(capnp.__path__[0]).parent
3636
src_dir = Path(self.config['environment']['SRCDIR']) / "src"
3737
mp_dir = src_dir / "ipc" / "libmultiprocess" / "include"
38-
imports = [str(capnp_dir), str(src_dir), str(mp_dir)]
38+
# List of import directories. Note: it is important for mp_dir to be
39+
# listed first, in case there are other libmultiprocess installations on
40+
# the system, to ensure that `import "/mp/proxy.capnp"` lines load the
41+
# same file as capnp.load() loads directly below, and there are not
42+
# "failed: Duplicate ID @0xcc316e3f71a040fb" errors.
43+
imports = [str(mp_dir), str(capnp_dir), str(src_dir)]
3944
return {
4045
"proxy": capnp.load(str(mp_dir / "mp" / "proxy.capnp"), imports=imports),
4146
"init": capnp.load(str(src_dir / "ipc" / "capnp" / "init.capnp"), imports=imports),

0 commit comments

Comments
 (0)