Comments (7)
@kamalmarhubi I agree you need the ability to get any specific version. I'll look into platforms, but the simple answer is to change the node_repositories
rule to allow you to pass a label for the the node (for each OS). You don't want it on nodejs_binary
because then you could have different node version for different binaries in the same repo, which I think is a bad idea.
In addition to allowing you to specify any version, I just saw that Node 8 is now LTS so we should upgrade the default version that ships with the rules.
from rules_nodejs.
I think we ought to support LTS versions of node - that means according to the schedule we should do it next month. https://github.com/nodejs/LTS
from rules_nodejs.
I'd strongly advocate for making the version user specified. We've had serious issues with even minor version bumps, and would need to be able to choose the node version we use.
from rules_nodejs.
Fair enough. The only hard part I see is that I need a URL to fetch node from, and it's platform dependent, plus I have manually mirrored the current version to our CDN
https://github.com/bazelbuild/rules_nodejs/blob/master/internal/node_install.bzl#L29
So I'm not sure how the user would express this dependency. Maybe it's sufficient just to give the choice of major versions (6,7,8,9).
Also I have to pick which node versions these rules are tested against. And we want rules to be portable, so if you write a node program requiring 8, then all users must upgrade. Of course that problem exists without Bazel involved.
from rules_nodejs.
For ease of use, the current setup is great. If adding flexibility, major version is not enough for us. For example, a patch upgrade from 4.8.2 to 4.8.4 caused segfaults in production for one of our services because of issues with a native module at that version. So it's important to be able to hold back certain nodejs_binary
targets.
I was reading about platforms earlier, and it seems that might be the right way to go about this. Users could define toolchains like node_6.11.3
and so on, or something like that? I haven't really understood the whole thing that well, and definitely haven't understood how toolchain resolution works.
As an intermediate that requires less fussing around with new concepts, the nodejs_binary
rule could take a label to specify the nodejs executable to run. This lets users have very fine control where needed. Thoughts?
from rules_nodejs.
rules_go also allows to swap out the version of the go sdk, might be worth synchronising with how it is done there.
from rules_nodejs.
Fixed in #183
from rules_nodejs.
Related Issues (20)
- Multiple CRA apps under single workspace [help wanted]: HOT 2
- [Bug]: nodejs_binary doesn't set up its node_modules hermetically HOT 4
- rules_nodejs 6.0.0 HOT 2
- [Bug]: Why bazel run doesn't launch on windows,/bin/bash: C:/zhuomian/jancsiwebspace/fhbfwior/execroot/jancsi_web_space/bazel-out/x64_windows-fastbuild/bin/LicenseWebManager/start.sh: No such file or directory HOT 3
- bazel rule jasmine_test fails stating `copying files failed` HOT 3
- [FR]: Can we backport updated NodeJS versions to v5? HOT 1
- [Bug]: not functioning properly
- [Bug]: `npm_install` modifying the source tree during the build is an antipattern HOT 10
- Migrate to Bzlmod for managing external dependencies HOT 3
- Errors encountered resolving select() keys for //:using_headers_test with Bazel@HEAD HOT 4
- [FR]: rules_nodejs 5.x release line stopped becoming node version updates HOT 2
- Error : No repository visible as '@platforms' from main repository with Bazel@HEAD HOT 1
- Executing genrule //:require_acorn failed with Bazel@HEAD HOT 1
- BuildFileNotFoundException: no such package '@@[unknown repo 'buildkite_config' requested from @@]//config': The repository '@@[unknown repo 'buildkite_config' requested from @@]' could not be resolved: No repository visible as '@buildkite_config' from main repository HOT 7
- [FR]: @bazel/runfiles needs to handle repo mapping HOT 5
- Error executing Genrule command from target //:call_acorn in CI at Bazel@HEAD HOT 2
- Vue introduces Element-Plus to report error HOT 1
- [Bug]: `nodejs_repo_host_os_alias` produces dangling symlink when Bzlmod is enabled HOT 2
- [FR]: Support .nvmrc file in BZLMOD HOT 3
- [FR]: Separate toolchain for for C++ headers HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rules_nodejs.