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

[BUG] FAILED to install on Mac M1 with Rust 1.44.0 #205

Closed
sherlock-tez opened this issue May 23, 2021 · 15 comments
Closed

[BUG] FAILED to install on Mac M1 with Rust 1.44.0 #205

sherlock-tez opened this issue May 23, 2021 · 15 comments

Comments

@sherlock-tez
Copy link

sherlock-tez commented May 23, 2021

Description

To Reproduce

Steps to reproduce the behavior:
Run brew install tezos-client on Mac M1

Environment

OS: MacOs BigSur 11.3.1

Additional context

Last 15 lines from /Users/phannguyen/Library/Logs/Homebrew/tezos-client/01.rustup-init:
2021-05-23 15:45:09 +0700

rustup-init
--default-toolchain
1.44.0
-y

error: $HOME differs from euid-obtained home directory: you may be using sudo
error: $HOME directory: /private/tmp/tezos-client-20210523-17574-kimclr/.brew_home
error: euid-obtained home directory: /Users/phannguyen
info: profile set to 'default'
info: default host triple is aarch64-apple-darwin
info: syncing channel updates for '1.44.0-aarch64-apple-darwin'
info: latest update on 2020-06-04, rust version 1.44.0 (49cae5576 2020-06-01)
error: target 'aarch64-apple-darwin' not found in channel.  Perhaps check https://doc.rust-lang.org/nightly/rustc/platform-support.html for available targets

Do not report this issue to Homebrew/brew or Homebrew/core!

Traceback (most recent call last):
	26: from /opt/homebrew/Library/Homebrew/build.rb:229:in `<main>'
	25: from /opt/homebrew/Library/Homebrew/build.rb:133:in `install'
	24: from /opt/homebrew/Library/Homebrew/utils.rb:558:in `with_env'
	23: from /opt/homebrew/Library/Homebrew/build.rb:138:in `block in install'
	22: from /opt/homebrew/Library/Homebrew/formula.rb:1259:in `brew'
	21: from /opt/homebrew/Library/Homebrew/formula.rb:2318:in `stage'
	20: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/forwardable.rb:230:in `stage'
	19: from /opt/homebrew/Library/Homebrew/resource.rb:91:in `stage'
	18: from /opt/homebrew/Library/Homebrew/resource.rb:116:in `unpack'
	17: from /opt/homebrew/Library/Homebrew/resource.rb:199:in `mktemp'
	16: from /opt/homebrew/Library/Homebrew/mktemp.rb:63:in `run'
	15: from /opt/homebrew/Library/Homebrew/mktemp.rb:63:in `chdir'
	14: from /opt/homebrew/Library/Homebrew/mktemp.rb:63:in `block in run'
	13: from /opt/homebrew/Library/Homebrew/resource.rb:117:in `block in unpack'
	12: from /opt/homebrew/Library/Homebrew/download_strategy.rb:102:in `stage'
	11: from /opt/homebrew/Library/Homebrew/download_strategy.rb:110:in `chdir'
	10: from /opt/homebrew/Library/Homebrew/resource.rb:121:in `block (2 levels) in unpack'
	 9: from /opt/homebrew/Library/Homebrew/formula.rb:2338:in `block in stage'
	 8: from /opt/homebrew/Library/Homebrew/utils.rb:558:in `with_env'
	 7: from /opt/homebrew/Library/Homebrew/formula.rb:2339:in `block (2 levels) in stage'
	 6: from /opt/homebrew/Library/Homebrew/formula.rb:1266:in `block in brew'
	 5: from /opt/homebrew/Library/Homebrew/build.rb:178:in `block (2 levels) in install'
	 4: from /opt/homebrew/Library/Taps/serokell/homebrew-tezos-packaging/Formula/tezos-client.rb:50:in `install'
	 3: from /opt/homebrew/Library/Taps/serokell/homebrew-tezos-packaging/Formula/tezos-client.rb:37:in `make_deps'
	 2: from /opt/homebrew/Library/Homebrew/formula.rb:2111:in `system'
	 1: from /opt/homebrew/Library/Homebrew/formula.rb:2111:in `open'
