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

[Small] Check Node OS & Arch availability and support M1 native builds #915

Merged
merged 2 commits into from
Jan 14, 2021

Conversation

charlespierce
Copy link
Contributor

Closes #34

Info

  • Now that Rust 1.49 is out and has stable Tier 2 support for Apple M1 chips, we can create an M1 native build of Volta.
  • Currently, Node doesn't provide pre-built binaries for M1 chips, so we still need to fetch the x64 version of Node and run it through Rosetta 2.
  • At the same time, we should also confirm when resolving a Node version that it is available for the current OS & Architecture.

Changes

  • Updated the NODE_DISTRO_* constants to also include NODE_DISTRO_IDENTIFIER, representing the identifier used in the Node index files property.
    • Currently this uses the osx-x64-tar identifier on M1 MacOS, since Node doesn't provide pre-built M1 binaries and hasn't yet indicated what the identifier will be).
  • Updated the parsing of the Node index to exclude any versions that aren't available for the current OS / Architecture.
  • Removed some unused properties and traits.

Copy link
Contributor

@chriskrycho chriskrycho left a comment

Choose a reason for hiding this comment

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

Looks good! ⚡

@chriskrycho
Copy link
Contributor

Tested on my M1 MacBook Air—

  • launched native (non-Rosetta) Terminal
  • created a new project
  • volta pin node@15 npm@7

—it works perfectly!

@chriskrycho chriskrycho merged commit fb84ced into volta-cli:main Jan 14, 2021
@charlespierce charlespierce deleted the check_arch branch January 15, 2021 18:02
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

Successfully merging this pull request may close these issues.

resolving public node should check OS availability
2 participants