mirror of
https://github.com/mesonbuild/meson.git
synced 2026-11-06 05:16:42 +00:00
msetup: fix misleading error message about directories
`validate_core_dirs` method is used to find out which directory contains the sources and which one will be used as build directory. Its error message misleads the user when the user follows the order of positional arguments of `meson setup` (the first one should be the build directory and the second one the source directory). In case of invalid configuration, e.g. when neither directory contained a `meson.build` file, the error message was: > $ meson setup ./build ./src > ERROR: Neither source directory './build' nor build directory './src' contain > a build file meson.build. In this case, a user might waste time trying to figure out why their build directory is being reported as the source directory. Since the purpose of this method is to determine what each directory corresponds, the best possible error message should make no assumptions about the directories.
This commit is contained in:
1 parent
7d02790a23
commit
fb0c38e959
1 file changed
+1
-1
@@ -119,7 +119,7 @@ class MesonApp:
|
||||
return os.path.exists(fname)
|
||||
|
||||
def validate_core_dirs(self, dir1: T.Optional[str], dir2: T.Optional[str]) -> T.Tuple[str, str]:
|
||||
invalid_msg_prefix = f'Neither source directory {dir1!r} nor build directory {dir2!r}'
|
||||
invalid_msg_prefix = f'Neither directory {dir1!r} nor directory {dir2!r}'
|
||||
if dir1 is None:
|
||||
if dir2 is None:
|
||||
if not self.has_build_file('.') and self.has_build_file('..'):
|
||||
|
||||
Reference in new issue
Block a user