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

respect the machine file binary overrides, even if it doesn't exist #11372

Merged

Conversation

eli-schwartz
Copy link
Member

If someone specifies a binary in a machine file, but the resulting prog.found() is false because it doesn't actually exist on disk, then the user was probably trying to disable finding that program. But find_program() currently doesn't distinguish between a machine file lookup returning a not-found program, and returning a dummy program because there's no entry at all.

Explicitly check for a dummy program, rather than checking if the program was found, before deciding whether to discard the lookup results and continue trying other program lookup methods.

/cc @thesamesam here you go

If someone specifies a binary in a machine file, but the resulting
prog.found() is false because it doesn't actually exist on disk, then
the user was probably trying to disable finding that program. But
find_program() currently doesn't distinguish between a machine file
lookup returning a not-found program, and returning a dummy program
because there's no entry at all.

Explicitly check for a dummy program, rather than checking if the
program was found, before deciding whether to discard the lookup results
and continue trying other program lookup methods.
@codecov
Copy link

codecov bot commented Feb 10, 2023

Codecov Report

Merging #11372 (a846fa3) into master (d0b39a6) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master   #11372      +/-   ##
==========================================
- Coverage   67.04%   67.03%   -0.02%     
==========================================
  Files         414      414              
  Lines       90542    90542              
  Branches    20096    20096              
==========================================
- Hits        60703    60691      -12     
- Misses      25177    25184       +7     
- Partials     4662     4667       +5     
Impacted Files Coverage Δ
mesonbuild/interpreter/interpreter.py 82.91% <100.00%> (ø)
mesonbuild/dependencies/mpi.py 54.16% <0.00%> (-2.09%) ⬇️
mesonbuild/environment.py 81.64% <0.00%> (-0.65%) ⬇️
mesonbuild/compilers/detect.py 52.10% <0.00%> (-0.47%) ⬇️
mesonbuild/dependencies/boost.py 81.21% <0.00%> (-0.42%) ⬇️
interpreter/interpreter.py 84.35% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

gentoo-bot pushed a commit to gentoo/gentoo that referenced this pull request Feb 10, 2023
Thanks to Eli Schwartz for getting things to the point where we could
do this (a Meson bug fix [0] for the native override for find_program
and a zstd change [1] for letting us build tests but not install programs
for multilib).

[0] mesonbuild/meson#11372
[1] facebook/zstd#3490

Signed-off-by: Sam James <sam@gentoo.org>
@eli-schwartz eli-schwartz merged commit a846fa3 into mesonbuild:master Feb 10, 2023
@eli-schwartz eli-schwartz deleted the find_program-from-nonexisting branch February 10, 2023 06:57
@nirbheek nirbheek added this to the 1.0.1 milestone Feb 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants