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

Use yaml from homebrew #1928

Closed
dreyks opened this issue Feb 2, 2022 · 3 comments · Fixed by #1929
Closed

Use yaml from homebrew #1928

dreyks opened this issue Feb 2, 2022 · 3 comments · Fixed by #1929

Comments

@dreyks
Copy link
Contributor

dreyks commented Feb 2, 2022

Homebrew is no longer located in /usr/local on Apple Silicon. It is now in /opt/homebrew. This leads to brew-originated yaml not being picked up during the build

We should probably manage yaml the same way we do it with readline. Looking at the code there's already a function that should do what is needed but it's not being called anywhere

ruby-build/bin/ruby-build

Lines 1029 to 1037 in cbdbc6e

use_homebrew_yaml() {
local libdir="$(brew --prefix libyaml 2>/dev/null || true)"
if [ -d "$libdir" ]; then
echo "ruby-build: using libyaml from homebrew"
package_option ruby configure --with-libyaml-dir="$libdir"
else
return 1
fi
}

should we call it here?

ruby-build/bin/ruby-build

Lines 581 to 583 in cbdbc6e

if [ "$package_var_name" = "RUBY" ]; then
use_homebrew_readline || use_freebsd_pkg ||true
fi

@mislav
Copy link
Member

mislav commented Feb 2, 2022

That's a good idea! Note that use_homebrew_yaml would have to get wrapped in this condition to prevent overriding user's explicit configuration:

if [[ "$RUBY_CONFIGURE_OPTS" != *--with-libyaml-dir=* ]]

@dreyks
Copy link
Contributor Author

dreyks commented Feb 2, 2022

Yup, thx. I'll make a PR then

@dreyks
Copy link
Contributor Author

dreyks commented Feb 3, 2022

done #1929

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants