Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow override_find_program to use an executable. #4055

Closed
wants to merge 4 commits into from
Closed

Allow override_find_program to use an executable. #4055

wants to merge 4 commits into from

Commits on Aug 19, 2018

  1. Allow override_find_program to use an executable.

    With this it is now possible to do
    
    foobar = executable('foobar', ...)
    meson.override_find_program('foobar', foobar)
    
    Which is convenient for a project like protobuf which produces both a
    dependency and a tool. If protobuf is updated to use
    override_find_program, it can be used as
    
    protobuf_dep = dependency('protobuf', version : '>=3.3.1',
                              fallback : ['protobuf', 'protobuf_dep'])
    protoc_prog = find_program('protoc')
    espindola committed Aug 19, 2018
    Configuration menu
    Copy the full SHA
    584a844 View commit details
    Browse the repository at this point in the history
  2. Address review comments.

    * Don't use __str__.
    * Use ExternalProgramHolder for holding an executable.
    * Add tests of the dependencies.
    * Mark executable in test as native.
    * Error if an executable is used with run_command.
    
    I went with an error on the last item because I think that there is no
    non error behavior that is always correct.
    
    If a program is not available on the system, we would need an error
    one way or the other.
    
    The interesting case then is when the program is available on the
    system but is overridden anyway. I would assume that this would
    normally happens because the one available on the system is too old.
    
    Should we use one version during configuration and another one during
    the build? That sounds dangerous as there is no guarantee that the two
    versions are compatible.
    
    It also seems inconsistent with the fact that we error if a program is
    overridden after a find_program (see test cases/failing/73 override
    used).
    
    BTW, is there any way to test which error caused a test in the failing
    subdirectory to fail?
    espindola committed Aug 19, 2018
    Configuration menu
    Copy the full SHA
    4303e4e View commit details
    Browse the repository at this point in the history

Commits on Aug 21, 2018

  1. Address review comments.

    * Improve function name and add docstring.
    * Improve error message to say which program was overridden by which
      executable.
    espindola committed Aug 21, 2018
    Configuration menu
    Copy the full SHA
    bafd632 View commit details
    Browse the repository at this point in the history

Commits on Aug 29, 2018

  1. Add documentation.

    espindola committed Aug 29, 2018
    Configuration menu
    Copy the full SHA
    cee2960 View commit details
    Browse the repository at this point in the history