4

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>           ^
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?

3 Answers3

2

try install windows sdk version 10.0.20348.0 or newest.

Z4J5
  • 21
  • 5
  • Yes this the correct answer. The NTDDI_VERSION created by cmake is a later version that is not available in my Windows 10 SDK. Hence the issue. I think the way it is set is incorrect - it should use the lowest version possible not the highest one - but whatever. If you prefer to fix it you need to modify cef_variables.cmake. – OnceUponATimeInTheWest May 19 '23 at 13:56
0

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.

jmrk
  • 34,271
  • 7
  • 59
  • 74
0

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.

JakeSays
  • 329
  • 1
  • 6