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

build,windows: solve build file disparity #12425

Closed
refack opened this issue Apr 15, 2017 · 10 comments · May be fixed by baby636/node#59
Closed

build,windows: solve build file disparity #12425

refack opened this issue Apr 15, 2017 · 10 comments · May be fixed by baby636/node#59
Labels
build Issues and PRs related to build files or the CI. windows Issues and PRs related to the Windows platform. wip Issues and PRs that are still a work in progress.

Comments

@refack
Copy link
Contributor

refack commented Apr 15, 2017

  • Version: All
  • Platform: Windows
  • Subsystem: build

Up till now we have been using two mechanism to build node, on windows vcbuild.bat that triggers configure and then msbuild. And on all other platforms a direct call to configure and then an explicit call to make. Having two mechanisms, leads to divergence, as often bugs-fixes/improvements are done on one and not the other. I wish we could eliminate this disparity by using a tool that works on both platforms.
A few proposed solutions:

  1. build using ninja as chromium and V8 does (generate .ninja files with GYP)
  2. build using cmake which is now MSVS supported (generate CMakeLists.txt files with GYP)
  3. investigation build with make on Windows
@refack refack added build Issues and PRs related to build files or the CI. discuss Issues opened for discussions and feedbacks. windows Issues and PRs related to the Windows platform. labels Apr 15, 2017
@bnoordhuis
Copy link
Member

Laudable goal. Some comments:

  1. build using ninja as chromium and V8 does (generate .ninja files with GYP)

Possible, but complicates the build prerequisites unless we bundle ninja. make is an apt-get install build-essential away, ninja not so much. Might be unfriendly towards users.

(Bundling ninja is acceptable though, IMO.)

  1. build using cmake which is now MSVS supported (generate CMakeLists.txt files with GYP)

Probably a non-starter. GYP's cmake support is very basic and buggy.

  1. investigation build with make on Windows

Don't know Windows enough to comment.

@refack
Copy link
Contributor Author

refack commented Apr 15, 2017

Possible, but complicates the build prerequisites unless we bundle ninja. make is an apt-get install build-essential away, ninja not so much. Might be unfriendly towards users.

investigation build with make on Windows

Don't know Windows enough to comment.

I think there will need to be a compromise either way, or adding ninja for all, or adding make to windows...

@vsemozhetbyt
Copy link
Contributor

(also concerning #12310)

Sorry, this may be a silly question. But why not to build Node.js with... Node.js?

Node.js is already promoted as integration tool: http://www.infoworld.com/article/3187923/application-development/5-reasons-node-js-rules-for-complex-integrations.html

@refack
Copy link
Contributor Author

refack commented Apr 15, 2017

Sorry, this may be a silly question. But why not to build Node.js with... Node.js?

Yay, I love it that I'm not the only one with "silly" question. More power to you my friend!

I like the idea, and @indutny is bringing us closer to it (https://github.com/indutny/dukgyp).
At the current time we're missing two key components that I know of, a module to "eat" .gyp and a module to manage the build. @eljefedelrodeodeljefe 's platform-tools has set it's goal to solve these too.

Also there is the notion of bootstrapping, that is building without a previous existing product. It seems negligible on established platforms, but it is important for porting node into new platforms.

@refack
Copy link
Contributor Author

refack commented Apr 15, 2017

Why GYP, short answer, we're stuck with it for now, since it holds too much "institutional knowledge" nodejs/CTC#2

@refack
Copy link
Contributor Author

refack commented Apr 19, 2017

Short example of the merits of ninja
Recompilation after a change in a .js file in /lib

VS2015

~16 minutes

C:\code\node>time < nul&vcbuild > nul&time < nul
The current time is: 14:07:53.76
Enter the new time: The current time is: 14:23:41.10
Enter the new time:

ninja

56 seconds

c:\code\node\out.ninja\out\Debug$ time < nul &echo.""&ninja -j 3 -v -f build.ninja node&time < nul
The current time is: 18:50:11.05
Enter the new time: ""
[1/5] C:\bin\dev\python27\python.exe gyp-win-tool action-wrapper environment.x64 node_js2c_target_node_js2c_bce0facc3e66b523ccf35ab2d859c2d9..rsp ..\..\..\
[2/5] C:\bin\dev\python27\python.exe gyp-win-tool stamp obj\node.actions_depends.stamp
[3/5] C:\bin\dev\python27\python.exe gyp-win-tool stamp obj\node.compile_depends.stamp
[4/5] ninja -t msvc -e environment.x64 -- "D:\bin\dev\VS\2017\BuildTools\VC\Tools\MSVC\14.10.25017\bin\HostX64\x64\cl.exe" /nologo /showIncludes /FC @obj\gen\node.node_javascript.obj.rsp /c gen\node_javascript.cc /Foobj\gen\node.node_javascript.obj /Fdobj\node.cc.pdb
[5/5] C:\bin\dev\python27\python.exe gyp-win-tool link-with-manifests environment.x64 True node.exe "C:\bin\dev\python27\python.exe gyp-win-tool link-wrapper environment.x64 False link.exe /nologo /OUT:node.exe @node.exe.rsp" 1 mt.exe rc.exe "obj\node.node.exe.intermediate.manifest" obj\node.node.exe.generated.manifest ..\..\..\src\res\node.exe.extra.manifest
The current time is: 18:51:07.85
Enter the new time:

@refack refack added the wip Issues and PRs that are still a work in progress. label Jun 15, 2017
lev-kazakov added a commit to lev-kazakov/node that referenced this issue Dec 26, 2017
lev-kazakov added a commit to lev-kazakov/node that referenced this issue Dec 26, 2017
@Trott
Copy link
Member

Trott commented Mar 9, 2018

@refack Is this still in progress? Should this remain open?

I'm going to remove the discuss label but feel free to add it back if you think that's misguided.

@Trott Trott removed the discuss Issues opened for discussions and feedbacks. label Mar 9, 2018
@gengjiawen
Copy link
Member

I would love to see cmake support. It has better IDE support.

@refack

This comment has been minimized.

@jasnell
Copy link
Member

jasnell commented Jun 25, 2020

There's been no further progress on this. Closing. Can reopen if it is picked back up.

@jasnell jasnell closed this as completed Jun 25, 2020
duqingnian pushed a commit to duqingnian/gyp that referenced this issue Apr 26, 2024
Patch Set 4:

> Patch Set 4:
> 
> (7 comments)
> 
> > Patch Set 4: Commit message was updated.
> 
> I added Gerrit comments in patchset 3

P.S. With this I am now able to compile node.js with ninja. which is a HUGE time saver nodejs/node#12425

Patch-set: 4
Reviewer: Gerrit User 1188132 <1188132@3ce6091f-6c88-37e8-8c75-72f92ae8dfba>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI. windows Issues and PRs related to the Windows platform. wip Issues and PRs that are still a work in progress.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants