depfixer: don't invoke install_name_tool on non-darwin targets#16016
Open
harshverma27 wants to merge 1 commit into
Open
depfixer: don't invoke install_name_tool on non-darwin targets#16016harshverma27 wants to merge 1 commit into
harshverma27 wants to merge 1 commit into
Conversation
Author
|
Hi, This is my first contribution, I hope I did everything fine. I've worked with meson alot, but finally decided to contribute to it. I plan to have a long journey with meson! :) |
bonzini
reviewed
Jul 17, 2026
bonzini
reviewed
Jul 17, 2026
Contributor
|
The Meson project has not yet decided formally whether to accept AI contributions. I reviewed the patch and look forward to do it for any changes you apply but I encourage you to do further changes yourself, and certainly to not just cut and paste from LLM to PR. Thanks for your understanding. |
harshverma27
force-pushed
the
wip/issue-8027
branch
from
July 17, 2026 16:33
0336e66 to
cb60c48
Compare
bonzini
reviewed
Jul 17, 2026
Author
|
I get your point, I accept what you said. |
harshverma27
force-pushed
the
wip/issue-8027
branch
from
July 17, 2026 16:38
cb60c48 to
94158b5
Compare
fix_rpath() fell through to the install_name_tool/otool path whenever a file wasn't valid ELF, regardless of target system. detect_elf_type() exits 0 for any non-ELF file, and that exit was caught and treated as "try darwin fixup" unconditionally. On a non-darwin system with install_name_tool on PATH (e.g. darwin cross-toolchain installed alongside), this ran otool/install_name_tool against native binaries. Gate the darwin-only path on system == 'darwin'. Fixes mesonbuild#8027
harshverma27
force-pushed
the
wip/issue-8027
branch
from
July 17, 2026 17:01
94158b5 to
06cce75
Compare
Author
|
@bonzini is the current version correct? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fix_rpath()indepfixer.pytreated "file isn't ELF" the same onevery OS: it caught detect_elf_type()'s
sys.exit(0)and fell throughto probing for
install_name_tool.install_name_tool/otoolon PATH (e.g. darwin cross-compile toolchain installed),
this got invoked on native binaries during
ninja install.system == 'darwin'.Fixes #8027
Test Added
test_depfixer_skips_install_name_tool_on_non_darwininunittests/internaltests.py: non-ELF file +system='linux'mustnot call
shutil.which.otool) and passes with the fix.