Bug 228319 - database/mongodb fails to build on 11.2-BETA1
Summary: database/mongodb fails to build on 11.2-BETA1
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords: needs-qa, regression
Depends on: 227217
Blocks:
  Show dependency treegraph
 
Reported: 2018-05-17 16:50 UTC by mgrooms
Modified: 2018-09-28 13:27 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mgrooms 2018-05-17 16:50:25 UTC
I believe this is due to 11.2 containing a newer version of LLVM. If I add the following to the Makefile, the build completes successfully.

.if ${COMPILER_TYPE} == clang
.if ${COMPILER_VERSION} >= 60
CXXFLAGS+= -Wno-undefined-var-template -Wno-unused-private-field -Wno-unused-local-typedef -Wno-undefined-bool-conversion
.endif
.endif

There is also one source code change that needs to be patched ...

../src/stub-cache.cc:1477:33: error: reinterpret_cast from 'nullptr_t' to 'char *' is not allowed
      : GetCodeWithFlags(flags, reinterpret_cast<char*>(NULL));
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Changing the reinterpret_cast to a static_cast allows the build to complete.
Comment 1 mgrooms 2018-05-17 17:05:55 UTC
Uggh, sorry. I was trying to fix two broken port builds and I mixed up the info for the two. Let me try again.

Makefile Diff ...

--- Makefile.old        2018-05-17 11:52:01.482886000 -0500
+++ Makefile    2018-05-17 12:00:06.856907000 -0500
@@ -38,7 +38,7 @@
 OPTIONS_DEFAULT=SSL
 TEST_DESC=     Add support for running regression test

-USES=          cpe scons
+USES=          cpe compiler scons
 MAKE_ARGS=     --prefix=${STAGEDIR}${PREFIX} --cc=${CC} --cxx=${CXX} \
                --use-system-pcre --use-system-snappy --use-system-v8

@@ -72,6 +72,14 @@
 ALL_TARGET=    core tools
 .endif

+.include <bsd.port.pre.mk>
+
+.if ${COMPILER_TYPE} == clang
+.if ${COMPILER_VERSION} >= 60
+CXXFLAGS+=     -Wno-undefined-var-template -Wno-unused-private-field -Wno-unused-local-typedef -Wno-undefined-bool-conversion
+.endif
+.endif
+
 post-patch:
        @${REINPLACE_CMD} 's/\["-O3"\]/"${CXXFLAGS}"/' \
                ${WRKSRC}/SConstruct
@@ -82,4 +90,4 @@
                ${MAKE_CMD} ${_MAKE_JOBS} ${MAKE_ARGS} ${TEST_TARGET}
 .endif

-.include <bsd.port.mk>
+.include <bsd.port.post.mk>


Source code diff ( not sure how to make that conditional on clang 6.0 ) ...

--- src/mongo/util/fail_point_registry.cpp.old  2018-05-17 12:03:41.963178000 -0500
+++ src/mongo/util/fail_point_registry.cpp      2018-05-17 12:03:52.764014000 -0500
@@ -53,7 +53,7 @@
     }

     FailPoint* FailPointRegistry::getFailPoint(const string& name) const {
-        return mapFindWithDefault(_fpMap, name, reinterpret_cast<FailPoint *>(NULL));
+        return mapFindWithDefault(_fpMap, name, static_cast<FailPoint *>(NULL));
     }

     void FailPointRegistry::freeze() {
Comment 2 Mateusz Piotrowski freebsd_committer freebsd_triage 2018-05-17 17:14:59 UTC
Note: when a patch for this issue is ready to be committed please remember about the ${name}_limits-related patch[1], which fixes this port on >=12.0.

[1]: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227217
Comment 3 Rene Ladan freebsd_committer freebsd_triage 2018-08-15 11:55:50 UTC
Is this PR also relevant for databases/mongodb3* ? This version (2.6.12) has been end-of-life upstream since 2016.
Comment 4 mgrooms 2018-08-15 16:11:36 UTC
When I built the package last it was for mongodb-2.6.12_4.
Comment 5 Rene Ladan freebsd_committer freebsd_triage 2018-09-28 13:27:13 UTC
Refers to expired and removed port.