summaryrefslogtreecommitdiff
path: root/mesonbuild/build.py
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2023-04-18 15:56:35 +0300
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2023-04-20 13:53:26 +0530
commite2c454b86e5fcb2dbbabe33199dc4b877dcdb95d (patch)
tree0a7c19561892b29cff0372cae68157af55524a25 /mesonbuild/build.py
parent3c9817fe7f0602df2d86519682e91fa8faf735ef (diff)
downloadmeson-e2c454b86e5fcb2dbbabe33199dc4b877dcdb95d.tar.gz
rust: Also disallow `.` in Rust library target names
Diffstat (limited to 'mesonbuild/build.py')
-rw-r--r--mesonbuild/build.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index 0a2a617da..7e8270c56 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -1988,8 +1988,8 @@ class StaticLibrary(BuildTarget):
elif self.rust_crate_type not in ['rlib', 'staticlib']:
raise InvalidArguments(f'Crate type "{self.rust_crate_type}" invalid for static libraries; must be "rlib" or "staticlib"')
# See https://github.com/rust-lang/rust/issues/110460
- if self.rust_crate_type == 'rlib' and any(c in self.name for c in ['-', ' ']):
- raise InvalidArguments('Rust crate types "dylib" and "proc-macro" do not allow spaces or dashes in the library name '
+ if self.rust_crate_type == 'rlib' and any(c in self.name for c in ['-', ' ', '.']):
+ raise InvalidArguments('Rust crate type "rlib" does not allow spaces, periods or dashes in the library name '
'due to a limitation of rustc. Replace them with underscores, for example')
# By default a static library is named libfoo.a even on Windows because
# MSVC does not have a consistent convention for what static libraries
@@ -2082,8 +2082,8 @@ class SharedLibrary(BuildTarget):
elif self.rust_crate_type not in ['dylib', 'cdylib', 'proc-macro']:
raise InvalidArguments(f'Crate type "{self.rust_crate_type}" invalid for dynamic libraries; must be "dylib", "cdylib", or "proc-macro"')
# See https://github.com/rust-lang/rust/issues/110460
- if self.rust_crate_type != 'cdylib' and any(c in self.name for c in ['-', ' ']):
- raise InvalidArguments('Rust crate types "dylib" and "proc-macro" do not allow spaces or dashes in the library name '
+ if self.rust_crate_type != 'cdylib' and any(c in self.name for c in ['-', ' ', '.']):
+ raise InvalidArguments('Rust crate types "dylib" and "proc-macro" do not allow spaces, periods or dashes in the library name '
'due to a limitation of rustc. Replace them with underscores, for example')
if not hasattr(self, 'prefix'):