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

google-cloud-sdk crashes on Apple M1 #135045

Closed
verokarhu opened this issue Aug 21, 2021 · 7 comments
Closed

google-cloud-sdk crashes on Apple M1 #135045

verokarhu opened this issue Aug 21, 2021 · 7 comments
Labels
0.kind: bug 6.topic: darwin Running or building packages on Darwin 9.needs: upstream fix

Comments

@verokarhu
Copy link

Describe the bug

Running the unstable version of google-cloud-sdk on an M1 Mac results in the following error:

ERROR: gcloud crashed (MemoryError): Cannot allocate write+execute memory for ffi.callback(). You might be running on a system that prevents this. For more information, see https://cffi.readthedocs.io/en/latest/using.html#callbacks

Steps To Reproduce

Steps to reproduce the behavior:

  1. Create shell.nix with following content:
with import (builtins.fetchTarball {
  name = "nixos-unstable";
  sha256 = "14szn1k345jfm47k6vcgbxprmw1v16n7mvyhcdl7jbjmcggjh4z7";
  url = "https://github.com/NixOS/nixpkgs/archive/253aecf69ed7595aaefabde779aa6449195bebb7.tar.gz";
}) {};

mkShell {
  buildInputs = [
    google-cloud-sdk
  ];
}
  1. Run nix-shell --run "gcloud info --run-diagnostics"

Expected behavior

Diagnostic information from gcloud is successfully printed.

Notify maintainers

@iAmMrinal0
@pradyuman
@stephenmw
@zimbatm

Metadata

 - system: `"aarch64-darwin"`
 - host os: `Darwin 20.6.0, macOS 11.5.2`
 - multi-user?: `no`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.3.15`
 - channels(andreasm): `"home-manager-21.05, nixpkgs-21.11pre309670.253aecf69ed"`
 - nixpkgs: `/Users/andreasm/.nix-defexpr/channels/nixpkgs`
@veprbl veprbl added the 6.topic: darwin Running or building packages on Darwin label Aug 21, 2021
@jduan
Copy link
Contributor

jduan commented Sep 9, 2021

I've encountered the same problem for my m1 laptop when trying to install google-cloud-sdk.

@Artturin
Copy link
Member

Artturin commented Sep 9, 2021

pyOpenSSL doesn't work on m1
pyca/pyopenssl#873 (comment)

@ghost
Copy link

ghost commented Sep 9, 2021

Thanks @Artturin

@maciej-trebacz
Copy link

@Artturin is there a way to mitigate that somehow? I'm on an M1 machine and gcloud CLI when installed via their installer works fine, it just doesn't work under Nix. I have a suspicion that the reason is my Python installation is actually x86_64 (which I checked using file /usr/local/bin/python3) while the Python and all the libraries Nix installes are arm64. Maybe a workaround for this bug could be making Nix install an x86_64 version of Python and all the libraries as a dependency of google-cloud-sdk on M1 machines?

@iAmMrinal0
Copy link
Member

#141773 uses openSSL instead of pyOpenSSL. Maybe someone could try it from unstable?

@maciej-trebacz
Copy link

@iAmMrinal0 I've just tested and it does indeed work, thank you! With this I think this issue can be closed.

@iAmMrinal0
Copy link
Member

Thanks for testing and verifying.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug 6.topic: darwin Running or building packages on Darwin 9.needs: upstream fix
Projects
None yet
Development

No branches or pull requests

6 participants