mesonbuild / meson

The Meson Build System
http://mesonbuild.com
Apache License 2.0
5.58k stars 1.62k forks source link

Find_program needs a kwarg for extra directories to search in #1576

Closed jpakkane closed 4 years ago

jpakkane commented 7 years ago

There are executables that are on the system but not in PATH. Those need to be found. Something like this:

prog = find_program('system-something', dirs : ['/sbin', '/usr/sbin'])
jpakkane commented 7 years ago

This can already be done with:

e = find_program('prog', '/sbin/prog')

We could just say to use that instead. There does not seem to be an immediate advantage to the format mentioned above.

nirbheek commented 7 years ago

The main complaint is that it's too verbose, so maybe we could improve the output so that the checks are all on one line?

jpakkane commented 7 years ago

Seems reasonable.

nirbheek commented 6 years ago

From #4033, there can be a combinatorial explosion when multiple program names and directories are combined. For example:

find_program('httpd', 'httpd2', 'apache', 'apache2', 
    '/sbin/httpd', '/sbin/httpd2', '/sbin/apache', '/sbin/apache2',
    '/usr/sbin/httpd', '/usr/sbin/httpd2', '/usr/sbin/apache', '/usr/sbin/apache2')

Seems like a good reason for implementing this. @csaavedra would you like to work on this? The implementation is quite simple, search for 'find_program' inside mesonbuild/interpreter.py, then follow the code to mesonbuild/dependencies/base.py.

csaavedra commented 6 years ago

Hm, I rather leave this to you as I'm not familiar at all with meson and how you deal with potential API breakages, testing, etc.

nirbheek commented 6 years ago

You can find all the info here: https://mesonbuild.com/Contributing.html

The fastest way to add features is always to do it yourself! I probably won't have time to work on this anytime soon.