tweag / jupyenv

Declarative and reproducible Jupyter environments - powered by Nix
https://jupyenv.io/
MIT License
651 stars 135 forks source link

[Bug]: Doesn't work on modern Apple Silicon machines (e.g. M1/M2/M3/M4 etc.) #540

Open victorhooi opened 4 months ago

victorhooi commented 4 months ago

Current Behavior

I'm trying to install this on my Macbook Pro (M3) - however, it seems to error out about the architecture:

$ nix run
warning: creating lock file '/Users/foobar/code/csv_playground/flake.lock': 
• Added input 'flake-compat':
    'github:edolstra/flake-compat/0f9255e01c2351cc7d116c072cb317785dd33b33?narHash=sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U%3D' (2023-10-04)
• Added input 'flake-utils':
    'github:numtide/flake-utils/b1d9ab70662946ef0850d488da1c9019f3a9752a?narHash=sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ%3D' (2024-03-11)
• Added input 'flake-utils/systems':
    'github:nix-systems/default/da67096a3b9bf56a91d16901293e51ba5b49a27e?narHash=sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768%3D' (2023-04-09)
• Added input 'jupyenv':
    'github:tweag/jupyenv/0c86802aaa3ffd3e48c6f0e7403031c9168a8be2?narHash=sha256-TwuIyyz3EwkSieJxATAiFPv5abr3a0P1idlCejsiZWY%3D' (2023-10-17)
• Added input 'jupyenv/flake-compat':
    'github:edolstra/flake-compat/35bb57c0c8d8b62bbfd284272c928ceb64ddbde9?narHash=sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm%2B504Ch3sNKLd8%3D' (2023-01-17)
• Added input 'jupyenv/flake-utils':
    'github:numtide/flake-utils/5aed5285a952e0b949eb3ba02c12fa4fcfef535f?narHash=sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau%2B/OdUAjtQ0rA%3D' (2022-11-02)
• Added input 'jupyenv/ihaskell':
    'github:ihaskell/ihaskell/1c22a874ac0c8ed019229f4a0cd5a0bfda017357?narHash=sha256-MahAFyp6AxY0H61U6zqJXM1NsckNNkK6iqONEtOPSK0%3D' (2022-12-19)
• Added input 'jupyenv/ihaskell/flake-compat':
    follows 'jupyenv/flake-compat'
• Added input 'jupyenv/ihaskell/flake-utils':
    follows 'jupyenv/flake-utils'
• Added input 'jupyenv/ihaskell/hls':
    'github:haskell/haskell-language-server/311107eabbf0537e0c192b2c377d282505b4eff1?narHash=sha256-ZgxPwV7t4DyGYP7aXoetq%2BJHtd73XlOV2fYSflQmOXw%3D' (2021-11-18)
• Added input 'jupyenv/ihaskell/hls/flake-compat':
    'github:edolstra/flake-compat/12c64ca55c1014cdc1b16ed5a804aa8576601ff2?narHash=sha256-hY8g6H2KFL8ownSiFeMOjwPC8P0ueXpCVEbxgda3pko%3D' (2021-08-02)
• Added input 'jupyenv/ihaskell/hls/flake-utils':
    'github:numtide/flake-utils/997f7efcb746a9c140ce1f13c72263189225f482?narHash=sha256-JHgasjPR0/J1J3DRm4KxM4zTyAj4IOJY8vIl75v/kPI%3D' (2021-08-20)
• Added input 'jupyenv/ihaskell/hls/gitignore':
    'github:hercules-ci/gitignore.nix/211907489e9f198594c0eb0ca9256a1949c9d412?narHash=sha256-qHu3uZ/o9jBHiA3MEKHJ06k7w4heOhA%2B4HCSIvflRxo%3D' (2021-01-26)
• Added input 'jupyenv/ihaskell/hls/nixpkgs':
    'github:NixOS/nixpkgs/5e47a07e9f2d7ed999f2c7943b0896f5f7321ca3?narHash=sha256-0ecIlrLsNIIa%2BzrNmzXXmbMBLZlmHU/aWFsa4bq99Hk%3D' (2021-09-06)
• Added input 'jupyenv/ihaskell/hls/pre-commit-hooks':
    'github:cachix/pre-commit-hooks.nix/397f0713d007250a2c7a745e555fa16c5dc8cadb?narHash=sha256-Amf/nBj1E77RmbSSmV%2Bhg6YOpR%2BrddCbbVgo5C7BS0I%3D' (2021-06-29)
• Added input 'jupyenv/ihaskell/hls/pre-commit-hooks/flake-utils':
    follows 'jupyenv/ihaskell/hls/flake-utils'
