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

Allow ARM on macOS #373

Open
wants to merge 5 commits into
base: master
from
Open

Allow ARM on macOS #373

wants to merge 5 commits into from

Conversation

@fxcoudert
Copy link
Member

@fxcoudert fxcoudert commented Dec 12, 2020

Although we're not entirely there yet, the time for Apple Silicon support is nearing. I've had a look at the installer script to see what is needed there.

@fxcoudert
Copy link
Member Author

@fxcoudert fxcoudert commented Dec 12, 2020

Around line 425, there is:

directories=(bin etc include lib sbin share var opt
             share/zsh share/zsh/site-functions
             var/homebrew var/homebrew/linked
             Cellar Caskroom Homebrew Frameworks)
mkdirs=()
for dir in "${directories[@]}"; do
  if ! [[ -d "${HOMEBREW_PREFIX}/${dir}" ]]; then
    mkdirs+=("${HOMEBREW_PREFIX}/${dir}")
  fi
done

I think the Homebrew directory here is an error. HOMEBREW_REPOSITORY should be created with a different logic.

@fxcoudert
Copy link
Member Author

@fxcoudert fxcoudert commented Dec 12, 2020

Running this version on Apple Silicon currently fails because we're not giving /opt/homebrew the right ownership. It gets root:wheel, which is not appropriate. Whatever else happens, we always need to be owners of HOMEBREW_REPOSITORY.

brewadmin@administrators-Mac-5 ~ % bash ./install.sh    
==> This script will install:
/opt/homebrew/bin/brew
/opt/homebrew/share/doc/homebrew
/opt/homebrew/share/man/man1/brew.1
/opt/homebrew/share/zsh/site-functions/_brew
/opt/homebrew/etc/bash_completion.d/brew
/opt/homebrew
==> The following new directories will be created:
/opt/homebrew/bin
/opt/homebrew/etc
/opt/homebrew/include
/opt/homebrew/lib
/opt/homebrew/sbin
/opt/homebrew/share
/opt/homebrew/var
/opt/homebrew/opt
/opt/homebrew/share/zsh
/opt/homebrew/share/zsh/site-functions
/opt/homebrew/var/homebrew
/opt/homebrew/var/homebrew/linked
/opt/homebrew/Cellar
/opt/homebrew/Caskroom
/opt/homebrew/Homebrew
/opt/homebrew/Frameworks

Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/mkdir -p /opt/homebrew
==> /usr/bin/sudo /usr/sbin/chown root:wheel /opt/homebrew
==> /usr/bin/sudo /bin/mkdir -p /opt/homebrew/bin /opt/homebrew/etc /opt/homebrew/include /opt/homebrew/lib /opt/homebrew/sbin /opt/homebrew/share /opt/homebrew/var /opt/homebrew/opt /opt/homebrew/share/zsh /opt/homebrew/share/zsh/site-functions /opt/homebrew/var/homebrew /opt/homebrew/var/homebrew/linked /opt/homebrew/Cellar /opt/homebrew/Caskroom /opt/homebrew/Homebrew /opt/homebrew/Frameworks
==> /usr/bin/sudo /bin/chmod g+rwx /opt/homebrew/bin /opt/homebrew/etc /opt/homebrew/include /opt/homebrew/lib /opt/homebrew/sbin /opt/homebrew/share /opt/homebrew/var /opt/homebrew/opt /opt/homebrew/share/zsh /opt/homebrew/share/zsh/site-functions /opt/homebrew/var/homebrew /opt/homebrew/var/homebrew/linked /opt/homebrew/Cellar /opt/homebrew/Caskroom /opt/homebrew/Homebrew /opt/homebrew/Frameworks
==> /usr/bin/sudo /usr/sbin/chown brewadmin /opt/homebrew/bin /opt/homebrew/etc /opt/homebrew/include /opt/homebrew/lib /opt/homebrew/sbin /opt/homebrew/share /opt/homebrew/var /opt/homebrew/opt /opt/homebrew/share/zsh /opt/homebrew/share/zsh/site-functions /opt/homebrew/var/homebrew /opt/homebrew/var/homebrew/linked /opt/homebrew/Cellar /opt/homebrew/Caskroom /opt/homebrew/Homebrew /opt/homebrew/Frameworks
==> /usr/bin/sudo /usr/bin/chgrp admin /opt/homebrew/bin /opt/homebrew/etc /opt/homebrew/include /opt/homebrew/lib /opt/homebrew/sbin /opt/homebrew/share /opt/homebrew/var /opt/homebrew/opt /opt/homebrew/share/zsh /opt/homebrew/share/zsh/site-functions /opt/homebrew/var/homebrew /opt/homebrew/var/homebrew/linked /opt/homebrew/Cellar /opt/homebrew/Caskroom /opt/homebrew/Homebrew /opt/homebrew/Frameworks
==> Downloading and installing Homebrew...
/opt/homebrew/.git: Permission denied
Failed during: git init -q
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Looks good so far!

install.sh Outdated Show resolved Hide resolved
@MikeMcQuaid
Copy link
Member

@MikeMcQuaid MikeMcQuaid commented Dec 14, 2020

I think the Homebrew directory here is an error. HOMEBREW_REPOSITORY should be created with a different logic.

Yes, that could reference HOMEBREW_REPOSITORY if needed or just be removed perhaps.

fxcoudert and others added 3 commits Dec 15, 2020
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
@fxcoudert
Copy link
Member Author

@fxcoudert fxcoudert commented Dec 15, 2020

I've tested on ARM and Intel macOS. I'd like to have some Linux testing, but otherwise I think this is complete and ready for review.

@sjackman
Copy link
Member

@sjackman sjackman commented Dec 15, 2020

I'd like to have some Linux testing, but otherwise I think this is complete and ready for review.

I gave it a quick test on Linux in /home/linuxbrew/.linuxbrew with and without sudo available, and it worked for me.

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Looks good to me! Let's hold off merging until we're able to announce we "support" this (i.e. we have a non-trivial number of bottles).

@billinghamj
Copy link

@billinghamj billinghamj commented Dec 17, 2020

I think this is great, as really a shockingly large amount of stuff "just works" now - it's really impressive how fast that has happened.

But I wonder if you might want to consider describing it as more partial support, or support with significant caveats? As some not-insignificant proportion of formulae will likely not be compatible for a long time, if ever. So setting user expectations in some form may help?

@MikeMcQuaid
Copy link
Member

@MikeMcQuaid MikeMcQuaid commented Dec 17, 2020

But I wonder if you might want to consider describing it as more partial support, or support with significant caveats? As some not-insignificant proportion of formulae will likely not be compatible for a long time, if ever. So setting user expectations in some form may help?

Yup, that's the plan before we'd merge this 👍🏻

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

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.