diff options
author | Samuel Longchamps <memophysic@gmail.com> | 2020-12-24 18:08:30 -0800 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2020-12-28 22:14:48 +0000 |
commit | e11218c153f1625a7a95e5e56b202c8cb850c22e (patch) | |
tree | f3e62d7e738841630028f6667d3e490f06455d57 | |
parent | d4fc2dc0bc099783416f5e5453f89bfe265a6bb0 (diff) | |
download | meson-e11218c153f1625a7a95e5e56b202c8cb850c22e.zip meson-e11218c153f1625a7a95e5e56b202c8cb850c22e.tar.gz meson-e11218c153f1625a7a95e5e56b202c8cb850c22e.tar.bz2 |
Incorrect source-build directory error when using network paths on Windows
-rw-r--r-- | mesonbuild/msetup.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/mesonbuild/msetup.py b/mesonbuild/msetup.py index a5bba56..d336a13 100644 --- a/mesonbuild/msetup.py +++ b/mesonbuild/msetup.py @@ -131,8 +131,11 @@ class MesonApp: raise MesonException('{} is not a directory'.format(dir1)) if not stat.S_ISDIR(os.stat(ndir2).st_mode): raise MesonException('{} is not a directory'.format(dir2)) - if os.path.samefile(dir1, dir2): - raise MesonException('Source and build directories must not be the same. Create a pristine build directory.') + if os.path.samefile(ndir1, ndir2): + # Fallback to textual compare if undefined entries found + has_undefined = any((s.st_ino == 0 and s.st_dev == 0) for s in (os.stat(ndir1), os.stat(ndir2))) + if not has_undefined or ndir1 == ndir2: + raise MesonException('Source and build directories must not be the same. Create a pristine build directory.') if self.has_build_file(ndir1): if self.has_build_file(ndir2): raise MesonException('Both directories contain a build file {}.'.format(environment.build_filename)) |