[SERVER-46671] Using VS2019 to automatically build MondoDB and it failed with [WinError 3] The system cannot find the path specified: 'VC\\Redist\\MSVC' Created: 06/Mar/20  Updated: 16/Mar/20  Resolved: 16/Mar/20

Status: Closed
Project: Core Server
Component/s: Build
Affects Version/s: None
Fix Version/s: None

Type: Question Priority: Major - P3
Reporter: Gao Lin Assignee: Mark Benvenuto
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

VS 2019+ Windows Server 2016 + MongoDB master branch 18f95f8 commit


Attachments: Text File log_build.log    
Participants:

 Description   

We (the MSVC ++ team) is trying to use VS2019 to replace VS2017 to automatically build open source projects. When we build MongoDB, it always fails with FileNotFoundError: [WinError 3] The system cannot find the path specified: 'VC
Redist
MSVC':
  File "F:\gitP\mongodb\mongo\SConstruct", line 4164:
    variant_dir='$BUILD_DIR',

Note: We us vs2017 automatically build, no error.

We use MongoDB master branch 18f95f8 commit. Could you please have a look at this issue? Thanks a lot!

Repro steps:

  1. git clone -c core.autocrlf=true https://github.com/mongodb/mongo F:\gitP\mongodb\mongo
  2. Open a VS 2019 x64 command prompt and browse to F:\gitP\mongodb\mongo
  3. git checkout 18f95f8
  4. pip3 install -r etc/pip/compile-requirements.txt
  5. python buildscripts/scons.py all -j4

Acutal result:

 ##[command] Command #0 (Output in "build.log"):  "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -host_arch=amd64 -arch=amd64
 **********************************************************************
 ** Visual Studio 2019 Developer Command Prompt v16.4.5
 ** Copyright (c) 2019 Microsoft Corporation
 **********************************************************************
 ##[debug] Command #0 exited with code [0].
 ##[command] Command #1 (Output in "build.log"):  cd F:\gitP\mongodb\mongo
 ##[debug] Command #1 exited with code [0].
 ##[command] Command #2 (Output in "build.log"):  python buildscripts/scons.py all -j4 2>&1
 scons: Reading SConscript files ...
 scons: running with args C:\Python\Python37\python.exe buildscripts/scons.py all -j4
 Mkdir("build\scons")
 scons version: 3.1.1
 python version: 3 7 4 'final' 0
 CC is cl
 cl found in $PATH at C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.24.28314\bin\HostX64\x64\cl.EXE
 CXX is $CC
 $CC was not found in $PATH
 $CC resolves to F:\gitP\mongodb\mongo\$CC
 Checking whether the C compiler works... yes
 Checking whether the C++ compiler works... yes
 Checking that the C++ compiler can link a C++ program... yes
 Checking if C++ compiler "$CC" is MSVC... yes
 Checking if C compiler "cl" is MSVC... yes
 Detected a x86_64 processor
 Checking if target OS windows is supported by the toolchain... yes
 Checking if C compiler is Microsoft Visual Studio 2017 15.9 or newer...yes
 Checking if C++ compiler is Microsoft Visual Studio 2017 15.9 or newer...yes
 Checking if we are using libstdc++... no
 Checking for C++17... yes
 Checking for memset_s... no
 Checking for C function strnlen()... yes
 Checking Windows SDK is 8.1 or newer... yes
 Checking if we are on a POSIX system... no
 Checking for storage class thread_local yes
 Checking for C++14 std::enable_if_t support...yes
 Using SSL Provider: windows
 Checking for C++ header file execinfo.h... no
 Checking for C library pcap... no
 Checking for C library wpcap... no
 Checking if std::atomic<int64_t> works... yes
 Checking if std::atomic<uint64_t> works... yes
 Checking if std::atomic<int32_t> works... yes
 Checking if std::atomic<uint32_t> works... yes
 Checking for extended alignment 64 for concurrency types... yes
 Checking for mongoc_get_major_version() in C library mongoc-1.0... no
 Checking for C function fallocate()... no
 Checking for C function sync_file_range()... no
 Checking for C header file x86intrin.h... no
 Checking for C header file arm_neon.h... no
 FileNotFoundError: [WinError 3] The system cannot find the path specified: 'VC\\Redist
MSVC':
   File "F:\gitP\mongodb\mongo\SConstruct", line 4164:
     variant_dir='$BUILD_DIR',
   File "F:\gitP\mongodb\mongo\src\third_party\scons-3.1.1\scons-local-3.1.1\SCons\Script\SConscript.py", line 605:
     return _SConscript(self.fs, *files, **subst_kw)
   File "F:\gitP\mongodb\mongo\src\third_party\scons-3.1.1\scons-local-3.1.1\SCons\Script\SConscript.py", line 286:
     exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
   File "F:\gitP\mongodb\mongo\src\SConscript", line 27:
     env.SConscript('mongo/SConscript', exports=['env'])
   File "F:\gitP\mongodb\mongo\src\third_party\scons-3.1.1\scons-local-3.1.1\SCons\Script\SConscript.py", line 605:
     return _SConscript(self.fs, *files, **subst_kw)
   File "F:\gitP\mongodb\mongo\src\third_party\scons-3.1.1\scons-local-3.1.1\SCons\Script\SConscript.py", line 286:
     exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
   File "F:\gitP\mongodb\mongo\src\mongo\SConscript", line 50:
     'env',
   File "F:\gitP\mongodb\mongo\src\third_party\scons-3.1.1\scons-local-3.1.1\SCons\Script\SConscript.py", line 605:
     return _SConscript(self.fs, *files, **subst_kw)
   File "F:\gitP\mongodb\mongo\src\third_party\scons-3.1.1\scons-local-3.1.1\SCons\Script\SConscript.py", line 286:
     exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
   File "F:\gitP\mongodb\mongo\src\mongo\installer\SConscript", line 12:
     'env',
   File "F:\gitP\mongodb\mongo\src\third_party\scons-3.1.1\scons-local-3.1.1\SCons\Script\SConscript.py", line 605:
     return _SConscript(self.fs, *files, **subst_kw)
   File "F:\gitP\mongodb\mongo\src\third_party\scons-3.1.1\scons-local-3.1.1\SCons\Script\SConscript.py", line 286:
     exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
   File "F:\gitP\mongodb\mongo\src\mongo\installer\msi\SConscript", line 59:
     dirs = os.listdir(redist_root)
 ##[debug] Command #2 exited with code [2].
 ##[error] Detected error code [2].
 
 

 

 

 



 Comments   
Comment by Gao Lin [ 16/Mar/20 ]

Hi Mark,

Sorry for the late reply and thanks for your info. And now we have patched mongodb and it has been successfully build.  If we need to update the commit later, we can use your recommended commit. So it can be closed.

Thanks,

Lin 

Comment by Mark Benvenuto [ 11/Mar/20 ]

VS 2019 changed the redist location and broke our assumptions as we try to find it so we include it in our zip and MSI targets.

We fixed our logic as part of SERVER-44557 and this commit https://github.com/mongodb/mongo/commit/7c428b6fba15eb2058d52430b8d2c5f4df45d7ad

I assume you just need a commit that works with VS 2019. I can recommend https://github.com/mongodb/mongo/commit/ac9caedb40dd0616a10b38db7efdc404052527bb since it will have that fix and it is commit that I know builds cleanly with VS 2019 on our CI system. I do not know if the code still compiles with VS 2017 since we have migrated from VS 2017 to VS 2019 in February 2020.

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