From e9c52272ebd78d01882ac9b32b1aee8e12d87bec Mon Sep 17 00:00:00 2001 From: Ryan Ofsky Date: Wed, 17 Sep 2025 12:34:07 -0400 Subject: [PATCH] test: Avoid interface_ipc.py Duplicate ID errors This change should fix issue https://github.com/bitcoin/bitcoin/issues/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. --- test/functional/interface_ipc.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/functional/interface_ipc.py b/test/functional/interface_ipc.py index ff1f74bf13b47..4231e95b56a84 100755 --- a/test/functional/interface_ipc.py +++ b/test/functional/interface_ipc.py @@ -35,7 +35,12 @@ def load_capnp_modules(self): capnp_dir = Path(capnp.__path__[0]).parent src_dir = Path(self.config['environment']['SRCDIR']) / "src" mp_dir = src_dir / "ipc" / "libmultiprocess" / "include" - imports = [str(capnp_dir), str(src_dir), str(mp_dir)] + # List of import directories. Note: it is important for mp_dir to be + # listed first, in case there are other libmultiprocess installations on + # the system, to ensure that `import "/mp/proxy.capnp"` lines load the + # same file as capnp.load() loads directly below, and there are not + # "failed: Duplicate ID @0xcc316e3f71a040fb" errors. + imports = [str(mp_dir), str(capnp_dir), str(src_dir)] return { "proxy": capnp.load(str(mp_dir / "mp" / "proxy.capnp"), imports=imports), "init": capnp.load(str(src_dir / "ipc" / "capnp" / "init.capnp"), imports=imports),