diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2021-08-22 11:15:34 -0400 |
---|---|---|
committer | Eli Schwartz <eschwartz@archlinux.org> | 2021-08-22 12:12:26 -0400 |
commit | 2a7125928ef0829c93fcb1edb57c8859c59a83bb (patch) | |
tree | 85d70252fa1bfb0a3a6ab5ef47092f05e747b52e /mesonbuild/modules/java.py | |
parent | aad986b4b5258306ef56944941797acfcfb34a81 (diff) | |
download | meson-2a7125928ef0829c93fcb1edb57c8859c59a83bb.zip meson-2a7125928ef0829c93fcb1edb57c8859c59a83bb.tar.gz meson-2a7125928ef0829c93fcb1edb57c8859c59a83bb.tar.bz2 |
use even more informative error message for invoking meson in a subdir
Follow-up on commit 5a7b8d86d0c455680096d47cb87f0de08c0954ac
Sometimes, we find a parent meson.build which is also malformed, and we
shouldn't suggest that maybe the user meant to use that, if it isn't a
valid project() either. Do a rough and dirty check to see if the very
first line is a project() declaration, and if not, don't try to be
clever and suggest using it.
The "invalid source tree" error suffices here, since we're not
absolutely sure meson can be successfully run in that parent directory
and actually advising people about the wrong location is a lot more
confusing than just saying "please figure this out yourself, here is
what to look for".
Granted, we miss cases where project() comes after blank lines and/or
comments, but doing a full AST parse here is excessively overkill and
probably too painful to do, and we don't need to be *that* clever. So
let's be content with merely going above and beyond the call of duty.
Diffstat (limited to 'mesonbuild/modules/java.py')
0 files changed, 0 insertions, 0 deletions