[
https://issues.apache.org/jira/browse/MESOS-9718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16814320#comment-16814320
]
Andrei Budnik commented on MESOS-9718:
--------------------------------------
This error appeared after the following patch landed:
{code:java}
commit 703d0011d9049c6003f6d57026f5e764d1cb4435
Author: John Kordich <[email protected]>
Date: Thu Apr 13 18:07:25 2017 -0700
Windows: Fixed Base64Test.EncodeURLSafe.
C++ encodes string literals in the compiling platform's encoding
of choice, which means UTF8 for Posix, and ANSI for Windows.
This has implications for this particular test, as the string literal
"~~~\u00ff\u00ff\u00ff\u00ff" is translated into different bytes:
Posix: { 126, 126, 126, 195, 191, 195, 191, 195, 191, 195, 191 }
Windows: { 126, 126, 126, 255, 255, 255, 255 }
Prepending `u8` to the string literal tells the compiler to encode
the string as UTF8. This does not expose any underlying bug(s)
on Windows because the test is only failing due to an incorrect input.
Review: https://reviews.apache.org/r/58430/
{code}
> Compile failures with char8_t by MSVC under /std:c++latest mode
> ---------------------------------------------------------------
>
> Key: MESOS-9718
> URL: https://issues.apache.org/jira/browse/MESOS-9718
> Project: Mesos
> Issue Type: Bug
> Components: build
> Reporter: QuellaZhang
> Priority: Major
> Labels: windows
>
> Hi All,
> We've stumbled across some build failures in Mesos after implementing support
> for char8_t under /std:c + + +latest in the development version of Visual C+
> + +. Could you help look at this? Thanks in advance! Noted that this issue
> only found when compiles with unreleased vctoolset, that next release of MSVC
> will have this behavior.
> *Repro steps:*
> git clone -c core.autocrlf=true [https://github.com/apache/mesos]
> D:\mesos\src
> open a VS 2017 x64 command prompt as admin and browse to D:\mesos
> set _CL_=/std:c++latest
> cd src
> .\bootstrap.bat
> cd ..
> mkdir build_x64 && pushd build_x64
> cmake ..\src -G "Visual Studio 15 2017 Win64"
> -DCMAKE_SYSTEM_VERSION=10.0.17134.0 -DENABLE_LIBEVENT=1
> -DHAS_AUTHENTICATION=0 -DPATCHEXE_PATH="C:\gnuwin32\bin" -T host=x64
> *Failures:*
> base64_tests.i
> D:\Mesos\src\3rdparty\stout\tests\base64_tests.cpp(63): error C2664:
> 'std::string base64::encode_url_safe(const std::string &,bool)': cannot
> convert argument 1 from 'const char8_t [12]' to 'const std::string &'
> D:\Mesos\src\3rdparty\stout\tests\base64_tests.cpp(63): note: Reason: cannot
> convert from 'const char8_t [12]' to 'const std::string'
> D:\Mesos\src\3rdparty\stout\tests\base64_tests.cpp(63): note: No constructor
> could take the source type, or constructor overload resolution was ambiguous
> D:\Mesos\src\3rdparty\stout\tests\base64_tests.cpp(63): error C2660:
> 'testing::internal::EqHelper<false>::Compare': function does not take 3
> arguments
>
> D:\Mesos\build_x64\3rdparty\googletest-1.8.0\src\googletest-1.8.0\googletest\include\gtest/gtest.h(1430):
> note: see declaration of 'testing::internal::EqHelper<false>::Compare'
> D:\Mesos\src\3rdparty\stout\tests\base64_tests.cpp(63): error C2512:
> 'testing::AssertionResult': no appropriate default constructor available
>
> D:\Mesos\build_x64\3rdparty\googletest-1.8.0\src\googletest-1.8.0\googletest\include\gtest/gtest.h(256):
> note: see declaration of 'testing::AssertionResult'
> D:\Mesos\src\3rdparty\stout\tests\base64_tests.cpp(67): error C2664:
> 'std::string base64::encode_url_safe(const std::string &,bool)': cannot
> convert argument 1 from 'const char8_t [12]' to 'const std::string &'
> D:\Mesos\src\3rdparty\stout\tests\base64_tests.cpp(67): note: Reason: cannot
> convert from 'const char8_t [12]' to 'const std::string'
> D:\Mesos\src\3rdparty\stout\tests\base64_tests.cpp(67): note: No constructor
> could take the source type, or constructor overload resolution was ambiguous
> D:\Mesos\src\3rdparty\stout\tests\base64_tests.cpp(67): error C2660:
> 'testing::internal::EqHelper<false>::Compare': function does not take 3
> arguments
>
> D:\Mesos\build_x64\3rdparty\googletest-1.8.0\src\googletest-1.8.0\googletest\include\gtest/gtest.h(1430):
> note: see declaration of 'testing::internal::EqHelper<false>::Compare'
> D:\Mesos\src\3rdparty\stout\tests\base64_tests.cpp(67): error C2512:
> 'testing::AssertionResult': no appropriate default constructor available
>
> D:\Mesos\build_x64\3rdparty\googletest-1.8.0\src\googletest-1.8.0\googletest\include\gtest/gtest.h(256):
> note: see declaration of 'testing::AssertionResult'
> D:\Mesos\src\3rdparty\stout\tests\base64_tests.cpp(83): error C2664:
> 'Try<std::string,Error> base64::decode_url_safe(const std::string &)': cannot
> convert argument 1 from 'const char8_t [16]' to 'const std::string &'
> D:\Mesos\src\3rdparty\stout\tests\base64_tests.cpp(83): note: Reason: cannot
> convert from 'const char8_t [16]' to 'const std::string'
> D:\Mesos\src\3rdparty\stout\tests\base64_tests.cpp(83): note: No constructor
> could take the source type, or constructor overload resolution was ambiguous
> D:\Mesos\src\3rdparty\stout\tests\base64_tests.cpp(83): error C2672:
> 'AssertSomeEq': no matching overloaded function found
> D:\Mesos\src\3rdparty\stout\tests\base64_tests.cpp(83): error C2780:
> 'testing::AssertionResult AssertSomeEq(const char *,const char *,const T1
> &,const T2 &)': expects 4 arguments - 3 provided
> D:\Mesos\src\3rdparty\stout\include\stout/gtest.hpp(79): note: see
> declaration of 'AssertSomeEq'
> D:\Mesos\src\3rdparty\stout\tests\base64_tests.cpp(83): error C2512:
> 'testing::AssertionResult': no appropriate default constructor available
>
> D:\Mesos\build_x64\3rdparty\googletest-1.8.0\src\googletest-1.8.0\googletest\include\gtest/gtest.h(256):
> note: see declaration of 'testing::AssertionResult'
> D:\Mesos\src\3rdparty\stout\tests\base64_tests.cpp(87): error C2664:
> 'Try<std::string,Error> base64::decode_url_safe(const std::string &)': cannot
> convert argument 1 from 'const char8_t [17]' to 'const std::string &'
> D:\Mesos\src\3rdparty\stout\tests\base64_tests.cpp(87): note: Reason: cannot
> convert from 'const char8_t [17]' to 'const std::string'
> D:\Mesos\src\3rdparty\stout\tests\base64_tests.cpp(87): note: No constructor
> could take the source type, or constructor overload resolution was ambiguous
> D:\Mesos\src\3rdparty\stout\tests\base64_tests.cpp(87): error C2672:
> 'AssertSomeEq': no matching overloaded function found
> D:\Mesos\src\3rdparty\stout\tests\base64_tests.cpp(87): error C2780:
> 'testing::AssertionResult AssertSomeEq(const char *,const char *,const T1
> &,const T2 &)': expects 4 arguments - 3 provided
> D:\Mesos\src\3rdparty\stout\include\stout/gtest.hpp(79): note: see
> declaration of 'AssertSomeEq'
> D:\Mesos\src\3rdparty\stout\tests\base64_tests.cpp(87): error C2512:
> 'testing::AssertionResult': no appropriate default constructor available
>
> D:\Mesos\build_x64\3rdparty\googletest-1.8.0\src\googletest-1.8.0\googletest\include\gtest/gtest.h(256):
> note: see declaration of 'testing::AssertionResult'
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)