You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
... the legacy GYP config will be removed from V8’s repository, but stays in node/deps/v8. Keeping it in sync with GN build config becomes Node.js’ responsibility ...
AFAICT V8 has already stopped CI testing the .gyp scaffolding, and are planning to remove the .gyp files by the end of the year.
Our bot is still running the regular Node make with gyp just like official Node.
Obviously any CI coverage provided by V8 is greatly appreciated!
AFAICT there seems to be coverage missing - ARM was broken for a while, and Windows wasn't covered (maybe just building with MSBuild vs. ninja? While we use MSBuild and both VS2015 and VS2017).
IMHO the deprecation of the gyp scaffolding, and the pending removal is starting to be felt by node, and I'm just saying we should be ready. This way we won't need to scramble last minute to smooth over build problems when we want to backport fixes (nodejs/node#16848 (comment)).
Another point is that ATM reviewing these patches is cumbersome, since they can only land together with V8 backports or version bumps, see nodejs/node#16848 (comment)
To reiterate, we already have knowledge and time investment in maintaining GYP (the tool), so taking ownership of the tool and the .gyp files is not too far fetched.
In the meantime I created a wrapper script as planned to create a libv8_monolith.a static library that can be used to link node instead of libv8_base.a. I haven't created a PR on the Node.js side yet to make things work smoothly.
To build node without using V8's gyp configs, perform following steps:
run deps/v8/tools/node/fetch_deps.py deps/v8 force to fetch the necessary dependencies.
run ./configure && make -j 4 node. This uses deps/v8/tools/node/build_gn.py to build out/Release/obj.target/deps/v8/src/libv8_monolith.a to link into the final executable.
I only tested this with a static build for x64 linux. Once that's usable and streamlined I'll work on a few more build configurations.
You are right. Turns out anything called node is ignored by git due to Node's root .gitignore. So when I updated our fork's V8 via script, the whole folder was not added.
I fixed that in our node fork here. I'll upstream that soonish. Thanks for making me aware!
In the meantime I also push a new version of V8 to our fork, with the node folder.
Is this the final solution? I'm curious why you went with a fetch_deps.py script. I understand that checking in binaries is not ideal, but relying on a remote resource makes it susceptible to link rot, consequently there's no guarantee that this commit will be buildable in the future.
This is not the "final" solution in the sense of that's where Node.js' build system should end up. The problem this should solve is that the V8 team is committed to test against Node.js, but wants to end support for gyp. This is not designed as a full replacement for V8's gyp configs.
In the short term, Node.js inherits ownership over V8's gyp configurations to continue building with pure gyp configs (no GN wrapper). Ultimately Node.js will have to figure out whether to keep maintaining its own and V8's gyp configurations, or find something better altogether.
These remote resources are ones that V8 relies on and are tested on our infrastructure, so for the purpose of V8 testing against Node.js, link rot is not an issue. However, for building Node.js without having to rely on V8 and Chrome resources, this would indeed be a problem, so the gyp configs have to be maintained.
Ultimately Node.js will have to figure out whether to keep maintaining its own and V8's gyp configurations, or find something better altogether.
That's the issue - if Node.js were to consider adopting GN (at least for V8), the dependence on V8 and Chrome resources might become an obstacle, considering the Node.js repo is currently self-contained.
Having talked to the GN team in the past, I don't think GN is a viable option for Node.js to completely follow through. This gyp-gn bridge is really just to cut the dependency to gyp for our integration testing.
Having talked to the GN team in the past, I don't think GN is a viable option for Node.js to completely follow through.
Any reason for that besides the dependence on remote resources? And could you clarify what PR you meant in #411 (comment)? I assumed it referred to the GN wrapper.
Mostly because GN does not support the full range of platforms that Node.js does.
According to @refack, the V8 support for those platforms that are not supported by GN is maintained by companies interested in such support (IRC log). So it seems reasonable to expect those companies to help with GN support on those platforms as well if Node.js were to follow this route. It seems to me that it would be more efficient in the long run than maintaining gyp configs.
Platforms not backed by companies, such as FreeBSD, will not receive any support.
I have been wanting to asking @mhdawson for ever how the GN support for S390 and PPC looks. I heard rumors that there was something being worked on.
GN relies on a number of platform-dependent configs and binaries. You will not get around of fetching these resources from somewhere, unless you want to include them in Node altogether.
GN is not designed for broad public adoption from what I gathered.
The advantage of GN over something new, e.g. cmake, is that V8 already comes with GN files. Configs for cmake would have to be maintained, just like for gyp in the near future. Bazel has the same advantage as GN.
I'm not even sure Chromium/V8 will stick with GN in, say, 5 years :P
Platforms not backed by companies, such as FreeBSD, will not receive any support.
Are there any other such platforms? FreeBSD is free and works on x86-64, so pretty much any collaborator can get involved with its support.
GN relies on a number of platform-dependent configs and binaries. You will not get around of fetching these resources from somewhere, unless you want to include them in Node altogether.
I think including them in Node is an option.
Bazel has the same advantage as GN.
In that case, Bazel is definitely worth looking into.
I'm not even sure Chromium/V8 will stick with GN in, say, 5 years :P
I'd say if the effort to adopt GN remains useful for 5 years, it would be more than worth it.
Activity
fhinkel commentedon Nov 7, 2017
Our bot is still running the regular Node
makewith gyp just like official Node.hashseed commentedon Nov 7, 2017
Precisely. We still test Node with
gyp. We have plans to change this, and will notify once we have something usable.refack commentedon Nov 7, 2017
Obviously any CI coverage provided by V8 is greatly appreciated!
AFAICT there seems to be coverage missing - ARM was broken for a while, and Windows wasn't covered (maybe just building with MSBuild vs. ninja? While we use MSBuild and both VS2015 and VS2017).
IMHO the deprecation of the gyp scaffolding, and the pending removal is starting to be felt by node, and I'm just saying we should be ready. This way we won't need to scramble last minute to smooth over build problems when we want to backport fixes (nodejs/node#16848 (comment)).
Another point is that ATM reviewing these patches is cumbersome, since they can only land together with V8 backports or version bumps, see nodejs/node#16848 (comment)
refack commentedon Dec 6, 2017
To reiterate, we already have knowledge and time investment in maintaining GYP (the tool), so taking ownership of the tool and the
.gypfiles is not too far fetched.seishun commentedon Jan 5, 2018
@hashseed It's 2018, any news?
hashseed commentedon Jan 5, 2018
In the meantime I created a wrapper script as planned to create a
libv8_monolith.astatic library that can be used to linknodeinstead oflibv8_base.a. I haven't created a PR on the Node.js side yet to make things work smoothly.To build
nodewithout using V8's gyp configs, perform following steps:vee-eight-lkgrfrom https://github.com/v8/nodedeps/v8/tools/node/fetch_deps.py deps/v8 forceto fetch the necessary dependencies../configure && make -j 4 node. This usesdeps/v8/tools/node/build_gn.pyto buildout/Release/obj.target/deps/v8/src/libv8_monolith.ato link into the final executable.I only tested this with a static build for x64 linux. Once that's usable and streamlined I'll work on a few more build configurations.
seishun commentedon Jan 5, 2018
Is there any difference between
v8andv8_monolithother than the way it's built?hashseed commentedon Jan 5, 2018
Not really. Except that
v8is a collection of files andv8_monolithjust one.seishun commentedon Jan 5, 2018
The file
deps/v8/tools/node/fetch_deps.pydoes not exist.hashseed commentedon Jan 5, 2018
Did you check out from
github.com/v8/node? I landed it in the last few weeks so it's not yet in node master.seishun commentedon Jan 5, 2018
Yes, there's no
nodedirectory here: https://github.com/v8/node/tree/vee-eight-lkgr/deps/v8/toolshashseed commentedon Jan 5, 2018
You are right. Turns out anything called
nodeis ignored by git due to Node's root.gitignore. So when I updated our fork's V8 via script, the whole folder was not added.I fixed that in our node fork here. I'll upstream that soonish. Thanks for making me aware!
In the meantime I also push a new version of V8 to our fork, with the
nodefolder.seishun commentedon Jan 5, 2018
fetch_deps.pydoesn't do anything. It seems intentional: https://github.com/v8/node/blob/bc4ca529a007c9f23acd87534197086b2f10e65e/deps/v8/tools/node/fetch_deps.py#L89-L917 remaining items
seishun commentedon Jan 6, 2018
Seems to work now.
Is this the final solution? I'm curious why you went with a
fetch_deps.pyscript. I understand that checking in binaries is not ideal, but relying on a remote resource makes it susceptible to link rot, consequently there's no guarantee that this commit will be buildable in the future.hashseed commentedon Jan 6, 2018
Thanks for verifying!
This is not the "final" solution in the sense of that's where Node.js' build system should end up. The problem this should solve is that the V8 team is committed to test against Node.js, but wants to end support for gyp. This is not designed as a full replacement for V8's gyp configs.
In the short term, Node.js inherits ownership over V8's gyp configurations to continue building with pure gyp configs (no GN wrapper). Ultimately Node.js will have to figure out whether to keep maintaining its own and V8's gyp configurations, or find something better altogether.
These remote resources are ones that V8 relies on and are tested on our infrastructure, so for the purpose of V8 testing against Node.js, link rot is not an issue. However, for building Node.js without having to rely on V8 and Chrome resources, this would indeed be a problem, so the gyp configs have to be maintained.
seishun commentedon Jan 7, 2018
That's the issue - if Node.js were to consider adopting GN (at least for V8), the dependence on V8 and Chrome resources might become an obstacle, considering the Node.js repo is currently self-contained.
hashseed commentedon Jan 7, 2018
Having talked to the GN team in the past, I don't think GN is a viable option for Node.js to completely follow through. This gyp-gn bridge is really just to cut the dependency to gyp for our integration testing.
seishun commentedon Jan 7, 2018
Any reason for that besides the dependence on remote resources? And could you clarify what PR you meant in #411 (comment)? I assumed it referred to the GN wrapper.
hashseed commentedon Jan 7, 2018
The doc lays out a couple of reasons. Mostly because GN does not support the full range of platforms that Node.js does.
The PR I have in mind is to introduce a build flag to Node.js to be able to use the gn wrapper, currently the patch in step 2.
seishun commentedon Jan 7, 2018
According to @refack, the V8 support for those platforms that are not supported by GN is maintained by companies interested in such support (IRC log). So it seems reasonable to expect those companies to help with GN support on those platforms as well if Node.js were to follow this route. It seems to me that it would be more efficient in the long run than maintaining gyp configs.
hashseed commentedon Jan 7, 2018
A couple of thoughts:
seishun commentedon Jan 7, 2018
Are there any other such platforms? FreeBSD is free and works on x86-64, so pretty much any collaborator can get involved with its support.
I think including them in Node is an option.
In that case, Bazel is definitely worth looking into.
I'd say if the effort to adopt GN remains useful for 5 years, it would be more than worth it.
mhdawson commentedon Jan 8, 2018
@hashseed I'll ask the people who were working on the GN support to comment here.
hashseed commentedon Jan 12, 2018
I streamlined things a bit.
jasnell commentedon Feb 17, 2018
Is there a next step here? Or can this issue be closed?
hashseed commentedon Feb 17, 2018
Guess next steps will have to happen when upgrading to V8 6.6.
fhinkel commentedon Mar 8, 2018
Closing via nodejs/node#19201, feel free to re-open if needed.