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

Multiple Node versions in a single workspace #434

Closed
rohansingh opened this issue Nov 29, 2018 · 7 comments
Closed

Multiple Node versions in a single workspace #434

rohansingh opened this issue Nov 29, 2018 · 7 comments
Labels
Can Close? We will close this in 30 days if there is no further activity enhancement

Comments

@rohansingh
Copy link

Right now, node_repositories always creates a single _nodejs_repo with the name nodejs. Is there any particular reason that it doesn't accept a name parameter to allow creating multiple _nodejs_repo instances?

This would allow having multiple Node versions (say, 8.x and 10.x) in a single project, which is a real-life use case for me.

If this isn't an active design choice or constraint, I'd be happy to work on a PR. It looks like @nodejs is only explicitly referenced in a few places, so it should be straightforward to allow overriding it.

@rohansingh rohansingh changed the title Multiple Node versions in a single repo Multiple Node versions in a single workspace Nov 29, 2018
@rohansingh
Copy link
Author

Note that this is different from #167 and #183, which seem to be about being able to configure a Node version. That's something we can do now, but I'd like to be able to use different versions for different targets.

@gregmagolan
Copy link
Collaborator

Having multiple nodejs versions in a single workspace sounds like a useful feature however we are looking at updating the nodejs rules to use Bazel toolchains for node (https://docs.bazel.build/versions/master/toolchains.html) to support cross-platform remote bazel execution. For example, if you are building on OSX you can still execute actions on GCP (https://blog.bazel.build/2018/10/05/remote-build-execution.html).

Looking at the current code it looks like this shouldn't be too hard to achieve what you'd like at the moment and would be happy to accept a PR if you want to take a shot at it.

We'll be updating to Bazel toolchains for before 1.0 most likely which would invalidate the work but hopefully toolchains will make it easier to achieve this.

@rohansingh
Copy link
Author

rohansingh commented Dec 19, 2018

Do you have a rough idea of the timeline for migrating to toolchains?

If it's later than Q1 then I'll take a look at a PR. Otherwise I'm happy to wait.

@gregmagolan
Copy link
Collaborator

/cc @Globegitter Something to keep in mind when you're looking at toolchains. Thanks.

@Toxicable
Copy link

#645
tool chain support PR

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had any activity for 90 days. It will be closed if no further activity occurs in two weeks. Collaborators can add a "cleanup" or "need: discussion" label to keep it open indefinitely. Thanks for your contributions to rules_nodejs!

@github-actions github-actions bot added the Can Close? We will close this in 30 days if there is no further activity label Nov 18, 2020
@github-actions
Copy link

github-actions bot commented Dec 2, 2020

This issue was automatically closed because it went two weeks without a reply since it was labeled "Can Close?"

@github-actions github-actions bot closed this as completed Dec 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Can Close? We will close this in 30 days if there is no further activity enhancement
Projects
None yet
Development

No branches or pull requests

3 participants