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 fails on Windows/MSVC #271

Closed
targos opened this issue Nov 15, 2023 · 21 comments
Closed

Build fails on Windows/MSVC #271

targos opened this issue Nov 15, 2023 · 21 comments

Comments

@targos
Copy link
Member

targos commented Nov 15, 2023

See https://github.com/nodejs/node-v8/actions/runs/6878827246/job/18709360221

It's been happening for some times (several weeks I think). I hoped it would fix itself upstream like it happens sometimes, but unfortunately these errors don't go away.

/cc @nodejs/platform-windows

@StefanStojanovic
Copy link

I'll take a look at it. Thanks for the info.

@StefanStojanovic
Copy link

Hey @targos, with these changes in v8.patch I was able to build Node.js. I know there is a GHA for building on Windows, but I'm not sure if there is a way to run tests on Windows through this repo (I couldn't find it). In any case, we can always use the CI for that. Since I'm new to this repo, can you try applying this patch and running it through GHA, or explain to me how to do it?

A few details on the problem - there were two problematic commits in V8 I found: v8/v8@cb9bdcf and v8/v8@8005bd2. I did partial reverts of them as they were refactoring some parts of code that were problematic when building. The biggest issue was changing the typename in templates and exposing them via using. My patch file keeps commit history (2 reverts and 1 hotfix I had to apply after), but can ultimately be squashed if we decide to use it in future V8 updates.

@targos
Copy link
Member Author

targos commented Nov 23, 2023

In any case, we can always use the CI for that.

That's probably the best thing to do. I guess we can apply the patch temporarily if needed, but the goal should be to send changes upstream. I doubt that the would accept 2 reverts?

@StefanStojanovic
Copy link

An update on this - I see that last week, some changes landed in fixed-array.h and other related files. Since this can happen at any time, and we have no control over it, I suggest leaving it like this until the next Node.js V8 update that is affected by it. When that happens, we'll have the exact version of V8 to work with and I can start from there and patch it.

This is by no means an ideal approach, but since my changes revert parts of the code, I also doubt it will be accepted upstream. I'd like to get to it and make a decent fix that I can try to land in V8. Once I have more time to invest in that I will.

@targos
Copy link
Member Author

targos commented Jan 4, 2024

@StefanStojanovic V8 update PR: nodejs/node#51362

@medjamac

This comment was marked as off-topic.

@medjamac

This comment was marked as off-topic.

@rbuckton
Copy link

rbuckton commented Mar 8, 2024

Are v8-canary builds for Windows still broken? I've been using a build from last September to test out the V8 dev trial for the Shared Structs proposal, but haven't been able to use any of the more recent versions as they are lacking windows builds.

@targos
Copy link
Member Author

targos commented Mar 9, 2024

Yes, they're still broken, and the fix from nodejs/node@6f6a7fc doesn't apply cleanly to V8's lkgr branch.

@targos targos closed this as completed Apr 23, 2024
@vsemozhetbyt
Copy link

As this issue is closed, are there any other issues that still prevent Windows canary builds in https://direct.nodejs.org/download/v8-canary/ ?

@targos
Copy link
Member Author

targos commented Apr 24, 2024

I'll check tomorrow

@targos
Copy link
Member Author

targos commented Apr 25, 2024

Still fails, but now for a different reason:

https://ci-release.nodejs.org/job/iojs+release/10154/nodes=vs2022-x64/console

