Skip to content

[wasm] Windows: Failure to build browser, mono+libs with clean build of the runtime #94106

Closed

Description

@JakeYallop

I'm getting the following error (several of them, all look similar) when trying to build

./build.cmd -os browser -subset mono+libs

on a clean build of the repo.

FAILED: mono/sgen/CMakeFiles/sgen_objects.dir/sgen-marksweep.c.obj
  C:\PROGRA~1\MIB055~1\2022\COMMUN~1\VC\Tools\MSVC\1433~1.316\bin\Hostx86\x64\cl.exe  /nologo -DHAVE_CONFIG_H -DHAVE_SGEN_GC -DLLVM_API_VERSION=1600 -DNO_GLOBALIZATION_SHIM -IC:\Workspaces\runtime\artifacts\obj -IC:\Workspac
  es\runtime\src\native -IC:\Workspaces\runtime\artifacts\obj\mono\browser.wasm.Debug\cross\mono\sgen\..\.. -IC:\Workspaces\runtime\src\mono\mono\sgen\..\.. -IC:\Workspaces\runtime\src\mono\mono\sgen\.. -IC:\Workspaces\runti
  me\src\native\public\. -IC:\Workspaces\runtime\artifacts\obj\mono\browser.wasm.Debug\cross\mono\eglib -IC:\Workspaces\runtime\src\mono\mono\eglib -DHOST_WIN32 -D__WIN32__ -DWIN32 -DWIN32_LEAN_AND_MEAN -DNDEBUG -D_CRT_SECUR
  E_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -DWIN32_THREADS -DWINVER=0x0601 -D_WIN32_WINNT=0x0601 -D_WIN32_IE=0x0501 -D_UNICODE -DUNICODE -DFD_SETSIZE=1024 -DNVALGRIND -IC:\Workspaces\runtime\artifacts\obj\mono\browser.wasm.
  Debug\llvm\\x64/include -D__STDC_CONSTANT_MACROS -D__STD_FORMAT_MACROS -D__STDC_LIMIT_MACROS /O2 /Ob2 /DNDEBUG -MT /source-charset:utf-8 /wd4100 /wd4702 /wd4706 /wd4245 /wd4389 /W4 /WX /wd4324 /EHsc /FC /Oi /GF /Zi /GL -Os
   -std:c11 /showIncludes /Fomono\sgen\CMakeFiles\sgen_objects.dir\sgen-marksweep.c.obj /Fdmono\sgen\CMakeFiles\sgen_objects.dir\sgen_objects.pdb /FS -c C:\Workspaces\runtime\src\mono\mono\sgen\sgen-marksweep.c
  C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winbase.h(9531): error C2220: the following warning is treated as an error
  C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winbase.h(9531): warning C5105: macro expansion producing 'defined' has undefined behavior

Is there any help I get to fix this?

Activity

  1. ghost added
    untriaged
    on Oct 27, 2023
  2. ghost added
    area-Infrastructure-coreclr
    on Oct 27, 2023
  3. added
    arch-wasm
    on Oct 27, 2023
  4. added this to the 9.0.0 milestone on Oct 27, 2023
  5. ghost removed
    untriaged
    on Oct 27, 2023
  6. added
    untriaged
    and removed
    area-Infrastructure-coreclr
    on Oct 27, 2023
  7. changed the title [-]Failure to build browser, mono+libs with clean build of the runtime[/-] [+][wasm] Windows: Failure to build browser, mono+libs with clean build of the runtime[/+] on Oct 27, 2023
  8. radical commented on Oct 27, 2023

    @radical
    Member
  9. pavelsavara commented on Nov 8, 2023

    @pavelsavara
    Member
  10. added
    needs-author-action
    on Nov 8, 2023
  11. removed
    untriaged
    on Nov 15, 2023
  12. smx-smx commented on Nov 23, 2023

    @smx-smx
    Contributor

    I ran into the same issue
    I had to comment the following line in mono's CMakeLists.txt :

    add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:/WX>) # treat warnings as errors

    MSVC info as detected by CMake:

      -- The C compiler identification is MSVC 19.38.33130.0
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.38.33130/bi
      n/Hostx86/x64/cl.exe - skipped
    
  13. pavelsavara commented on Nov 27, 2023

    @pavelsavara
    Member

    @directhex, @akoeplinger any advice ?

  14. akoeplinger commented on Nov 27, 2023

    @akoeplinger
    Member

    I can't reproduce this using MSVC 19.39.33218.0 and the 10.0.22621.0 Windows SDK.

    It looks like this is because of a bug in the Windows SDK that was triggered by us switching to C11: https://developercommunity.visualstudio.com/t/stdc17-generates-warning-compiling-windowsh/1249671

    Could you try updating to Windows SDK >= 10.0.20348.0 and trying again?

  15. smx-smx commented on Nov 28, 2023

    @smx-smx
    Contributor

    It's the Windows SDK version then. I confirm I have 10.0.19041.0, the same from the linked bug report

  16. akoeplinger commented on Nov 30, 2023

    @akoeplinger
    Member

    Thanks, closing this issue in that case.

  17. locked and limited conversation to collaborators on Dec 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    arch-wasmarea-Build-mononeeds-author-actionos-windows

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions