From 91f2050813b81575db61d5aafff6aa3a2fa61a06 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Mon, 6 Nov 2023 07:48:55 -0500 Subject: [PATCH] rust: Add unique metadata id This solves StableCrateId collision when using multiple versions of the same crate. --- mesonbuild/backend/ninjabackend.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 0f630a6b6..339952400 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -1948,6 +1948,7 @@ class NinjaBackend(backends.Backend): depfile = os.path.join(target.subdir, target.name + '.d') args += ['--emit', f'dep-info={depfile}', '--emit', f'link={target_name}'] args += ['--out-dir', self.get_target_private_dir(target)] + args += ['-C', 'metadata=' + target.get_id()] args += target.get_extra_args('rust') # Rustc always use non-debug Windows runtime. Inject the one selected