Skip to content

Streamline installation, reorganize utils and use node-build. #221

Closed
seivan wants to merge 5 commits intoasdf-vm:masterfrom
seivan:feature/streamline
Closed

Streamline installation, reorganize utils and use node-build. #221
seivan wants to merge 5 commits intoasdf-vm:masterfrom
seivan:feature/streamline

Conversation

@seivan
Copy link
Copy Markdown

@seivan seivan commented Mar 24, 2021

Requirements

macOS

  • Batteries included!

Linux

  • curl, wget or aria2c - apt-get install curl
  • openssl, shasum, or sha256sum

Use

To build from source, make sure all requisite libraries are available.

When installing Node.js using asdf install, you can pass custom configure options with the following env vars:

Building from source

  • NODE_CONFIGURE_OPTS - ./configure
  • NODE_MAKE_OPTS - make
  • NODE_MAKE_INSTALL_OPTS - make install

And additional build options.

Additional options

  • ASDF_NPM_DEFAULT_PACKAGES_FILE - Defaults default-npm-packages
  • ASDF_SKIP_RESHIM - Defaults to 1, for skipping reshim on installs.
  • ASDF_NODE_BUILD_VERSION - Defaults to v4.9.33
  • ASDF_NODE_BUILD_MIRROR_URL - Defaults to official mirror https://nodejs.org/dist/.

If you are in China, you can set it to ASDF_NODE_BUILD_MIRROR_URL=https://npm.taobao.org/mirrors/node/.

@seivan seivan force-pushed the feature/streamline branch from 8724a7e to 6f51f50 Compare March 24, 2021 16:18
@augustobmoura
Copy link
Copy Markdown
Member

If I understand correctly the patch is to build nodejs with node-build every install, independently of prebuilt releases? Is that correct?

@seivan
Copy link
Copy Markdown
Author

seivan commented Mar 31, 2021

It will default to prebuilt and only fallback for source if necessary.

@augustobmoura
Copy link
Copy Markdown
Member

node-build will default to prebuilt binaries instead of us right?

Maybe @Stratus3D could help me here, but I don't think using node-build is in alignment with the premise of this project, we should be an alternative implementation for other node versioning tools (nvm, n, nodenv/nodebuild) not a wrapper around them. Even though node-build is highly stable and mature we are targeting a much simpler approach to node versioning and building. I'm not a full fledged maintainer of this project, so feel free to keep the idea and discuss it further

About the installation of node-build, there are some problems about updating and versioning node-build itself, have you considered writing an asdf plugin for node-build on it's own, something like asdf-node-build? It would be much nicer option and it would create some welcoming alternatives to asdf-nodejs, you can even add it to the official plugins list. We can also put it in an alternatives section in the end of the README of this project

@seivan seivan force-pushed the feature/streamline branch from 5459042 to 095313f Compare April 1, 2021 07:20
@seivan seivan closed this Apr 2, 2021
@seivan seivan deleted the feature/streamline branch April 2, 2021 03:29
@Stratus3D
Copy link
Copy Markdown
Member

Stratus3D commented Apr 9, 2021

@augustobmoura it all depends on what is best. There is nothing inherently wrong with using node-build for installing node inside an asdf plugin. Plugins should ideally be as simple as possible, and one of the ways we can keep them simple is be relying on existing software. In the case of the https://github.com/asdf-vm/asdf-ruby plugin, we use ruby-build to handle building Ruby. ruby-build is a well maintained tool that automates a lot and allows us to keep the ruby plugin relatively simple.

I'm all for using node-build if it results in a better experience for asdf-nodejs users. The experience we are providing right now with this plugin isn't great, and there is a ton of room for improvement. If node-build is going to make this plugin easier to manage, and give our users a better experience then I think it worth doing, assuming it is stable. One important distinction here is that ruby-build and node-build are tools that build, asdf is a tool that manages versions, so they aren't really at odds with each other.

I'm not a full fledged maintainer of this project, so feel free to keep the idea and discuss it further

You are now 😄

About the installation of node-build, there are some problems about updating and versioning node-build itself, have you considered writing an asdf plugin for node-build on it's own, something like asdf-node-build? It would be much nicer option and it would create some welcoming alternatives to asdf-nodejs, you can even add it to the official plugins list. We can also put it in an alternatives section in the end of the README of this project

See how we handle things with the https://github.com/asdf-vm/asdf-ruby plugin. We have a hardcoded ruby-build version that we bump whenever a new ruby-build version comes out that is compatible. We could do the same thing here for node-build if you think that makes sense. I'm hoping over time you can become somewhat of a domain expert on this plugin and free me up to work more on asdf core.

@Stratus3D
Copy link
Copy Markdown
Member

@seivan feel free to leave this PR open, we are all very busy and the lack of a response doesn't mean we've rejected it.

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.

3 participants