[SERVER-40875] Build MongoDB r3.6.8 with ssl error Created: 28/Apr/19  Updated: 27/Oct/23  Resolved: 05/May/19

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

Type: Question Priority: Major - P3
Reporter: Liu Pengshi Assignee: Andrew Morrow (Inactive)
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-40874 Build MongoDB r3.6.8 with ssl error Closed
Sprint: Dev Tools 2019-05-06
Participants:

 Description   

When I compile MongoDB r3.6.8 with ssl, I reported the following error and then compile terminated.

 EnvironmentError: No module named pkg_resources:
 File "/home/qyy/mongo-r3.6.8/SConstruct", line 3128:
 env.Tool('icecream')
 File "/usr/lib/scons-3.0.1/SCons/Environment.py", line 1788:
 tool = SCons.Tool.Tool(tool, toolpath, **kw)
 File "/usr/lib/scons-3.0.1/SCons/Tool/__init__.py", line 118:
 module = self._tool_module()
 File "/usr/lib/scons-3.0.1/SCons/Tool/__init__.py", line 153:
 raise SCons.Errors.EnvironmentError(e)

The config.log file reports the following error:

scons: Configure: Checking for mongoc_get_major_version() in C library mongoc-1.0...
build/scons/opt/sconf_temp/conftest_69.c <-
 |
 |
 |#include "mongoc.h"
 |
 |int
 |main() {
 | mongoc_get_major_version();
 |return 0;
 |}
 |
Compiling build/scons/opt/sconf_temp/conftest_69.o
build/scons/opt/sconf_temp/conftest_69.c:3:20: fatal error: mongoc.h: No such file or directory
compilation terminated.
scons: Configure: no



 Comments   
Comment by Liu Pengshi [ 05/May/19 ]

 
 
My python is missing some packages, and when I install them, I can build mongo normally. Thank you for your help.

Comment by Andrew Morrow (Inactive) [ 04/May/19 ]

There are additional python package requirements in 3.6 that are not required for older branches. Did you try to ensure that your python can import the pkg-resources package?

Comment by Liu Pengshi [ 04/May/19 ]

My Python version can build mongo 3.2 and 3.4, but I can't build mongo 3.6. Do I need to upgrade python?

Comment by Andrew Morrow (Inactive) [ 03/May/19 ]

If you start up the python REPL on your system, can you run import pkg-resources? If not, I think you may need to ensure that the setuptools module is installed. Note that I recommend always doing your work within a virtualenv, probably using virtualenvwrapper to make life tolerable. Note also that on the v3.6 branch, there is a file called buildscripts/requirements.txt. You want to make sure that you have those packages available (again, presumably in a virtualenv), by running pip install -r buildscripts/requirements.txt before invoking scons. The same file exists on the v4.0 branch, but note that on master these files have moved to a more granular set of files under the etc/pip directory of the tree.

I believe that if you fix your python requirements, that you will find that the build works.

Comment by Liu Pengshi [ 03/May/19 ]

EulerOS is Huawei's self-developed operating system, based on CentOS.

Comment by Liu Pengshi [ 03/May/19 ]

acm - First of all, thank you very much for your answer. I am building on the EulerOS 4.8.5-4 operating system.The version number of python is 2.7.5. SCons command is "scons --debug=time --ssl all MONGO_VERSION=3.6.8".

Comment by Andrew Morrow (Inactive) [ 01/May/19 ]

mr-liu - I will need some additional information to assist you. What operating system are you attempting to build on? What version of python are you using? What was the exact SCons invocation you passed on the command line?

It looks to me like the error is that the python package pkg-resources was unavailable in your python environment. I think the mongoc error is misleading - it wasn't found, but that is not an error. It just happens to be that that is the last check that the build system looks for, so it seems as if that failure failed the build, but I don't think it did.

Comment by Liu Pengshi [ 28/Apr/19 ]

Can someone help me see what the problem is, thank goodness!

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