12:35:17      Creating library out\Release\node_mksnapshot.lib and object out\Release\node_mksnapshot.exp
12:35:21      Creating library out\Release\cctest.lib and object out\Release\cctest.exp
12:35:23   node_mksnapshot.vcxproj -> out\Release\\node_mksnapshot.exe
12:35:23   node_mksnapshot
12:35:25   
12:35:25   
12:35:25   #
12:35:25   # Fatal error in , line 0
12:35:25   # Check failed: table->address(index) == table->address(encoded_index).
12:35:25   #
12:35:25   #
12:35:25   #
12:35:25   #FailureMessage Object: 00000095E5AFE950
12:35:25   ----- Native stack trace -----
12:35:25   
12:35:26    1: 00007FF7C11A86BB node::DumpNativeBacktrace+155 [c:\ws\src\debug_utils.cc]:L313
12:35:26    2: 00007FF7C123D4CF `node::NodePlatform::GetStackTracePrinter'::`2'::<lambda_1>::<lambda_invoker_cdecl>+47 [c:\ws\src\node_platform.cc]:L583
12:35:26    3: 00007FF7C2729F65 V8_Fatal+197 [c:\ws\deps\v8\src\base\logging.cc]:L204
12:35:26    4: 00007FF7C2045AE0 v8::internal::StartupDeserializer::DeserializeAndCheckExternalReferenceTable+368 [c:\ws\deps\v8\src\snapshot\startup-deserializer.cc]:L103
12:35:26    5: 00007FF7C2045D55 v8::internal::StartupDeserializer::DeserializeIntoIsolate+533 [c:\ws\deps\v8\src\snapshot\startup-deserializer.cc]:L41
12:35:26    6: 00007FF7C1A7BDA8 v8::internal::Isolate::Init+3800 [c:\ws\deps\v8\src\execution\isolate.cc]:L5197
12:35:26    7: 00007FF7C1B53852 v8::internal::Snapshot::Initialize+450 [c:\ws\deps\v8\src\snapshot\snapshot.cc]:L198
12:35:26    8: 00007FF7C1B53405 v8::internal::SnapshotCreatorImpl::InitInternal+69 [c:\ws\deps\v8\src\snapshot\snapshot.cc]:L869
12:35:26    9: 00007FF7C1B4FF99 v8::internal::SnapshotCreatorImpl::SnapshotCreatorImpl+121 [c:\ws\deps\v8\src\snapshot\snapshot.cc]:L895
12:35:26   10: 00007FF7C18ED02B v8::SnapshotCreator::SnapshotCreator+75 [c:\ws\deps\v8\src\api\api.cc]:L543
12:35:26   11: 00007FF7C129CFAB node::CommonEnvironmentSetup::CommonEnvironmentSetup+459 [c:\ws\src\api\embed_helpers.cc]:L135
12:35:26   12: 00007FF7C129DF0C node::CommonEnvironmentSetup::CreateForSnapshotting+188 [c:\ws\src\api\embed_helpers.cc]:L201
12:35:26   13: 00007FF7C1179245 node::BuildSnapshotWithoutCodeCache+101 [c:\ws\src\node_snapshotable.cc]:L979
12:35:26   14: 00007FF7C117C26D node::SnapshotBuilder::GenerateAsSource+813 [c:\ws\src\node_snapshotable.cc]:L1226
12:35:26   15: 00007FF7C0DE7E83 BuildSnapshot+899 [c:\ws\tools\snapshot\node_mksnapshot.cc]:L96
12:35:26   16: 00007FF7C3214DA4 __scrt_common_main_seh+268 [D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl]:L288
12:35:26   17: 00007FFCAC8E4CB0 BaseThreadInitThunk+16
12:35:26   18: 00007FFCAD27E8AB RtlUserThreadStart+43
12:35:26 C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(248,5): error MSB8066: Custom build for 'out\Release\\node_mksnapshot.exe;deps\openssl\nodejs-openssl.cnf' exited with code -2147483645. [c:\ws\node.vcxproj]

@targos targos reopened this Apr 25, 2024
@targos
Copy link
Member Author

targos commented Apr 25, 2024

@joyeecheung does that ring a bell?

@targos
Copy link
Member Author

targos commented Apr 27, 2024

It's v8/v8@f4e0644

Needs a gyp variant of v8/node#176

@targos
Copy link
Member Author

targos commented Apr 27, 2024

I pushed 47d3875 🤞🏻

@targos
Copy link
Member Author

targos commented Apr 27, 2024

Added d9ccae4 and 052e970 to fix another issue.

@targos
Copy link
Member Author

targos commented Apr 28, 2024

It broke everything. I found another way to make it right: bf29057

@targos
Copy link
Member Author

targos commented Apr 28, 2024

@targos
Copy link
Member Author

targos commented Apr 28, 2024

Build is fixed. I'll close tomorrow if the canary release works

@vsemozhetbyt
Copy link

Builds for Windows seem back again: https://direct.nodejs.org/download/v8-canary/v23.0.0-v8-canary20240429c20f5ac96c/

Thank you for revitalizing them.

@targos
Copy link
Member Author

targos commented Apr 29, 2024

Finally 😭

@targos targos closed this as completed Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants