-
Notifications
You must be signed in to change notification settings - Fork 993
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
Locate otool and install_name_tool with xcrun #14195
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks very much for your contribution.
I think this makes sense, and it is cleanly implemented.
It would be good to have some new unit test that validates a bit more the implementation (and ensures it is not broken in the future). Do you think you could add them? (no problem if you don't manage, we can contribute them). Thanks!
Hi @sfackler - thank you for opening this PR. I'm not entirely familiar with Out of curiosity I wonder how |
Yep, it does contain an unprefixed xcrun:
I can update this to remove the confs and resolve install_name_tool and otool from xcrun if you'd prefer. osxcross does ship a cmake toolchain that handles the install_name_tool name for that build system at least: https://github.com/tpoechtrager/osxcross/blob/564e2b9aa8e7a40da663d890c0e853a1259ff8b1/tools/toolchain.cmake#L41 Happy to add tests as well! |
Ok, that is great, thanks for checking.
Yes, I think it would be better if the |
Updated to use xcrun and remove the new confs. |
|
||
xcrun = XCRun(conanfile) | ||
otool = xcrun.otool | ||
install_name_tool = xcrun.install_name_tool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively, we could just prefix all of the commands with xcrun
, e.g. xcrun otool -hv {file}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is good as is, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it looks good, but I'll defer it to @jcar87 that knows more than me in OSX.
|
||
xcrun = XCRun(conanfile) | ||
otool = xcrun.otool | ||
install_name_tool = xcrun.install_name_tool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is good as is, thanks!
if not is_apple_os(conanfile): | ||
return | ||
|
||
xcrun = XCRun(conanfile) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious (and possibly ignorance about how it works). How this XCRun
connects to the specific osxcross
environment? Via os.sdk
setting? I guess that you have tested against your osxcross
, and it works, but as it is not covered by full functional tests, I'd like to understand how it works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the xcrun has that relative SDK path hardcoded as the default search location when it was compiled, but I'm not totally sure.
On a semi-related note, I do need to explicitly set tools.apple:sdk_path
for some CMake logic to work properly - would it be worth it to have the CMakeToolchain tool query XCRun for the SDK path if it's not explicitly configured?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks so much for your contribution @sfackler!
Thanks for the contribution, this will be in next 2.0.8. I am spinning a new issue from your comment above, I think it is necessary to follow up |
Changelog: Feature: The
fix_apple_shared_install_name
tool now usesxcrun
to resolve theotool
andinstall_name_tool
programs.Docs: Omit
Closes #14188
develop
branch, documenting this one.