Scons 4.2.0 fails compilation

Hi,

I’m maintaining some ports of MongoDB for FreeBSD. See for example: FreshPorts -- databases/mongodb50: Distributed document-oriented "NoSQL" database (5.0.x Branch) .
Compiling MongoDB with scons 4.2.0 fails (on FreeBSD). It fails from MongoDB 4.2 up until your git code from github. Scons 4.1.0 worked.

The error I get while compiling from github is:

Checking for C function sync_file_range()... no
Checking for C header file x86intrin.h... yes
Checking for C header file arm_neon.h... no
TypeError: '<' not supported between instances of 'str' and 'NoneType':
  File "/root/src/mongo/SConstruct", line 5243:
    env.SConscript(
  File "/usr/local/lib/python3.8/site-packages/SCons/Script/SConscript.py", line 597:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/usr/local/lib/python3.8/site-packages/SCons/Script/SConscript.py", line 285:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "/root/src/mongo/src/SConscript", line 37:
    env.SConscript('mongo/SConscript', exports=['env'])
  File "/usr/local/lib/python3.8/site-packages/SCons/Script/SConscript.py", line 597:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/usr/local/lib/python3.8/site-packages/SCons/Script/SConscript.py", line 285:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "/root/src/mongo/src/mongo/SConscript", line 51:
    env.SConscript(
  File "/usr/local/lib/python3.8/site-packages/SCons/Script/SConscript.py", line 597:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/usr/local/lib/python3.8/site-packages/SCons/Script/SConscript.py", line 285:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "/root/src/mongo/src/mongo/db/SConscript", line 2542:
    env.Benchmark(
  File "/usr/local/lib/python3.8/site-packages/SCons/Util.py", line 748:
    return self.method(*nargs, **kwargs)
  File "/root/src/mongo/site_scons/site_tools/mongo_benchmark.py", line 43:
    insort_wrapper(libdeps, "$BUILD_DIR/mongo/unittest/benchmark_main")
  File "/root/src/mongo/site_scons/mongo/__init__.py", line 18:
    bisect.insort(target_list, target_string)

Other people are reporting similar problems: 257925 – databases/mongodb50: TypeError: '<' not supported between instances of 'str' and 'NoneType' .

Any thoughts or advice?

Regards,
Ronald.

Hi - @R_K -

I’m able to reproduce this when using SCons 4.2.0, but not when using the vendored SCons that comes with the MongoDB sources (currently 3.1.2 + mongodb patches). Would you please file an issue in the SERVER project of the MongoDB JIRA referring back to this discussion?

Meanwhile, as a workaround, you can use the built-in SCons by invoking buildscripts/scons.py and you should no longer experience this issue.

We plan to upgrade to SCons 4.2 sometime in the near future, per SERVER-49324, so fixing this will be a prerequisite. Thanks for letting us know about the issue.

Thanks,
Andrew

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.