Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I am compiling v8 on win10 pro 20H2 build.

I had already fetch the source code and used gn gen --ide=vs out\x64_proj command under v8\src directory to generate visual studio projects.

there are some small problems during process above,such as env variables, proxy. but I fixed them.

when I start to compile gn_all project in my vs2019 , some error appeared.

most of them is very similar:

1>In file included from ../../../src/base/debug/stack_trace_win.cc:17:
1>In file included from D:\Windows Kits\10\Include\10.0.19041.0\um\windows.h:172:
1>In file included from D:\Windows Kits\10\Include\10.0.19041.0\um\winbase.h:43:
1>In file included from D:\Windows Kits\10\Include\10.0.19041.0\um\fileapifromapp.h:20:
1>D:\Windows Kits\10\Include\10.0.19041.0\um\winbase.h(9118,11): error : unknown type name 'FILE_INFO_BY_HANDLE_CLASS'
1>    _In_  FILE_INFO_BY_HANDLE_CLASS FileInformationClass,

I google this symbol and find it in minwinbase.h:

#if (NTDDI_VERSION >= NTDDI_LONGHORN)
typedef enum _FILE_INFO_BY_HANDLE_CLASS {
    FileBasicInfo,
    FileStandardInfo,
    FileNameInfo,
    FileRenameInfo,
    FileDispositionInfo,
    FileAllocationInfo,
    FileEndOfFileInfo,
    FileStreamInfo,
    FileCompressionInfo,
    FileAttributeTagInfo,
    FileIdBothDirectoryInfo,
    FileIdBothDirectoryRestartInfo,
    FileIoPriorityHintInfo,
    FileRemoteProtocolInfo,
    FileFullDirectoryInfo,
    FileFullDirectoryRestartInfo,
#if (NTDDI_VERSION >= NTDDI_WIN8)
    FileStorageInfo,
    FileAlignmentInfo,
    FileIdInfo,
    FileIdExtdDirectoryInfo,
    FileIdExtdDirectoryRestartInfo,
#endif
#if (NTDDI_VERSION >= NTDDI_WIN10_RS1)
    FileDispositionInfoEx,
    FileRenameInfoEx,
#endif
#if (NTDDI_VERSION >= NTDDI_WIN10_19H1)
    FileCaseSensitiveInfo,
    FileNormalizedNameInfo,
#endif
    MaximumFileInfoByHandleClass
} FILE_INFO_BY_HANDLE_CLASS, *PFILE_INFO_BY_HANDLE_CLASS;
#endif

I guess it was the version macro problem to cause this enum not included. so I create another project to print NTDDI_VERSION, but it return 0xa0000008 which is greater than all macro appear above.

then I try to just comment these macro out, and it works, vs continue to compile antother files, and meet some new errors.

but appearently this is just a temporary patch, not a root cause, and the new errors seems also have do with this:

1>../../../src/base/debug/stack_trace_win.cc(173,12): error : use of undeclared identifier 'RtlCaptureStackBackTrace'
1>  count_ = CaptureStackBackTrace(0, arraysize(trace_), trace_, nullptr);
1>D:\Windows Kits\10\Include\10.0.19041.0\um\winbase.h(118,31): note: expanded from macro 'CaptureStackBackTrace'
1>#define CaptureStackBackTrace RtlCaptureStackBackTrace
1>../../../src/base/platform/platform-win32.cc(841,11): error : use of undeclared identifier 'IsWindows10OrGreater'
1>      if (IsWindows10OrGreater())

I guess it was that some buildtools didn't configure correctly, but I have no idea what it could be. Anyone have some ideas?

I think the generated VS project files are enough for browsing/editing but not suitable for compiling. Try building with ninja on the command line. See the official documentation, in short it's just:
ninja -C out\x64_proj, optionally with a specific target to build.

I just tried, but same error report appeared. using python v8gen.py gen -b x64.debug x64_debug and ninja -C out.gn\x64_debug d8 on cmd – Zeromus Golbeze Apr 12, 2022 at 4:11

This isn't an ideal solution but it met my immediate needs.

Roll v8 back to version 9.9.115.10 and d8 builds fine.

To roll back, git checkout 7d7c04aac7d650964d96d1f1c080949ae5519c78 and then gclient sync.

Apparently the main branch is currently broken.

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.