-
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
deps,win: set MSVS .obj folders in gyp for V8 #13959
Conversation
Building on Windows fails depending on the result from sharding the deps/v8/src/v8.gyp:v8_base target. If two source files with the same name are in the same shard, their output object file path would conflict with one another. One example of this conflict is v8_base's runtime/runtime.cc and the V8 inspector's protocol/Runtime.cpp that is generated at build time, for which the files runtime.obj and Runtime.obj would be created, but msvs overwrites one of them with the other. Dividing the .obj output path by the original source's extension prevents this overwrite. Fixes: nodejs/v8#4
/cc @nodejs/v8 |
LGTM from the Windows build side, but this should also get a review from someone with experience maintaining V8. This seems to be a more robust solution than the one I presented in #12184. |
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 from a GYP
point of view
Can we make this change upstream first? |
deps/v8/src/v8.gyp
Outdated
# .cpp files in the same shard. | ||
'msvs_settings': { | ||
'VCCLCompilerTool': { | ||
'ObjectFile':'$(IntDir)/%(Extension)/', |
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.
One request: replace last /
with \\
(GYP
shenanigans 🤷♂️ )
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, even worse $(IntDir)%(Extension)\\
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.
So, you mean you want the line changed like this: 'ObjectFile':'$(IntDir)%(Extension)\\',
?
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.
Testing it locally and then I'll submit a commit.
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.
Thanks for the feedback. Changes committed: 4ccd87b
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.
Thanks.
Worth a shot, but we need to get used to maintain the V8 |
Sure. But as long as the file exists upstream, the fix should be made there first. Otherwise you'll potentially lose it the next time the V8 version is updated. At the least it will require extra care to make sure the locally floating patches are preserved each time an update to V8 is made. |
@ofrobots would renaming one of the conflicting |
@refack updated, PTAL. Thanks for your feedback. |
I personally think that the patch, as-proposed is better than possibility of renaming inspector's Runtime.cpp file as it is more future proof. /cc @eugeneo |
@jaimecbernardo you could move this directive to https://github.com/nodejs/node/blob/master/common.gypi#L112 I can't think of any harm in having this globaly... (Well testing locally now) |
@refack tried that, but it also needs changes to the projects that directly reference Lines 562 to 638 in ef28d85
Those references can be updated to make it build, but another impact that change would have if applied globally is causing the C++ linter to show warnings due to trying to open the |
I agree that's safest. Then we need to push this upstream. If you want I can do it I have the setup and did chromium contribution dance already... |
@refack Thanks, but I want to use this opportunity to setup and learn the steps as well. |
@refack @ofrobots Opened https://chromium-review.googlesource.com/c/556599/ to get this into V8. PTAL |
Building on Windows with gyp fails depending on the result from sharding the src/v8.gyp:v8_base target. If two source files with the same name are in the same shard, their output object file path would conflict with one another. One example of this conflict is v8_base's runtime/runtime.cc and the V8 inspector's protocol/Runtime.cpp that is generated at build time, for which the files runtime.obj and Runtime.obj would be created, but MSVS overwrites one of them with the other. Dividing the .obj output path by the original source's extension prevents this overwrite. Refs: nodejs/node#13959 Bug: Change-Id: I158e6178f2511297899ee50ea159f574916f903f Reviewed-on: https://chromium-review.googlesource.com/556599 Reviewed-by: Michael Achenbach <machenbach@chromium.org> Commit-Queue: Michael Achenbach <machenbach@chromium.org> Cr-Commit-Position: refs/heads/master@{#46354}
This seems to have landed in V8 upstream: https://chromium.googlesource.com/v8/v8/+/3bef2af6ef198b0cd1342680bf5d7d782dc71a46 |
Wow it landed fast, just got to it now... |
When V8 was updated to 5.7 and 5.8, there were issues compiling on Windows because of what was later discovered to be a filename conflict. This PR should avoid the issue in case it reoccurs when updating V8, without the need to change the number of shards.
Building on Windows fails depending on the result from sharding the deps/v8/src/v8.gyp:v8_base target. If two source files with the same name are in the same shard, their output object file path would conflict with one another. One example of this conflict is v8_base's runtime/runtime.cc and the V8 inspector's protocol/Runtime.cpp that is generated at build time, for which the files
runtime.obj
andRuntime.obj
would be created, but MSVS overwrites one of them with the other.Dividing the
.obj
output path by the original source's extension prevents this overwrite.Refs: #12784
Refs: #12184
Refs: #11752
Fixes: nodejs/v8#4
/cc @nodejs/v8
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
deps,V8,build,windows