Bug 257925 - databases/mongodb50: TypeError: '<' not supported between instances of 'str' and 'NoneType'
Summary: databases/mongodb50: TypeError: '<' not supported between instances of 'str' ...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Mikael Urankar
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-18 08:36 UTC by Matthias Fechner
Modified: 2021-08-29 17:28 UTC (History)
2 users (show)

See Also:
ronald-lists: maintainer-feedback+


Attachments
git diff (2.13 KB, patch)
2021-08-23 09:54 UTC, Ronald Klop
ronald-lists: maintainer-approval+
Details | Diff
git diff (2.79 KB, patch)
2021-08-27 20:22 UTC, Ronald Klop
ronald-lists: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Fechner freebsd_committer freebsd_triage 2021-08-18 08:36:13 UTC
if I try to build mongodb50 with poudriere it fails with error:
Checking for curl_global_init(0) in C library curl... yes
TypeError: '<' not supported between instances of 'str' and 'NoneType':
  File "/wrkdirs/usr/ports/databases/mongodb50/work/mongodb-src-r5.0.2/SConstruct", line 5231:
    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 "/wrkdirs/usr/ports/databases/mongodb50/work/mongodb-src-r5.0.2/src/SConscript", line 81:
    env.SConscript('third_party/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 "/wrkdirs/usr/ports/databases/mongodb50/work/mongodb-src-r5.0.2/src/third_party/SConscript", line 252:
    murmurEnv.SConscript('murmurhash3/SConscript', exports={ 'env' : murmurEnv })
  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 "/wrkdirs/usr/ports/databases/mongodb50/work/mongodb-src-r5.0.2/src/third_party/murmurhash3/SConscript", line 3:
    env.Library(
  File "/usr/local/lib/python3.8/site-packages/SCons/Environment.py", line 238:
    return super().__call__(target, source, *args, **kw)
  File "/usr/local/lib/python3.8/site-packages/SCons/Util.py", line 748:
    return self.method(*nargs, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/SCons/Builder.py", line 654:
    return self._execute(env, target, source, OverrideWarner(kw), ekw)
  File "/usr/local/lib/python3.8/site-packages/SCons/Builder.py", line 560:
    tlist, slist = self._create_nodes(env, target, source)
  File "/usr/local/lib/python3.8/site-packages/SCons/Builder.py", line 522:
    target, source = self.emitter(target=tlist, source=slist, env=env)
  File "/usr/local/lib/python3.8/site-packages/SCons/Builder.py", line 205:
    target, source = e(target, source, env)
  File "/wrkdirs/usr/ports/databases/mongodb50/work/mongodb-src-r5.0.2/src/SConscript", line 48:
    insort_wrapper(lds, shim_target)
  File "/wrkdirs/usr/ports/databases/mongodb50/work/mongodb-src-r5.0.2/site_scons/mongo/__init__.py", line 18:
    bisect.insort(target_list, target_string)
===> Compilation failed unexpectedly.

You can find the full log here:
https://pkg.fechner.net/data/130amd64-default/2021-08-18_10h05m07s/logs/errors/mongodb50-5.0.2.log

It is build with standard settings, only exception is using OpenSSL from ports and not base.
Comment 1 Ronald Klop 2021-08-18 11:25:01 UTC
Hi,

I've seen the issue. It happens since the upgrade of devel/scons to 4.2.0. Reverting scons to 4.1.0.post1 prevents the problem from happening. I mailed the scons maintainer, but didn't get feedback yet.

I don't know the solution. And didn't have enough time to really look into it.
So patches are welcome.

If you have time to create an issue upstream, please mention it here so we don't create double work.
https://jira.mongodb.org/
https://www.mongodb.com/community/forums/

Regards,
Ronald.
Comment 2 Ronald Klop 2021-08-21 22:09:57 UTC
I reported this issue on the MongoDB Forum.

https://www.mongodb.com/community/forums/community/forums/t/scons-4-2-0-fails-compilation/120611?u=r_k
Comment 3 Ronald Klop 2021-08-23 09:54:50 UTC
Created attachment 227377 [details]
git diff
Comment 4 Ronald Klop 2021-08-23 09:58:55 UTC
Comment on attachment 227377 [details]
git diff

I have a patch which changes the use of our ports scons to the in-tree scons of mongodb. This is scons 3.1.2.
See the forum post of MongoDB for feedback of a MongoDB developer about this.
https://www.mongodb.com/community/forums/t/scons-4-2-0-fails-compilation/120611/2?u=r_k
They are planning to move to Scons 4.2.0 in the future.
Comment 5 Ronald Klop 2021-08-27 20:22:57 UTC
Created attachment 227491 [details]
git diff

- Fix scons by using in source scons 3.1.2,
- Disable LTO on clang12/aarch64, bug #257765
- Build already installs in $STAGEDIR, so only strip in do-install.
- Fix a portlint warnings about the comment at the LICENSE section.
- Tested by "make stage-qa".
Comment 6 Ronald Klop 2021-08-27 21:31:31 UTC
Just for the record I'll record the upstream issue here:
https://jira.mongodb.org/browse/SERVER-59656
Comment 7 commit-hook freebsd_committer freebsd_triage 2021-08-28 13:43:22 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=77c5529691824fc93c8e8fe203d020a84bcb3bca

commit 77c5529691824fc93c8e8fe203d020a84bcb3bca
Author:     Ronald Klop <ronald-lists@klop.ws>
AuthorDate: 2021-08-28 13:06:47 +0000
Commit:     Mikael Urankar <mikael@FreeBSD.org>
CommitDate: 2021-08-28 13:42:10 +0000

    databases/mongodb50: Fix build failure with scons 4.2.0 by using in source scons 3.1.2

      - Fix scons by using in source scons 3.1.2 (They are planning to move to Scons
        4.2.0 in the future)
      - Disable LTO on clang12/aarch64, bug #257765
      - Build already installs in $STAGEDIR, so only strip in do-install.
      - Fix a portlint warnings about the comment at the LICENSE section.

    PR:             257925

 databases/mongodb50/Makefile                       | 15 +++++++++----
 .../files/patch-buildscripts_scons.py (new)        | 25 ++++++++++++++++++++++
 2 files changed, 36 insertions(+), 4 deletions(-)
Comment 8 Mikael Urankar freebsd_committer freebsd_triage 2021-08-28 13:44:50 UTC
does it need to be merged to quarterly?
Comment 9 Ronald Klop 2021-08-29 09:18:38 UTC
(In reply to Mikael Urankar from comment #8)
no need to merge to quarterly
- Scons is still older and working version on quarterly.
- Aarch64/clang12 is not used for quarterly packages, so LTO works there.

Thanks for your work 👍