Hardcoded list of llvm-config binary names breaks on upstream LLVM development version changes (currently: llvm-config-9 is not discovered)
- Dominant language
- Python
- Stars
- 6.6k
- Forks
- 1.9k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 33
Description
I just discovered that the names for `llvm-config` binary names is hardcoded in [lines 214ff of mesonbuild/dependencies/dev.py](https://github.com/mesonbuild/meson/blob/65192af2ff62a032a3f19d065c95e12b83aae709/mesonbuild/dependencies/dev.py#L214). This is rather fragile and as of now breaks on `llvm-config-9`. The name changed after the recent branch point of LLVM 8 and switching over to 9 for development.
As a stop-gap measure please add `llvm-config-9` immediately to the list of binary names meson looks for.
Though a more robust solution is needed in my opinion, because having default builds fail after every branch point of LLVM (or any other tool discovered in a similar way for that matter) until a new meson version is shipped, is nothing I'm looking forward to (yes, I know I can override the name of the `llvm-config` to use, but the default should not stop working unless there are some incompatible interface changes, eg. the binary is discontinued in favour of another mechanism). I would suggest to search for files starting with `llvm-config` in `$PATH`, order the result, maybe do some sanity checking, that it looks like an expected binary (ie. `llvm-config(-(\d+(\.\d)?|devel))?`) and pick the newest by default. But any other solution that is stable is fine by me as well.
This affects for example Mesa, which is now deprecating autotools and forcing transition to meson.
Contributor guide
Research direction
Begin in mesonbuild/dependencies/dev.py at lines 214ff and trace how the hardcoded llvm-config names are selected. First verify the reported llvm-config-9 discovery failure; done means the requested binary is found without an override, with any broader search behavior checked against the issue's compatibility concern.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100