-
Notifications
You must be signed in to change notification settings - Fork 87
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
(PA-6387) Enable curl 8 #843
Merged
Merged
Conversation
This file contains 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
Previously, curl 8 on macOS 11 & 12 ARM failed to run: # /opt/puppetlabs/puppet/bin/curl --version dyld[3871]: symbol not found in flat namespace (_SSL_get0_group_name) This occurred because we cross-compiled curl (and other components) using headers from homebrew's openssl 3.3.0. But at runtime, we loaded the libssl.dylib shared library that we built from openssl 3.0.13. Due to the version mismatch between headers and libraries, curl tried to call the SSL_get0_group_name function that only exists in openssl 3.2 and up. This commit removes the homebrew symlinks for openssl and libyaml so that they are not visible to our build process. Some background about why this only affects cross compiled macOS builds. In order to cross-compile ruby 3.2 on ARM, we have to install ruby 3.2 Intel and use that as the base ruby, see notes/cross-compiling.md for details. On macOS, we use homebrew to install build dependencies. Homebrew's [email protected] package depends on openssl@3[1], which is currently 3.3.0[2]. When homebrew installs packages, it creates symlinks in the /usr/local directory: # ls -l /usr/local/include/openssl ... /usr/local/include/openssl -> ../Cellar/openssl@3/3.3.0/include/openssl On macOS, we compile using clang, which uses the following search path for headers: # gcc -v main.c Apple clang version 13.0.0 (clang-1300.0.27.3) ... #include <...> search starts here: /usr/local/include /Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/usr/include /Library/Developer/CommandLineTools/usr/include /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks (framework directory) End of search list. Since /usr/local/include is the first directory, we are mistakenly compiling against homebrew's openssl. However, it wasn't an issue until we bumped to curl 8, because the conditional calls SSL_get0_group_name doesn't exist in curl 7[3] [1] https://github.com/Homebrew/homebrew-core/blob/6fd6f60a799501e7c093b695cc830a8708bd1c14/Formula/r/ruby%403.2.rb#L30 [2] https://github.com/Homebrew/homebrew-core/blob/6fd6f60a799501e7c093b695cc830a8708bd1c14/Formula/o/openssl%403.rb#L4 [3] https://github.com/curl/curl/blob/7490d5488e0e7835199285b0568a1c2e0d51b6a9/lib/vtls/openssl.c#L4295-L4296
In May 2018, commit fd8c9e4 added yaml-cpp as a component to the agent-runtime-master project. In Oct 2018, commit bc865b3 installed yaml-cpp using homebrew for agent 5.5.x on macOS 10.12. This means yaml-cpp headers are present in /usr/local/include and take precedence over our component. This drops yaml-cpp from brew install, which ensures we're compiling against the correct yaml-cpp headers in our component.
cthorn42
approved these changes
May 10, 2024
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.
Thank you for those MacOS notes with troubleshooting, it is appreciated!
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.
brew unlink openssl libyaml
so they don't conflict with our runtime componentsyaml-cpp
as a build requirement on macOStoken-sargent
pix-arm64-macos12-6
strange-tooth
pix-arm64-macos13-1
dismal-mutton
pix-arm64-macos14-3
freer-python
There is an issue with
ffi
andnokogiri
on macOS 12 ARM unrelated to this PR: #846