-
Notifications
You must be signed in to change notification settings - Fork 30k
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
tools: add Boxstarter script #17046
tools: add Boxstarter script #17046
Conversation
Adds a Boxstarter script for easy Node.js building prerequisites installation
tools/boxstarter/README.md
Outdated
Install-BoxstarterPackage https://raw.githubusercontent.com/nodejs/node/master/tools/boxstarter/node_boxstarter -DisableReboots | ||
``` | ||
|
||
* For Node.js prerequisites with VS Code: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why we need this?
# | ||
|
||
# Git and Unix tools will be added to the PATH | ||
choco install git -params /GitAndUnixToolsOnPath -y |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer it if we didn't install the editor as well - most people being onboarded have their own preference for an editor.
tools/boxstarter/README.md
Outdated
@@ -0,0 +1,54 @@ | |||
# Boxstarter setup for Node.js | |||
|
|||
A [Boxstarter][] script can be used for an easy setup of Windows systems with all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe remove an
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Waiting for vscode
choco install visualstudio2017-workload-vctools -y | ||
|
||
# Installs Visual Studio Code | ||
choco install visualstudiocode -y |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to not installing an editor, especially if it means duplicating the whole script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of duplicating the script, we could just check if an environment variable is set indicating whether an editor should be installed? (not advocating one way or the other but just pointing out that we likely don't need to duplicate the whole script)
Love it. powershell.exe -ExecutionPolicy Unrestricted -noprofile -Command "&{iex ((New-Object System.Net.WebClient).DownloadString('http://boxstarter.org/bootstrapper.ps1')); get-boxstarter -Force; Install-BoxstarterPackage https://raw.githubusercontent.com/nodejs/node/master/tools/boxstarter/node_boxstarter -DisableReboots}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cautiously +1 on this, but it seems odd to just have Windows packages documented. I think I'd prefer something in doc/guides/
that covered all platforms (e.g. brew
for macOS, apt/yum/pacman+ for Linux etc.).
tools/boxstarter/node_boxstarter
Outdated
|
||
# Installs VS 2017 Build Tools | ||
choco install visualstudio2017buildtools -y | ||
choco install visualstudio2017-workload-vctools -y |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the benefit of using Boxstarter here rather than just using chocolatey directly? Is it the web url?
Looking at their page, I'm not seeing anything obviously beneficial, and it's another thing for new starters to understand.
:: Copied from chocolatey website
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
choco install git -params /GitAndUnixToolsOnPath -y
choco install python2 visualstudio2017buildtools visualstudio2017-workload-vctools -y
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use a more generic directory name like tools/bootstrap/
and then iterate over recipes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an improvement either way, but I'd go with boxstarter rather than just chocolatey. For users that want to understand this or already know about chocolatey, the script is very easy to understand and use as a guide for their own custom installation (plus, dependencies are already documented in BUILDING.md
).
Looking at the Boxstarter page, it adds a lot of resilience to the process (reboots, disabling updates, etc), moving it much closer to the ideal one-click-no-issues setup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with or without VSCode.
Also cc @nodejs/platform-windows
tools/boxstarter/README.md
Outdated
## WebLauncher Installation | ||
|
||
To install Node.js prerequisites using [Boxstarter WebLauncher][], just open | ||
**one** of the following links with Internet Explorer or Edge browser on the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does it need to be just those two browsers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a "Click Once" app (https://msdn.microsoft.com/en-us/library/t71a733d.aspx). It works in IE and Edge by default, other browsers need a plugin.
choco install visualstudio2017-workload-vctools -y | ||
|
||
# Installs Visual Studio Code | ||
choco install visualstudiocode -y |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of duplicating the script, we could just check if an environment variable is set indicating whether an editor should be installed? (not advocating one way or the other but just pointing out that we likely don't need to duplicate the whole script)
This is awesome, thanks @bzoz! (cc @yodurr @rachelnicole). +1 to @refack's suggestion of adding this support to vcbuild too (although I would still prefer having an explicit developer shell for Node but that can come later 😄). |
Updated the PR, PTAL. I've renamed it from @refack |
I think you can do this to get elevated powershell:
(copied from the chocolatey getting started. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM modulo nit
BUILDING.md
Outdated
@@ -202,6 +202,9 @@ Prerequisites: | |||
[Git for Windows](http://git-scm.com/download/win) includes Git Bash | |||
and tools which can be included in the global `PATH`. | |||
|
|||
*Note:* All prerequisites can be easily installed by following | |||
[this bootstrapping guide](https://github.com/nodejs/node/blob/master/tools/bootstrap/README.md#Windows). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe not move this to the top of the list and drop the #Windows
off the end? That way it'll work when we add other platforms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I don't understand what you mean
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this line to L83, and change it to:
All prerequisites can be easily installed by following
[this bootstrapping guide](https://github.com/nodejs/node/blob/master/tools/bootstrap/README.md).
Updated - moved the link, and added instructions for Linux. PTAL |
tools/bootstrap/README.md
Outdated
@@ -22,6 +22,20 @@ get-boxstarter -Force | |||
Install-BoxstarterPackage https://raw.githubusercontent.com/nodejs/node/master/tools/bootstrap/windows_boxstarter -DisableReboots | |||
``` | |||
|
|||
## Linux | |||
|
|||
For building Node.js on Linux, following packets are required (note, that this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should packets
be packages
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this looks great, worth adding macOS too, but otherwise let's land.
tools/bootstrap/README.md
Outdated
To bootstrap Node.js on Linux, run in terminal: | ||
* OpenSUSE: `sudo zypper install git-core python gcc-c++ make` | ||
* Fedora: `sudo dnf install git-core python gcc-c++ make` | ||
* Ubuntu, Debian: `sudo apt-get install git-core python g++ make` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does git-core work? From the website it seems like it should be git
for all three distros.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tools/bootstrap/README.md
Outdated
* OpenSUSE: `sudo zypper install git-core python gcc-c++ make` | ||
* Fedora: `sudo dnf install git-core python gcc-c++ make` | ||
* Ubuntu, Debian: `sudo apt-get install git-core python g++ make` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For macOS I'm pretty sure it's just:
xcode-select --install # Installs git, make, and clang
python2
is already installed.
I gave this a spin on a new machine which happened to have VS (internal dogfood) and git already installed. There were probably some issues caused by VS already being installed because the boxstarter script ended with a strange warning about chocolatey failing but didn't actually print out what the error was, it just asked me to hit enter and then it exited- but it looks like python27 was installed correctly. One thing that might be useful to add in the readme is how much free disk space the user should be expected to have before running the script? |
@digitalinfinity I just tried that, a fresh Win2016 install on amazon takes 13.7 GB. After the script it rises to 21.6 GB |
Great, thanks for checking! Perhaps it would be good to document that expectation? |
Updated, PTAL |
Landed in 61d46dd |
Adds a Boxstarter script for easy Node.js building prerequisites installation PR-URL: #17046 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: João Reis <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
Adds a Boxstarter script for easy Node.js building prerequisites installation PR-URL: #17046 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: João Reis <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
Adds a Boxstarter script for easy Node.js building prerequisites installation PR-URL: #17046 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: João Reis <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
Adds a Boxstarter script for easy Node.js building prerequisites installation PR-URL: #17046 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: João Reis <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
Adds a Boxstarter script for easy Node.js building prerequisites installation PR-URL: #17046 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: João Reis <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
Adds a Boxstarter script for easy Node.js building prerequisites installation PR-URL: #17046 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: João Reis <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
Adds a Boxstarter script and documentation for an easy way to install Node.js building prerequisites on Windows. It will install git, python, msbuild tools and optionally VSCode.
Ref: nodejs/code-and-learn#71
The links will not work until this lands. A version with working links can be found here:
tools/boxstarter/README.mdEdit: new link - tools/bootstrap/README.md.
Checklist
Affected core subsystem(s)
build, doc, tools