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

toolchain-sudo.sh doesn't work on macOS with brew because running brew as root has been no longer unsupported #134

Closed
yaplus opened this issue Jun 22, 2020 · 2 comments · Fixed by #135
Labels

Comments

@yaplus
Copy link
Contributor

yaplus commented Jun 22, 2020

When trying to install the toolchain to /usr/local on Mac with Homebrew, an error

Couldn't find dependencies:
  - libarchive
  - libssl

has occurred in depends/check-dependencies.sh, because running brew as root has been no longer unsupported.

The error seems to be caused by the following line, which is running brew --version as root in toolchain-sudo.sh:

if brew --version 1>/dev/null 2>&1; then
header_paths+=("`brew --prefix`/opt/readline/include")
header_paths+=("`brew --prefix`/opt/libarchive/include")

@carstene1ns
Copy link
Member

So --version works not, but getting the prefix works?

I think using sudo might be a bit overkill then. We could use command -v brew to check instead.

@carstene1ns
Copy link
Member

Okay, looks like we can get away with this:
https://github.com/Homebrew/brew/blob/master/Library/Homebrew/brew.sh#L439

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

Successfully merging a pull request may close this issue.

2 participants