Opened 10 years ago
Closed 10 years ago
#47119 closed defect (wontfix)
mongodb @3.0.0: error: use of undeclared identifier 'strnlen'
Reported by: | ryandesign (Ryan Carsten Schmidt) | Owned by: | ryandesign (Ryan Carsten Schmidt) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.3.3 |
Keywords: | snowleopard | Cc: | floehlj@… |
Port: | mongodb |
Description
mongodb 3.0.0 was not designed to build on Snow Leopard, unlike prior versions. I've already patched SConstruct to allow building on 10.6, and added compiler blacklists to ensure clang 3.4 or later is used, but the build fails with:
src/mongo/bson/bsonelement.h:485:35: error: use of undeclared identifier 'strnlen' size_t size = strnlen( fieldName(), maxLen - 1 ); ^
strnlen
was added to OS X in 10.7.
Perhaps we can find a compatibility version of strnlen
.
mongodb used to include a version of strnlen
but I believe it was nonstandard.
Change History (4)
comment:1 Changed 10 years ago by floehlj@…
comment:2 follow-up: 3 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)
Cc: | floehlj@… added |
---|
Has duplicate #47214.
I have not yet had a chance to look into adding a compatibility strnlen function. Really, it's an upstream issue, and if you want continued mongodb support for Snow Leopard, you need to report it to the developers of mongodb.
Yes, you can exclude ports from being upgraded. To exclude mongodb, you would run:
sudo port upgrade outdated and not mongodb
However, if you also have other ports installed that depend on mongodb, that are also outdated, MacPorts would still try to upgrade them, and as a result mongodb. So to prevent that would would need to exclude each such port as well. For example, to exclude both mongodb and php56-mongo, you would run:
sudo port upgrade outdated and not \( mongodb php56-mongo \)
comment:3 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)
Replying to ryandesign@…:
if you want continued mongodb support for Snow Leopard, you need to report it to the developers of mongodb.
I did not see an existing issue, so I filed https://jira.mongodb.org/browse/SERVER-17813
comment:4 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)
Resolution: | → wontfix |
---|---|
Status: | new → closed |
The developers state that this change is intentional; mongodb 3 requires OS X 10.7 or newer. I have modified the portfile accordingly in r134623.
Might this be a possible workaround for this problem?
https://github.com/openigtlink/OpenIGTLink/issues/25 https://github.com/rubinius/rubinius/commit/bff14074dff56b27e3e96e0d6e7a93e2915c3d42
I also found a strnlen patch for Snow Leopard in my MacPorts folder here:
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/devel/cctools/files/snowleopard-strnlen.patch
which seems to address the same problem, but just for a different port.
If there is no solution at this time, is there a way to exclude mongodb 3.0.0 from the list of updates available for Snow Leopard, until the problem can be solved? The problem is, that installing updates always stops when my machine tries to compile mongodb.