-
-
Notifications
You must be signed in to change notification settings - Fork 35.3k
build: how to build and test docs on Windows #19330
Copy link
Copy link
Closed
Labels
buildIssues and PRs related to build files or the CI.Issues and PRs related to build files or the CI.docIssues and PRs related to the documentations.Issues and PRs related to the documentations.testIssues and PRs related to the tests.Issues and PRs related to the tests.windowsIssues and PRs related to the Windows platform.Issues and PRs related to the Windows platform.
Metadata
Metadata
Assignees
Labels
buildIssues and PRs related to build files or the CI.Issues and PRs related to build files or the CI.docIssues and PRs related to the documentations.Issues and PRs related to the documentations.testIssues and PRs related to the tests.Issues and PRs related to the tests.windowsIssues and PRs related to the Windows platform.Issues and PRs related to the Windows platform.
This is a small how-to note on the mentioned topic.
Currently, there is no task like
doc-onlyin the vcbuild.bat, and the test for doc building result is skipped on Windows.However, sometimes it is needed to quickly test some doc changes for a PR locally on Windows, maybe without building the
node(~ 1 hour with 100% dual-core CPU on my machine).It turns out to be not so difficult to build and test docs on Windows. However, the process has some quirks.
Add
maketo common Git Bash tools for Windows.Unfortunately, a simple command
NODE=/path/to/node make doc-onlyrecommended in BUILDING.md works only ifnodeis located deeper than thePWDpath because of this macro in thedoc-onlytask flow (it seems this caution is valid for Linux too).If the path to
nodehas no spaces, we can call with this relative path (supposing the project root is something liked:\node-fork\):$ NODE=../../C/nodejs/node.exe make doc-onlyIf the path to
nodehas spaces (like the default"C:\Program Files\nodejs\node.exe"), we have a problem withmake. However, we can temporarily locatenodeinPWD, so this simple hack works:$ cp "`where node`" node.exe && NODE=node.exe MAKE=make make doc-only && rm node.exeWe should define
MAKE=makeif the path tomakealso has spaces (which is default:c:\Program Files\Git\mingw64\bin\make.exe).Finally, we can just comment out the skipping in
test/doctool/test-make-doc.jsand test the result.