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

Cannot correctly build Luau - disables a required flag /EHsc when vanilla cmake does not #133

Open
LoganDark opened this issue Nov 5, 2021 · 1 comment

Comments

@LoganDark
Copy link

I'm going to open this as an issue because fundamentally this seems to be a problem with cmake-rs - as cmake on its own builds Luau just fine.

Using cmake . and then cmake --build . has no issue from a Windows command prompt, but cmake-rs does this:

Microsoft (R) Build Engine version 16.10.2+857e5a733 for .NET Framework
  Copyright (C) Microsoft Corporation. All rights reserved.
    Checking Build System
    Ast.cpp
    lapi.cpp
    laux.cpp
    Confusables.cpp
    lbaselib.cpp
    lbitlib.cpp
    lbuiltins.cpp
    Lexer.cpp
    lcorolib.cpp
    ldblib.cpp
    ldebug.cpp
    ldo.cpp
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\vector(1245,1): error C2220: the following warning is treated as an error [C:\Users\LoganDark\CLionProjects\luau\target\debug\build\luau-sys-7f8bb85230e5cd51\out\build\Luau.Ast.vcxproj]
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\vector(1275): message : see reference to function template instantiation 'void std::vector<Item,std::allocator<Item>>::_Resize_reallocate<_Ty2>(const unsigned __int64,const _Ty2 &)' being compiled [C:\Users\LoganDark\CLionProjects\luau\target\debug\build\luau-sys-7f8bb85230e5cd51\out\build\Luau.Ast.vcxproj]
            with
            [
                Item=Luau::AstNameTable::Entry,
                _Ty2=Luau::AstNameTable::Entry
            ]
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\vector(1275): message : see reference to function template instantiation 'void std::vector<Item,std::allocator<Item>>::_Resize_reallocate<_Ty2>(const unsigned __int64,const _Ty2 &)' being compiled [C:\Users\LoganDark\CLionProjects\luau\target\debug\build\luau-sys-7f8bb85230e5cd51\out\build\Luau.Ast.vcxproj]
            with
            [
                Item=Luau::AstNameTable::Entry,
                _Ty2=Luau::AstNameTable::Entry
            ]
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\vector(1295): message : see reference to function template instantiation 'void std::vector<Item,std::allocator<Item>>::_Resize<_Ty>(const unsigned __int64,const _Ty2 &)' being compiled [C:\Users\LoganDark\CLionProjects\luau\target\debug\build\luau-sys-7f8bb85230e5cd51\out\build\Luau.Ast.vcxproj]
            with
            [
                Item=Luau::AstNameTable::Entry,
                _Ty=Luau::AstNameTable::Entry,
                _Ty2=Luau::AstNameTable::Entry
            ]
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\vector(1295): message : see reference to function template instantiation 'void std::vector<Item,std::allocator<Item>>::_Resize<_Ty>(const unsigned __int64,const _Ty2 &)' being compiled [C:\Users\LoganDark\CLionProjects\luau\target\debug\build\luau-sys-7f8bb85230e5cd51\out\build\Luau.Ast.vcxproj]
            with
            [
                Item=Luau::AstNameTable::Entry,
                _Ty=Luau::AstNameTable::Entry,
                _Ty2=Luau::AstNameTable::Entry
            ]
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\vector(1293): message : while compiling class template member function 'void std::vector<Item,std::allocator<Item>>::resize(const unsigned __int64,const _Ty &)' [C:\Users\LoganDark\CLionProjects\luau\target\debug\build\luau-sys-7f8bb85230e5cd51\out\build\Luau.Ast.vcxproj]
            with
            [
                Item=Luau::AstNameTable::Entry,
                _Ty=Luau::AstNameTable::Entry
            ]
  C:\Users\LoganDark\CLionProjects\luau\luau-sys\luau\Ast\include\Luau/DenseHash.h(46): message : see reference to function template instantiation 'void std::vector<Item,std::allocator<Item>>::resize(const unsigned __int64,const _Ty &)' being compiled [C:\Users\LoganDark\CLionProjects\luau\target\debug\build\luau-sys-7f8bb85230e5cd51\out\build\Luau.Ast.vcxproj]
            with
            [
                Item=Luau::AstNameTable::Entry,
                _Ty=Luau::AstNameTable::Entry
            ]
  C:\Users\LoganDark\CLionProjects\luau\luau-sys\luau\Ast\include\Luau/DenseHash.h(234): message : see reference to class template instantiation 'std::vector<Item,std::allocator<Item>>' being compiled [C:\Users\LoganDark\CLionProjects\luau\target\debug\build\luau-sys-7f8bb85230e5cd51\out\build\Luau.Ast.vcxproj]
            with
            [
                Item=Luau::AstNameTable::Entry
            ]
  C:\Users\LoganDark\CLionProjects\luau\luau-sys\luau\Ast\include\Luau/DenseHash.h(286): message : see reference to class template instantiation 'Luau::detail::DenseHashTable<Key,Key,Key,Luau::detail::ItemInterfaceSet<Key>,Hash,Eq>' being compiled [C:\Users\LoganDark\CLionProjects\luau\target\debug\build\luau-sys-7f8bb85230e5cd51\out\build\Luau.Ast.vcxproj]
            with
            [
                Key=Luau::AstNameTable::Entry,
                Hash=Luau::AstNameTable::EntryHash,
                Eq=std::equal_to<Luau::AstNameTable::Entry>
            ]
  C:\Users\LoganDark\CLionProjects\luau\luau-sys\luau\Ast\include\Luau/Lexer.h(157): message : see reference to class template instantiation 'Luau::DenseHashSet<Luau::AstNameTable::Entry,Luau::AstNameTable::EntryHash,std::equal_to<Key>>' being compiled [C:\Users\LoganDark\CLionProjects\luau\target\debug\build\luau-sys-7f8bb85230e5cd51\out\build\Luau.Ast.vcxproj]
            with
            [
                Key=Luau::AstNameTable::Entry
            ]
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\vector(1245,1): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc [C:\Users\LoganDark\CLionProjects\luau\target\debug\build\luau-sys-7f8bb85230e5cd51\out\build\Luau.Ast.vcxproj]
    Location.cpp
  C:\Users\LoganDark\CLionProjects\luau\luau-sys\luau\VM\src\ldo.cpp(118,5): error C2220: the following warning is treated as an error [C:\Users\LoganDark\CLionProjects\luau\target\debug\build\luau-sys-7f8bb85230e5cd51\out\build\Luau.VM.vcxproj]
  C:\Users\LoganDark\CLionProjects\luau\luau-sys\luau\VM\src\ldo.cpp(118,5): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc [C:\Users\LoganDark\CLionProjects\luau\target\debug\build\luau-sys-7f8bb85230e5cd51\out\build\Luau.VM.vcxproj]
    lfunc.cpp
    lgc.cpp
    linit.cpp
    lmathlib.cpp
    lmem.cpp
    Parser.cpp
    lobject.cpp
    loslib.cpp
    lperf.cpp
  C:\Users\LoganDark\CLionProjects\luau\luau-sys\luau\Ast\src\Parser.cpp(154,5): error C2220: the following warning is treated as an error [C:\Users\LoganDark\CLionProjects\luau\target\debug\build\luau-sys-7f8bb85230e5cd51\out\build\Luau.Ast.vcxproj]
  C:\Users\LoganDark\CLionProjects\luau\luau-sys\luau\Ast\src\Parser.cpp(154,5): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc [C:\Users\LoganDark\CLionProjects\luau\target\debug\build\luau-sys-7f8bb85230e5cd51\out\build\Luau.Ast.vcxproj]
    lstate.cpp
    lstring.cpp
    lstrlib.cpp
    Generating Code...
    StringUtils.cpp
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\vector(765,1): error C2220: the following warning is treated as an error [C:\Users\LoganDark\CLionProjects\luau\target\debug\build\luau-sys-7f8bb85230e5cd51\out\build\Luau.Ast.vcxproj]
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\vector(739): message : see reference to function template instantiation 'std::basic_string_view<char,std::char_traits<char>> *std::vector<std::string_view,std::allocator<std::string_view>>::_Emplace_reallocate<_Ty>(std::basic_string_view<char,std::char_traits<char>> *const ,_Ty &&)' being compiled [C:\Users\LoganDark\CLionProjects\luau\target\debug\build\luau-sys-7f8bb85230e5cd51\out\build\Luau.Ast.vcxproj]
            with
            [
                _Ty=std::basic_string_view<char,std::char_traits<char>>
            ]
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\vector(747): message : see reference to function template instantiation 'std::basic_string_view<char,std::char_traits<char>> *std::vector<std::string_view,std::allocator<std::string_view>>::_Emplace_reallocate<_Ty>(std::basic_string_view<char,std::char_traits<char>> *const ,_Ty &&)' being compiled [C:\Users\LoganDark\CLionProjects\luau\target\debug\build\luau-sys-7f8bb85230e5cd51\out\build\Luau.Ast.vcxproj]
            with
            [
                _Ty=std::basic_string_view<char,std::char_traits<char>>
            ]
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\vector(761): message : see reference to function template instantiation '_Ty &std::vector<_Ty,std::allocator<_Ty>>::emplace_back<std::basic_string_view<char,std::char_traits<char>>>(std::basic_string_view<char,std::char_traits<char>> &&)' being compiled [C:\Users\LoganDark\CLionProjects\luau\target\debug\build\luau-sys-7f8bb85230e5cd51\out\build\Luau.Ast.vcxproj]
            with
            [
                _Ty=std::string_view
            ]
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\vector(759): message : while compiling class template member function 'void std::vector<std::string_view,std::allocator<std::string_view>>::push_back(_Ty &&)' [C:\Users\LoganDark\CLionProjects\luau\target\debug\build\luau-sys-7f8bb85230e5cd51\out\build\Luau.Ast.vcxproj]
            with
            [
                _Ty=std::string_view
            ]
  C:\Users\LoganDark\CLionProjects\luau\luau-sys\luau\Ast\src\StringUtils.cpp(111): message : see reference to function template instantiation 'void std::vector<std::string_view,std::allocator<std::string_view>>::push_back(_Ty &&)' being compiled [C:\Users\LoganDark\CLionProjects\luau\target\debug\build\luau-sys-7f8bb85230e5cd51\out\build\Luau.Ast.vcxproj]
            with
            [
                _Ty=std::string_view
            ]
  C:\Users\LoganDark\CLionProjects\luau\luau-sys\luau\Ast\src\StringUtils.cpp(91): message : see reference to class template instantiation 'std::vector<std::string_view,std::allocator<std::string_view>>' being compiled [C:\Users\LoganDark\CLionProjects\luau\target\debug\build\luau-sys-7f8bb85230e5cd51\out\build\Luau.Ast.vcxproj]
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\vector(765,1): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc [C:\Users\LoganDark\CLionProjects\luau\target\debug\build\luau-sys-7f8bb85230e5cd51\out\build\Luau.Ast.vcxproj]
    Generating Code...
    Compiling...
    ltable.cpp
    ltablib.cpp
    ltm.cpp
    lutf8lib.cpp
    lvmexecute.cpp
    lvmload.cpp
    lvmutils.cpp
    Generating Code...

(from luau-lang/luau#123 - where the owners have cut off all outside interaction, so I can't even open a PR anymore)

The exact commands cmake-rs runs are:

"cmake" "C:\\Users\\LoganDark\\CLionProjects\\luau\\luau-sys\\luau" "-G" "Visual Studio 16 2019" "-Thost=x64" "-Ax64" "-DLUAU_BUILD_CLI=OFF" "-DLUAU_BUILD_TESTS=OFF" "-DCMAKE_INSTALL_PREFIX=C:\\Users\\LoganDark\\CLionProjects\\luau\\target\\debug\\build\\luau-sys-7f8bb85230e5cd51\\out" "-DCMAKE_C_FLAGS= -nologo -MD -Brepro" "-DCMAKE_C_FLAGS_DEBUG= -nologo -MD -Brepro" "-DCMAKE_CXX_FLAGS= -nologo -MD -Brepro" "-DCMAKE_CXX_FLAGS_DEBUG= -nologo -MD -Brepro" "-DCMAKE_ASM_FLAGS= -nologo -MD -Brepro" "-DCMAKE_ASM_FLAGS_DEBUG= -nologo -MD -Brepro" "-DCMAKE_BUILD_TYPE=Debug"
"cmake" "--build" "." "--target" "ALL_BUILD" "--config" "Debug" "--parallel" "12"

Something in here is causing the build to fail. Note that it succeeds without issue in WSL, it's only Cursed Windows that has this problem.

@AregevDev
Copy link

The same thing happens to me with assimp.
I just add the flag for now

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

2 participants