[SERVER-39189] MongoDB failed to buid due to C2039 C2275 C2059 C3536 and C2440 on MSVC Created: 25/Jan/19 Updated: 20/Feb/19 Resolved: 20/Feb/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Build |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | LinGao | Assignee: | Andrew Morrow (Inactive) |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
VS 2017 + Windows Server 2016 + MongoDB master branch latest revision |
||
| Attachments: |
|
| Operating System: | ALL |
| Steps To Reproduce: | Reproduce steps:
Acutal result:
|
| Sprint: | Dev Tools 2019-02-11, Dev Tools 2019-02-25 |
| Participants: |
| Description |
|
MongoDB failed to buid due to C2039 C2275 C2059 C3536 and C2440 on MSVC. These errors appears to be make_intrusive not defined in the future.h file and can be first reproduced on 3e402ff version. We use latest version of MongoDB to test VS copmlier. And we know building MongoDB with VS 2017 is currently not supported, so we apply patch to support this, I attach this patch. Could you please help to take a look at this? Thanks in advance! |
| Comments |
| Comment by Andrew Morrow (Inactive) [ 20/Feb/19 ] | |
|
spacelg - I'm closing this ticket out because I believe the codebase on the master branch works out of the box with VS 2017. Please feel free to comment on this ticket if you are still having issues and we can re-open it. | |
| Comment by Andrew Morrow (Inactive) [ 14/Feb/19 ] | |
|
spacelg - This is quite puzzling to me. You can see our build log for that file on master on Windows with VS 2017 here: https://evergreen.mongodb.com/task_log_raw/mongodb_mongo_master_enterprise_windows_64_2k8_compile_27d6644dffd80f139b90a8e89f1b21d8830ec35a_19_02_14_14_51_41/0?type=T#L2825 It compiles for us without warnings or errors, that I see. Our command line for that file looks like:
I'd be interested to know what your cl invocation for that file looks like in your build so we can diff them. | |
| Comment by LinGao [ 14/Feb/19 ] | |
|
Hi Andrew Morrow -Thanks for your information! I'm sorry that I use wrong path. As you said. I ues right path in my script as below: call %_SCRIPT_DIR%\RunHelper.cmd "python.exe buildscripts/scons.py" %_LOG_DIR%\log_scons.log & if NOT "Unable to render embedded object: File (ERRORLEVEL) not found." == "0" exit /b 2008
python.exe buildscripts/scons.py will get the following errors: D:\MongoDB\src\src\third_party\mozjs-60\include\mozilla/Variant.h(247): error C2988: unrecognizable template declaration/definition
Could you please help to take a look at this? Thanks in advance!
| |
| Comment by Andrew Morrow (Inactive) [ 13/Feb/19 ] | |
|
I think I just had a typo in my prior posting (builscripts vs buildscripts). You should be able to run python ./buildscripts/scons.py to start the build. | |
| Comment by LinGao [ 13/Feb/19 ] | |
|
Hi Andrew Morrow -Thanks for your information! At the beginning,MongoDB failed to build due to upgrade SCons to version 3.0.4. Scons 3.0.0 was used in our test machine. So we replaced scons 3.0.0 with scons 3.0.4 . Extract the downloaded scons-3.0.4.zip file to D:\MongoDB\tools\ and execute the following commands: Then we started to build. Currently,i try building with the built-in copy of SCons we have in the tree. When i get it by running python builscripts/scons.py. Always get the following results: [executing command] python.exe builscripts/scons.py We are able to determine that the scons.py file is present in this path D:\MongoDB\src\buildscripts. Is there a change in the way to build mongodb? Could you please help to take a look at this? Thanks in advance!
| |
| Comment by Andrew Morrow (Inactive) [ 12/Feb/19 ] | |
|
spacelg - That is a very odd error. I don't think it is related to our recent C++17 changes, but it could be related to some upstream changes that SCons has recently made. Could you please try building with the built-in copy of SCons we have in the tree? You can get it by running python builscripts/scons.py. We generally prefer to build using the built-in SCons as we sometimes cherry-pick in important fixes. | |
| Comment by LinGao [ 12/Feb/19 ] | |
|
Hi Andrew Morrow - Thank you so much for your reply! I am very sorry that I have not responded to you in time due to the Chinese New Year holiday. I have tested with latest version of master branch 8e76d8c. It failed to build due to D:\MongoDB\src\src\mongo/db/auth/action_set.h(38): fatal error C1083: Cannot open include file: 'mongo/db/auth/action_type.h': No such file or directory
In action_set.h line 38: #include "mongo/db/auth/action_type.h". But we couldn't find action_type.h in source code path. Could you please help to take a look at this? Thanks in advance!
Acutal result: D:\MongoDB\src\src\mongo/db/auth/action_set.h(38): fatal error C1083: Cannot open include file: 'mongo/db/auth/action_type.h': No such file or directory
log_x64_build_latestversion.log
| |
| Comment by Andrew Morrow (Inactive) [ 07/Feb/19 ] | |
|
Hi spacelg - Just checking back on this ticket. Have you been able to test with the latest version of master branch? | |
| Comment by Andrew Morrow (Inactive) [ 01/Feb/19 ] | |
|
spacelg - Please note that | |
| Comment by Andrew Morrow (Inactive) [ 01/Feb/19 ] | |
|
Hi spacelg - We are actively working on fixing issues such that we can enable /permissive- in | |
| Comment by LinGao [ 01/Feb/19 ] | |
|
Hi Ander Morrow Thanks for your reply. The mongodb_permissive_c3861.patch in the attachment replaces ''SharedState<T>'' in './src/mongo/util/future.h with ''future_details::SharedState<T>''. This may be reported Error ''error C2039: 'make_intrusive': is not a member of 'mongo::future_details' '' related. So I removed this mongodb_permissive_c3861.patch and pulled the latest master. Re-follow the Reproduce steps to build MongoDB. But I got a lot of other errors.
log_x64_build_withoutpatch__latestmaster.log Acutal result: D:\MongoDB\src\src\third_party\mozjs-60\include\mozilla/Variant.h(247): error C2988: unrecognizable template declaration/definition
| |
| Comment by Andrew Morrow (Inactive) [ 31/Jan/19 ] | |
|
Hi spacelg - We believe that the mongodb master branch should now compile without modification in VS 2017, and without additional warning flags passed on the command line. Could you please pull the latest master and see if it works for you? | |
| Comment by Danny Hatcher (Inactive) [ 25/Jan/19 ] | |
|
Hello, Thank you for your report. I have forwarded this ticket to the appropriate team. Danny |