/opt/homebrew/Library/Homebrew/formula.rb:2175:in `block in system': Failed executing: rustup-init --default-toolchain 1.44.0 -y (BuildError)
	9: from /opt/homebrew/Library/Homebrew/brew.rb:155:in `<main>'
	8: from /opt/homebrew/Library/Homebrew/brew.rb:167:in `rescue in <main>'
	7: from /opt/homebrew/Library/Homebrew/exceptions.rb:494:in `dump'
	6: from /opt/homebrew/Library/Homebrew/exceptions.rb:440:in `issues'
	5: from /opt/homebrew/Library/Homebrew/exceptions.rb:444:in `fetch_issues'
	4: from /opt/homebrew/Library/Homebrew/utils/github.rb:67:in `issues_for_formula'
	3: from /opt/homebrew/Library/Homebrew/utils/github.rb:36:in `search_issues'
	2: from /opt/homebrew/Library/Homebrew/utils/github.rb:166:in `search'
	1: from /opt/homebrew/Library/Homebrew/utils/github/api.rb:234:in `open_rest'
/opt/homebrew/Library/Homebrew/utils/github/api.rb:304:in `raise_error': Validation Failed: [{"message"=>"The listed users and repositories cannot be searched either because the resources do not exist or you do not have permission to view them.", "resource"=>"Search", "field"=>"q", "code"=>"invalid"}] (GitHub::API::ValidationFailedError)
@sherlock-tez
Copy link
Author

sherlock-tez commented May 23, 2021

Update rust to 1.49.0/1.52.1 wont sold the problem. Another error:

==> opam init --bare --debug --auto-setup --disable-sandboxing
==> source .cargo/env && make build-deps
Last 15 lines from /Users/phannguyen/Library/Logs/Homebrew/tezos-client/03.env:
    completions    Generate tab-completion scripts for your shell
    help           Prints this message or the help of the given subcommand(s)

DISCUSSION:
    Rustup installs The Rust Programming Language from the official
    release channels, enabling you to easily switch between stable,
    beta, and nightly compilers and keep them updated. It makes
    cross-compiling simpler with binary builds of the standard library
    for common platforms.

    If you are new to Rust consider running `rustup doc --book` to
    learn Rust. in the past. Run the following command from your
favorite shell, and retry to install the dependencies:
$ rustup override unset
make: *** [build-deps] Error 1

Do not report this issue to Homebrew/brew or Homebrew/core!

Traceback (most recent call last):
	26: from /opt/homebrew/Library/Homebrew/build.rb:229:in `<main>'
	25: from /opt/homebrew/Library/Homebrew/build.rb:133:in `install'
	24: from /opt/homebrew/Library/Homebrew/utils.rb:558:in `with_env'
	23: from /opt/homebrew/Library/Homebrew/build.rb:138:in `block in install'
	22: from /opt/homebrew/Library/Homebrew/formula.rb:1259:in `brew'
	21: from /opt/homebrew/Library/Homebrew/formula.rb:2318:in `stage'
	20: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/forwardable.rb:230:in `stage'
	19: from /opt/homebrew/Library/Homebrew/resource.rb:91:in `stage'
	18: from /opt/homebrew/Library/Homebrew/resource.rb:116:in `unpack'
	17: from /opt/homebrew/Library/Homebrew/resource.rb:199:in `mktemp'
	16: from /opt/homebrew/Library/Homebrew/mktemp.rb:63:in `run'
	15: from /opt/homebrew/Library/Homebrew/mktemp.rb:63:in `chdir'
	14: from /opt/homebrew/Library/Homebrew/mktemp.rb:63:in `block in run'
	13: from /opt/homebrew/Library/Homebrew/resource.rb:117:in `block in unpack'
	12: from /opt/homebrew/Library/Homebrew/download_strategy.rb:102:in `stage'
	11: from /opt/homebrew/Library/Homebrew/download_strategy.rb:110:in `chdir'
	10: from /opt/homebrew/Library/Homebrew/resource.rb:121:in `block (2 levels) in unpack'
	 9: from /opt/homebrew/Library/Homebrew/formula.rb:2338:in `block in stage'
	 8: from /opt/homebrew/Library/Homebrew/utils.rb:558:in `with_env'
	 7: from /opt/homebrew/Library/Homebrew/formula.rb:2339:in `block (2 levels) in stage'
	 6: from /opt/homebrew/Library/Homebrew/formula.rb:1266:in `block in brew'
	 5: from /opt/homebrew/Library/Homebrew/build.rb:178:in `block (2 levels) in install'
	 4: from /opt/homebrew/Library/Taps/phanngt/homebrew-tezos-packaging/Formula/tezos-client.rb:50:in `install'
	 3: from /opt/homebrew/Library/Taps/phanngt/homebrew-tezos-packaging/Formula/tezos-client.rb:39:in `make_deps'
	 2: from /opt/homebrew/Library/Homebrew/formula.rb:2111:in `system'
	 1: from /opt/homebrew/Library/Homebrew/formula.rb:2111:in `open'
/opt/homebrew/Library/Homebrew/formula.rb:2175:in `block in system': Failed executing: source .cargo/env && make build-deps (BuildError)
	9: from /opt/homebrew/Library/Homebrew/brew.rb:155:in `<main>'
	8: from /opt/homebrew/Library/Homebrew/brew.rb:167:in `rescue in <main>'
	7: from /opt/homebrew/Library/Homebrew/exceptions.rb:494:in `dump'
	6: from /opt/homebrew/Library/Homebrew/exceptions.rb:440:in `issues'
	5: from /opt/homebrew/Library/Homebrew/exceptions.rb:444:in `fetch_issues'
	4: from /opt/homebrew/Library/Homebrew/utils/github.rb:67:in `issues_for_formula'
	3: from /opt/homebrew/Library/Homebrew/utils/github.rb:36:in `search_issues'
	2: from /opt/homebrew/Library/Homebrew/utils/github.rb:166:in `search'
	1: from /opt/homebrew/Library/Homebrew/utils/github/api.rb:234:in `open_rest'
/opt/homebrew/Library/Homebrew/utils/github/api.rb:304:in `raise_error': Validation Failed: [{"message"=>"The listed users and repositories cannot be searched either because the resources do not exist or you do not have permission to view them.", "resource"=>"Search", "field"=>"q", "code"=>"invalid"}] (GitHub::API::ValidationFailedError)

