Skip to content

M1 architecture support - incorrect keymap #280

@thclark

Description

@thclark

I'm on an M1 mac, and the architecture key hasn't been added yet.

Error (which came via running pre-commit) was:

stderr:
     * Install prebuilt node (15.8.0) 
    Traceback (most recent call last):
      File "/Users/thc29/.pyenv/versions/3.9.1/lib/python3.9/runpy.py", line 197, in _run_module_as_main
        return _run_code(code, main_globals, None,
      File "/Users/thc29/.pyenv/versions/3.9.1/lib/python3.9/runpy.py", line 87, in _run_code
        exec(code, run_globals)
      File "/Users/thc29/.pyenv/versions/windquest/lib/python3.9/site-packages/nodeenv.py", line 1471, in <module>
        main()
      File "/Users/thc29/.pyenv/versions/windquest/lib/python3.9/site-packages/nodeenv.py", line 1065, in main
        create_environment(env_dir, opt)
      File "/Users/thc29/.pyenv/versions/windquest/lib/python3.9/site-packages/nodeenv.py", line 951, in create_environment
        install_node(env_dir, src_dir, opt)
      File "/Users/thc29/.pyenv/versions/windquest/lib/python3.9/site-packages/nodeenv.py", line 716, in install_node
        install_node_wrapped(env_dir, src_dir, opt)
      File "/Users/thc29/.pyenv/versions/windquest/lib/python3.9/site-packages/nodeenv.py", line 732, in install_node_wrapped
        node_url = get_node_bin_url(opt.node)
      File "/Users/thc29/.pyenv/versions/windquest/lib/python3.9/site-packages/nodeenv.py", line 532, in get_node_bin_url
        'arch': archmap[platform.machine()],
    KeyError: 'arm64'

There is a native build of node now available for M1 so shouldn't be too bad a fix, but, it's worth noting that there's some discrepancy on the architecture key. This morning I've seen both arm64 and arm64/v8, while I have it on good authority from an ARM principal engineer (it's nice to have friends in tech!) that it should strictly just be armv8 or armv8.4! So you could probably get away with arm64 on the basis of my error above, but just to save future hassle it might be worth mapping all of those.

Aside: I haven't yet worked out whether the redonculous speed of things like yarn install is worth all the bugs that have yet to be ironed out with this M1 architecture! As of Feb 2021, developers should expect several days of messing about...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions