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

install: add workaround for rosetta2 path error to msg #10319

Merged
merged 4 commits into from Jan 26, 2021

Conversation

dcow
Copy link
Contributor

@dcow dcow commented Jan 14, 2021

It's possible the user's terminal emulator is running under rosetta2.
Consequently, the i86_64 version of the ruby interpreter will be used.
Likely, the right thing to do is simply install the arm64 version of the
requested package. This can be accomplished using: arch -arm64 brew ...

Fixes: #10313

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

    There were numerous failures...

  • Have you successfully run brew man locally and committed any changes?

    Failure: Broken pipe


Please help direct me to the right tests (if necessary). Also, I'm unable to test this because it does no appear that brew cares about the prefix when it's not in /opt or /usr. When I run arch -x86_64 brew install ... it completes successfully and does not complain. Is there a way to instruct brew to care so I can hit the codepath?

It's possible the user's terminal emulator is running under rosetta2.
Consequently, the i86_64 version of the ruby interpreter will be used.
Likely, the right thing to do is simply install the arm64 version of the
requested package. This can be accomplished using: arch -arm64 brew ...

Fixes: Homebrew#10313
@dcow dcow changed the title install: add workaround for rosetta2 path error msg install: add workaround for rosetta2 path error to msg Jan 14, 2021
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. Looks good so far!

Library/Homebrew/install.rb Outdated Show resolved Hide resolved
Library/Homebrew/install.rb Outdated Show resolved Hide resolved
@dcow
Copy link
Contributor Author

dcow commented Jan 14, 2021

@MikeMcQuaid let me know how you like the new prose. Thinking about it now, I wonder if we should but the more hand-holdy explanation in the brew doctor output and keep it terse in install.rb. Happy to keep moving things around and rewriting.

Also, I'm unable to test this because it does no appear that brew cares about the prefix when it's not in /opt or /usr. When I run arch -x86_64 bin/brew install ... it completes successfully and does not complain. Is there a way to instruct brew to care so I can hit the codepath?

@MikeMcQuaid
Copy link
Member

Also, I'm unable to test this because it does no appear that brew cares about the prefix when it's not in /opt or /usr. When I run arch -x86_64 bin/brew install ... it completes successfully and does not complain. Is there a way to instruct brew to care so I can hit the codepath?

You'll need to install into the expected location to hit that codepath (or temporarily edit code elsewhere to match whatever prefix you're using).

Incorporate suggested wording

Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
@MikeMcQuaid MikeMcQuaid marked this pull request as ready for review January 26, 2021 10:22
@MikeMcQuaid MikeMcQuaid merged commit 8a06a5e into Homebrew:master Jan 26, 2021
@MikeMcQuaid
Copy link
Member

Thanks so much for your first contribution! Without people like you submitting PRs we couldn't run this project. You rock, @dcow!

@BrewTestBot BrewTestBot added the outdated PR was locked due to age label Feb 26, 2021
@Homebrew Homebrew locked as resolved and limited conversation to collaborators Feb 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error: Cannot install in Homebrew under Rosetta 2 in ARM default prefix (/opt/homebrew)!
3 participants