[SERVER-67414] DistributionAndProjections compile error with MSVC 14.32.31326 Created: 21/Jun/22  Updated: 29/Oct/23  Resolved: 12/Jul/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.1.0-rc0

Type: Bug Priority: Major - P3
Reporter: Daniel Moody Assignee: Alex Neben
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:
  • Make sure you have MSVC 14.32.31326 installed: Microsoft (R) C/C++ Optimizing Compiler Version 19.32.31329 for x64

 C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.32.31326\bin\HostX64\x64\cl.EXE

  • git checkout 4287c36
  • cd src\mongo\db\modules\enterprise
  • git checkout 63797e1
  • cd ..\..\..\..\..
  • buildscripts\scons.py --dbg=on --ssl --win-version-min=win10 --link-model=object CPPPATH="c:/mongodb/libs/sasl/include c:/mongodb/libs/snmp/include" LIBPATH="c:/mongodb/libs/sasl/lib c:/mongodb/libs/snmp/lib" MONGO_GIT_HASH="unknown" MONGO_VERSION="6.1.0" --ninja generate-ninja{}
  • ninja build\debug\mongo\db\query\optimizer\explain.obj
Sprint: Dev Platform 2022-07-11, Dev Platform 2022-07-25
Participants:

 Description   

Updating to the latest version of the compiler for MSVC 2022 cause a compilation error:
[1667/4591] Compiled build\debug\mongo\db\query\optimizer\explain.obj

FAILED: build/debug/mongo/db/query/optimizer/explain.obj
cl @build\debug\mongo\db\query\optimizer\explain.obj.rsp
src\mongo\db\query\optimizer\explain.cpp(1691,32): error C2039: '_type': is not a member of 'mongo::optimizer::properties::DistributionAndProjections'
if (distr1._type < distr2._type) {
^
C:\mongodb\mongo\src\mongo/db/query/optimizer/props.h(233): note: see declaration of 'mongo::optimizer::properties::DistributionAndProjections'
struct DistributionAndProjections
{ src\mongo\db\query\optimizer\explain.cpp(2257): note: see reference to class template instantiation 'mongo::optimizer::ExplainGeneratorTransporter<version>' being compiled }
;

around the code https://github.com/mongodb/mongo/blob/afc52bea57c8edb8769efa67c01ebbde5a87f50d/src/mongo/db/query/optimizer/explain.cpp#L1688-L1693

 

Investigate the relevant code related to the newer compiler.



 Comments   
Comment by Githook User [ 12/Jul/22 ]

Author:

{'name': 'Alexander Neben', 'email': 'alexander.neben@mongodb.com', 'username': 'IamXander'}

Message: SERVER-67414 Fixed msvc compile
Branch: master
https://github.com/mongodb/mongo/commit/54d6cd95aa4a3200eaaa13a4381c00479714c907

Comment by Daniel Moody [ 21/Jun/22 ]

The code in question seems correct C++, so it may be an MSVC compiler issue. Some investigation around MSVC and this issue should be done. If nothing is found, SDP should create a minimal reproducer and submit and issue to microsoft about this.

Generated at Thu Feb 08 06:08:04 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.