aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2022-08-22 14:29:16 -0700
committerNirbheek Chauhan <nirbheek@centricular.com>2022-09-02 13:40:05 +0530
commitfd9a947976c946fb429bdce853ccd0f12fa3eec9 (patch)
treef19795648a440ac2a46c0f0dc8e1dd0640e220b1
parent4d510f0fe11bcebaf22edd1c9f7221a280699a0f (diff)
downloadmeson-fd9a947976c946fb429bdce853ccd0f12fa3eec9.zip
meson-fd9a947976c946fb429bdce853ccd0f12fa3eec9.tar.gz
meson-fd9a947976c946fb429bdce853ccd0f12fa3eec9.tar.bz2
build: Don't attempt to link-whole with rust convenience libraries
There are two distinct cases here that need to be considered. The first issue is https://github.com/mesonbuild/meson/issues/10723 and https://github.com/mesonbuild/meson/issues/10724, which means that Meson can't actually generate link-whole arguments with rust targets. The second is that rlibs are never valid candidates for link-whole anyway. The promotion happens to work because of another bug in the promotion path (which is fixed in the next commit).
-rw-r--r--mesonbuild/build.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index 641e5f3..47c77ee 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -1410,9 +1410,17 @@ You probably should put it in link_with instead.''')
mlog.warning(f'Try to link an installed static library target {self.name} with a'
'custom target that is not installed, this might cause problems'
'when you try to use this static library')
- elif t.is_internal():
+ elif t.is_internal() and not t.uses_rust():
# When we're a static library and we link_with to an
# internal/convenience library, promote to link_whole.
+ #
+ # There are cases we cannot do this, however. In Rust, for
+ # example, this can't be done with Rust ABI libraries, though
+ # it could be done with C ABI libraries, though there are
+ # several meson issues that need to be fixed:
+ # https://github.com/mesonbuild/meson/issues/10722
+ # https://github.com/mesonbuild/meson/issues/10723
+ # https://github.com/mesonbuild/meson/issues/10724
return self.link_whole(t)
if not isinstance(t, (Target, CustomTargetIndex)):
raise InvalidArguments(f'{t!r} is not a target.')