• Added input 'jupyenv/ihaskell/hls/pre-commit-hooks/nixpkgs':
    follows 'jupyenv/ihaskell/hls/nixpkgs'
• Added input 'jupyenv/ihaskell/nixpkgs':
    follows 'jupyenv/nixpkgs'
• Added input 'jupyenv/nix-dart':
    'github:djacu/nix-dart/8ee4e1a5ec0cc6c1e15860c4733f741485e8231e?narHash=sha256-JiZrr75JILHW7IaNW3MwpYn%2B084Q6/gnXScPR7Pozhs%3D' (2023-01-14)
• Added input 'jupyenv/nix-dart/flake-utils':
    follows 'jupyenv/flake-utils'
• Added input 'jupyenv/nix-dart/nixpkgs':
    follows 'jupyenv/nixpkgs'
• Added input 'jupyenv/nix-dart/pub2nix':
    'github:paulyoung/pub2nix/0c7ecca590fcd1616db8c6468f799ffef36c85e9?narHash=sha256-pDvcXSG1Mh2BpwkqAcNDJzcupV3pIAAtZJLfkiHMAz4%3D' (2020-07-08)
• Added input 'jupyenv/nixpkgs':
    'github:nixos/nixpkgs/6dccdc458512abce8d19f74195bb20fdb067df50?narHash=sha256-1kZi9OkukpNmOaPY7S5/%2BSlCDOuYnP3HkXHvNDyLQcc%3D' (2023-01-15)
• Added input 'jupyenv/nixpkgs-stable':
    'github:nixos/nixpkgs/0874168639713f547c05947c76124f78441ea46c?narHash=sha256-3lW3xZslREhJogoOkjeZtlBtvFMyxHku7I/9IVehhT8%3D' (2023-01-01)
• Added input 'jupyenv/npmlock2nix':
    'github:nix-community/npmlock2nix/0ba0746d62974403daf717cded3f24c617622bc7?narHash=sha256-/IxdS0AiqSN0/VEOLnnfHyi4nP17yPrkhGf6KlXVwrc%3D' (2022-11-21)
• Added input 'jupyenv/opam-nix':
    'github:tweag/opam-nix/75199758e1954f78286e7e79c0e3916e28b732b0?narHash=sha256-wHhdlDUC/tBDVFBemeJPpqdIRdehKKbxbdMP0QjOhM4%3D' (2022-12-02)
• Added input 'jupyenv/opam-nix/flake-compat':
    follows 'jupyenv/flake-compat'
• Added input 'jupyenv/opam-nix/flake-utils':
    follows 'jupyenv/flake-utils'
• Added input 'jupyenv/opam-nix/mirage-opam-overlays':
    'github:dune-universe/mirage-opam-overlays/05f1c1823d891ce4d8adab91f5db3ac51d86dc0b?narHash=sha256-CPTuhYML3F4J58flfp3ZbMNhkRkVFKmBEYBZY5tnQwA%3D' (2022-08-31)
• Added input 'jupyenv/opam-nix/nixpkgs':
    follows 'jupyenv/nixpkgs'
• Added input 'jupyenv/opam-nix/opam-overlays':
    'github:dune-universe/opam-overlays/c8f6ef0fc5272f254df4a971a47de7848cc1c8a4?narHash=sha256-RV68fUK%2BO3zTx61iiHIoS0LvIk0E4voMp%2B0SwRg6G6c%3D' (2022-06-02)
• Added input 'jupyenv/opam-nix/opam-repository':
    'github:ocaml/opam-repository/54e69ff0949a3aaec0d5e3d67898bb7f279ab09f?narHash=sha256-J3P%2BmXLwE2oEKTlMnx8sYRxwD/uNGSKM0AkAB7BNTxA%3D' (2022-08-22)
• Added input 'jupyenv/opam-nix/opam2json':
    'github:tweag/opam2json/32fa2dcd993a27f9e75ee46fb8b78a7cd5d05113?narHash=sha256-7f75C6fIkiLzfkwLpJxlQIKf%2BYORGsXGV8Dr2LDDi%2BA%3D' (2022-10-13)
• Added input 'jupyenv/opam-nix/opam2json/nixpkgs':
    follows 'jupyenv/opam-nix/nixpkgs'
• Added input 'jupyenv/poetry2nix':
    'github:nix-community/poetry2nix/a5c454a834cd290dd4d33102ab8b4aa37d850e65?narHash=sha256-QOsT76Al0Igpo0u5vtQJuDSOxrocX3sTD523pLPEklc%3D' (2023-01-17)
• Added input 'jupyenv/poetry2nix/flake-utils':
    follows 'jupyenv/flake-utils'
• Added input 'jupyenv/poetry2nix/nixpkgs':
    follows 'jupyenv/nixpkgs'
