diff options
| author | Eli Schwartz <eschwartz93@gmail.com> | 2023-10-29 22:04:53 -0400 |
|---|---|---|
| committer | Eli Schwartz <eschwartz93@gmail.com> | 2023-11-04 22:13:11 -0400 |
| commit | fb1c6e32f41277540b8ab51b1b4223ec68d18821 (patch) | |
| tree | 97594488717b7f1a9e06d686cf5e17bd3d4b368c /test cases/python3 | |
| parent | 74712f2dbc3e0f04e6458c6ffe129187dd4726bf (diff) | |
| download | meson-fb1c6e32f41277540b8ab51b1b4223ec68d18821.tar.gz | |
Fine-tune the error message when trying to build outside the project root
We try to backtrack through the filesystem to find the correct directory
to build in, and suggest this as a possible diagnostic. However, our
current heuristic relies on parsing the raw file with string matching to
see if it starts with `project(`, and this may or may not actually work.
Instead, do a bit of recursion and parse each candidate with mparser,
then check if the first node of *that* file is a project() function.
This makes us resilient to a common case: where the root meson.build is
entirely valid, but, the first line is a comment containing e.g. SPDX
license headers and a simple string comparison simply does not cut it.
Fixes the bad error message from #12441, which was supposed to provide
more guidance but did not.
Diffstat (limited to 'test cases/python3')
0 files changed, 0 insertions, 0 deletions