@rvem
Copy link
Member

rvem commented May 24, 2021

Hmm, apparently, Tezos is not buildable under arm64 MacOS yet:(
Though, there is a related MR: https://gitlab.com/tezos/tezos/-/merge_requests/2462

As a permanent solution, building and using formulas for x86 via rosetta should work

@sherlock-tez
Copy link
Author

sherlock-tez commented May 24, 2021

Do you have specific tutorial for rosetta? I am totally a newcomer.
I install normally -> FAILED.
Then try to adjust Rust to the newest version, but can not build the env and install app -> FAILED.
:D:D

@rvem
Copy link
Member

rvem commented May 24, 2021

Unfortunately I don't have a mac:(
Will something simple like arch -x86_64 brew install tezos-client work?

@sherlock-tez
Copy link
Author

Sorry late reply, but still does not work :(

@sherlock-tez
Copy link
Author

Finally I can make it, we aliased 2 brews:
ibrew='arch -x86_64 /usr/local/bin/brew'
mbrew='arch -arm64e /opt/homebrew/bin/brew'

For ibrew, install by: arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Install tezos-client:
ibrew tap serokell/tezos-packaging https://github.com/serokell/tezos-packaging.git

ibrew install tezos-client

@rvem
Copy link
Member

rvem commented Jun 30, 2021

nice

@gschian0
Copy link

gschian0 commented Aug 7, 2021

I tried this last command and it got really confusing on my system and didn't work. Is there any updates on this. I would love to get this installed on my M1. @phanngt any insight on why that didn't work for me? If I can't get it to work like this can you point me in the right direction to remove the alias? thanks!

@SleepyDeveloper
Copy link

@gschian0 Just confirmed that this works on my m1 Mac running 11.5.2 (20G95).

First I ran:

arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Then:

ibrew='arch -x86_64 /usr/local/bin/brew'

When you ran ibrew tap serokell/tezos-packaging https://github.com/serokell/tezos-packaging.git did you get an error message like so: -bash: ibrew: command not found

In that case you've only just created a variable named ibrew so you'll need to add a $ to the front.

$ibrew tap serokell/tezos-packaging https://github.com/serokell/tezos-packaging.git
$ibrew install tezos-client

@rvem
Copy link
Member

rvem commented Oct 4, 2021

Looks like the aforementioned MR in tezos/tezos was merged. Can you check if it works without additional rosetta workarounds now?

@sherlock-tez
Copy link
Author

sherlock-tez commented Oct 25, 2021

No, another bugs occurred.

Still using my old ibrew method.

@kaustabhbarman
Copy link

@gschian0 Just confirmed that this works on my m1 Mac running 11.5.2 (20G95).

First I ran:

arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Then:

ibrew='arch -x86_64 /usr/local/bin/brew'

When you ran ibrew tap serokell/tezos-packaging https://github.com/serokell/tezos-packaging.git did you get an error message like so: -bash: ibrew: command not found

In that case you've only just created a variable named ibrew so you'll need to add a $ to the front.

$ibrew tap serokell/tezos-packaging https://github.com/serokell/tezos-packaging.git
$ibrew install tezos-client

I tried your steps. When I run $ibrew command, it says zsh: no such file or directory: arch -x86_64 /usr/local/bin/brew

@Akaizz
Copy link

Akaizz commented Dec 16, 2021

@gschian0 Just confirmed that this works on my m1 Mac running 11.5.2 (20G95).
First I ran:
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Then:
ibrew='arch -x86_64 /usr/local/bin/brew'
When you ran ibrew tap serokell/tezos-packaging https://github.com/serokell/tezos-packaging.git did you get an error message like so: -bash: ibrew: command not found
In that case you've only just created a variable named ibrew so you'll need to add a $ to the front.

$ibrew tap serokell/tezos-packaging https://github.com/serokell/tezos-packaging.git
$ibrew install tezos-client

I tried your steps. When I run $ibrew command, it says zsh: no such file or directory: arch -x86_64 /usr/local/bin/brew

You need install Rosetta first

rvem added a commit that referenced this issue Dec 17, 2021
Problem: Currently formulas download opam x86_64 binary from the
GitHub release, which causes a build failure on machines with M1 cpu.

Solution: Determine CPU architecture in runtime and download appropriate
opam binary.
rvem added a commit that referenced this issue Dec 17, 2021
Problem: We want to release new versions of brew formulae that work on
M1.

Solution: Bump version in formulae and bump release number in meta.json.
rvem added a commit that referenced this issue Dec 17, 2021
Problem: Currently formulae download opam x86_64 binary from the
GitHub release, which causes a build failure on machines with M1 CPU.

Solution: Determine CPU architecture in runtime and download appropriate
opam binary.
rvem added a commit that referenced this issue Dec 17, 2021
Problem: We want to release new versions of brew formulae that work on
M1.

Solution: Bump version in formulae and bump release number in meta.json.
@rvem rvem mentioned this issue Dec 17, 2021
3 tasks
rvem added a commit that referenced this issue Dec 17, 2021
@rvem
Copy link
Member

rvem commented Dec 17, 2021

We've updated formulae to support M1 natively, suddenly there are no bottles yet (we're planning to publish them at the beginning of the next week), but at least you can check if it works for you now

@rvem
Copy link
Member

rvem commented Dec 21, 2021

We've published arm64_big_sur bottles for v11.0+no_adx-2, so I'm closing this issue

@rvem rvem closed this as completed Dec 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants