Bug #10941
closed[MSVC] Wt failed to build with error C2026 on MSVC
100%
Description
Hi all,
Wt fails to build on MSVC due to error C2026. Could you help look?
Error message
F:\gitP\emweb\wt\build_amd64\src\Wt_js.C(34,3): error C2026: string too big, trailing characters truncated [F:\gitP\emweb\wt\build_amd64\src\wt.vcxproj]
Expected Behaviour
build successfully.
version info
OS Version: windows server 2019
VS version: VS2019 (16.11.18)
the commit of Wt we use is 0a2ea66
Repro steps
- git clone https://github.com/emweb/wt F:\gitP\emweb\wt
- set VSCMD_SKIP_SENDTELEMETRY=1 & "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -host_arch=amd64 -arch=amd64
- xcopy F:\tools\Boost\Patch\boost_1_67_0\x64\boost\iostream\Changed\fpos.hpp F:\gitP\emweb\wt..\boost_1_67_0\x64\boost\iostreams\detail\config /k/r/i/c/f/y
- mkdir F:\gitP\emweb\wt\build_amd64 and cd F:\gitP\emweb\wt\build_amd64
- cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_SYSTEM_VERSION=10.0.18362.0 -DBOOST_PREFIX=F:\gitP\emweb\wt..\boost_1_67_0\x64 -DBOOST_LIBRARYDIR=F:\gitP\emweb\wt..\boost_1_67_0\x64\lib64-msvc-14.1 .. 2>&1
- msbuild /m /p:Platform=x64 /p:Configuration=Release ALL_BUILD.vcxproj /t:Rebuild 2>&1
Files
Updated by Roel Standaert over 2 years ago
- Status changed from New to InProgress
- Assignee set to Roel Standaert
- Target version set to 4.9.0
It appears that our new minifier (terser) doesn't insert quite as many newlines as our old one (an old Google closure compiler version), and our filetostring
CMake script starts a new string literal at every newline. This means that we're running into MSVC's maximum for string literal sizes: https://docs.microsoft.com/en-us/cpp/error-messages/compiler-errors-1/compiler-error-c2026.
Updated by Roel Standaert over 2 years ago
- Status changed from InProgress to Review
- Assignee deleted (
Roel Standaert)
Updated by Roel Standaert about 2 years ago
- Status changed from Review to Implemented @Emweb
- Assignee changed from Korneel Dumon to Roel Standaert
- % Done changed from 0 to 100
Updated by Roel Standaert about 2 years ago
- Status changed from Implemented @Emweb to Resolved
Updated by Roel Standaert about 2 years ago
- Related to Bug #11006: filetostring.cmake generates file literals that exceed the minimum maximum string literal length added
Updated by Roel Standaert about 2 years ago
- Status changed from Resolved to Closed