• Added input 'jupyenv/pre-commit-hooks':
    'github:cachix/pre-commit-hooks.nix/3e42a77571cc0463efa470dbcffa063977a521ab?narHash=sha256-0uZuAcYBpNJLxr7n5O0vhwn3rSLpUTm9M5WGgmNQ%2BwM%3D' (2023-01-18)
• Added input 'jupyenv/pre-commit-hooks/flake-compat':
    'github:edolstra/flake-compat/35bb57c0c8d8b62bbfd284272c928ceb64ddbde9?narHash=sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm%2B504Ch3sNKLd8%3D' (2023-01-17)
• Added input 'jupyenv/pre-commit-hooks/flake-utils':
    follows 'jupyenv/flake-utils'
• Added input 'jupyenv/pre-commit-hooks/gitignore':
    'github:hercules-ci/gitignore.nix/a20de23b925fd8264fd7fad6454652e142fd7f73?narHash=sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8%3D' (2022-08-14)
• Added input 'jupyenv/pre-commit-hooks/gitignore/nixpkgs':
    follows 'jupyenv/pre-commit-hooks/nixpkgs'
• Added input 'jupyenv/pre-commit-hooks/nixpkgs':
    follows 'jupyenv/nixpkgs'
• Added input 'jupyenv/pre-commit-hooks/nixpkgs-stable':
    'github:NixOS/nixpkgs/2f9fd351ec37f5d479556cd48be4ca340da59b8f?narHash=sha256-SFHraUqLSu5cC6IxTprex/nTsI81ZQAtDvlBvGDWfnA%3D' (2023-01-15)
• Added input 'jupyenv/rust-overlay':
    'github:oxalica/rust-overlay/eecc44934a0f6c02c02856b38bd3b6af3bec0870?narHash=sha256-ugwPxKjvmJ5GpzN/MHg8tuhe8nYi3SbJm5nWNy7CB0Q%3D' (2023-01-18)
• Added input 'jupyenv/rust-overlay/flake-utils':
    follows 'jupyenv/flake-utils'
• Added input 'jupyenv/rust-overlay/nixpkgs':
    follows 'jupyenv/nixpkgs'
• Added input 'nixpkgs':
    'github:nixos/nixpkgs/ad57eef4ef0659193044870c731987a6df5cf56b?narHash=sha256-SzDKxseEcHR5KzPXLwsemyTR/kaM9whxeiJohbL04rs%3D' (2024-05-29)
error: flake 'path:/Users/foobar/code/csv_playground' does not provide attribute 'apps.aarch64-darwin.default', 'defaultApp.aarch64-darwin', 'packages.aarch64-darwin.default' or 'defaultPackage.aarch64-darwin'

Expected Behavior

Ideally, this should work on Apple Silicon (ARM64) machines as it does on x64

Steps To Reproduce

Following the steps in the README:

  1. Create a new empty directory
  2. CD to that directory
  3. Run the nix flake command

    
    $ nix flake init --template github:tweag/jupyenv
    do you want to allow configuration setting 'extra-substituters' to be set to 'https://tweag-jupyter.cachix.org' (y/N)? y
    do you want to permanently mark this value as trusted (y/N)? y
    do you want to allow configuration setting 'extra-trusted-public-keys' to be set to 'tweag-jupyter.cachix.org-1:UtNH4Zs6hVUFpFBTLaA4ejYavPo5EFFqgd7G7FxGW9g=' (y/N)? y
    do you want to permanently mark this value as trusted (y/N)? y
    wrote: /Users/foobar/code/csv_playground/kernels.nix
    wrote: /Users/foobar/code/csv_playground/flake.nix
    
    You have created a jupyenv template.
    
    Run nix run to immediately try it out.
    
    See the jupyenv documentation for more information.
    
    https://jupyenv.io/documentation/getting-started/

### OS

```shell
The suggested command doesn't work for me:

nix-shell -p nix-info --run "nix-info -m"
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
error:
       … <borked>

         at «none»:0: (source not available)

       … while calling the 'import' builtin

         at «string»:1:18:

            1| {...}@args: with import <nixpkgs> args; (pkgs.runCommandCC or pkgs.runCommand) "shell" { buildInputs = [ (nix-info) ]; } ""
             |                  ^

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I)

       at «none»:0: (source not available)

However, I am on macOS 14.4.1



### Version

0c86802aaa3ffd3e48c6f0e7403031c9168a8be2

### Additional Context

_No response_

### Relevant log output

_No response_
avdv commented 4 months ago

Duplicate of https://github.com/tweag/jupyenv/issues/388

Currently, only Linux x86_64 is supported.

But see #issuecomment-1520632156