#63871 closed defect (invalid)
mongodb @5.0.3: Couldn't find SASL header/libraries
Reported by: | knightcode (Dylan) | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.7.1 |
Keywords: | monterey | Cc: | ryandesign (Ryan Carsten Schmidt), dylanryan |
Port: | mongodb |
Description
Followed the migration guide after upgrading Mac OS to 12.0.1 on a 2019 MacBook Pro x86_64 (i9). Mongo server failed to install (among others). The excerpt from the log below shows that it can't find sasl2. The cyrus-sasl2 port did install correctly beforehand and is listed amongst the installed ports. I also tried uninstalling all ports, reclaiming, and just installing 'mongodb' alone. Same result.
:info:build Checking for C library snappy... no :info:build Checking for C library z... no :info:build Checking for C library zstd... no :info:build Checking for C library stemmer... no :info:build Checking for C library yaml-cpp... no :info:build Checking for C library rt... no :info:build Checking for C library dl... yes :info:build Checking for C++ header file execinfo.h... yes :info:build Checking whether backtrace is declared... yes :info:build Checking whether backtrace_symbols is declared... yes :info:build Checking whether backtrace_symbols_fd is declared... yes :info:build Checking for C library pcap... no :info:build Checking for C library wpcap... no :info:build Checking for sasl_version_info(0, 0, 0, 0, 0, 0) in C library sasl2... no :info:build Couldn't find SASL header/libraries :info:build See /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_databases_mongodb/mongodb/work/mongodb-src-r5.0.3/build/scons/config.log for details :info:build Command failed: cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_databases_mongodb/mongodb/work/mongodb-src-r5.0.3" && /opt/local/bin/python3.9 buildscripts/scons.py -j16 install-core CC="/usr/bin/clang" CFLAGS="" CPPPATH="/opt/local/include" CXX="/usr/bin/clang++" CXXFLAGS="-stdlib=libc++" DESTDIR="/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_databases_mongodb/mongodb/work/destroot" LIBPATH="/opt/local/lib" PREFIX="/opt/local" --disable-warnings-as-errors --enable-http-client=on --install-action=hardlink --libc++ --opt=size --release --ssl=on --use-sasl-client --use-system-pcre --use-system-snappy --use-system-stemmer --use-system-yaml --use-system-zlib --use-system-zstd --wiredtiger=on --use-system-mongo-c=off VARIANT_DIR=MP TARGET_ARCH=x86_64 CCFLAGS="-arch x86_64" LINKFLAGS="-Wl,-headerpad_max_install_names -arch x86_64" :info:build Exit code: 1 :error:build Failed to build mongodb: command execution failed
Attachments (4)
Change History (22)
comment:1 Changed 3 years ago by chrstphrchvz (Christopher Chavez)
Changed 3 years ago by knightcode (Dylan)
Changed 3 years ago by knightcode (Dylan)
Attachment: | config.log added |
---|
comment:3 follow-up: 9 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
I'm not sure if this is the cause, but the config.log has a lot of:
ld: warning: dylib (/opt/local/lib/libsasl2.dylib) was built for newer macOS version (12.0) than being linked (11.3)
Do we have any idea why it is trying to link for 11.3 on your macOS 12 system? That's not normal.
comment:4 Changed 3 years ago by knightcode (Dylan)
Not a clue. I didn't set anything. I upgraded to Monterey normally. "About this Mac" says 12.0.1.
comment:5 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
You performed the migration steps when you upgraded to Monterey?
comment:6 Changed 3 years ago by knightcode (Dylan)
I did, yes. I'll try doing them again if you want.
comment:7 follow-up: 8 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
No, just checking for possible easy fixes. I'll update the port to version 5.1.0 shortly; we can see if that changes anything.
comment:8 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
Replying to ryandesign:
I'll update the port to version 5.1.0 shortly
No I won't, turns out only x.0.x versions are considered stable now. I'll update it to 5.0.4 when that's out.
comment:9 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
Replying to ryandesign:
I'm not sure if this is the cause, but the config.log has a lot of:
ld: warning: dylib (/opt/local/lib/libsasl2.dylib) was built for newer macOS version (12.0) than being linked (11.3)
So indeed the mongodb build uses the linker flag -fatal_warnings
, thereby requesting that possibly harmless warnings like the above be turned into fatal errors.
I do see in your log file:
The macOS 12 SDK does not appear to be installed. Ports may not build correctly.
The log says you have Xcode 13.1. Do you also have the Xcode 13.1 version of the command line tools? Check /Library/Developer/CommandLineTools/SDKs. If you do not see MacOSX12.sdk in there, your command line tools are out of date and you need to update them. There is a bug in macOS that prevents it from automatically updating the CLT for you so you have to do it manually. For instructions see ProblemHotlist#reinstall-clt.
comment:10 Changed 3 years ago by knightcode (Dylan)
That's the problem. I had seen that printed all the time, but I figured Apple would be telling me to update the command line tools if there were new versions available. Updating now and will try again
comment:12 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
Keywords: | monterey added |
---|---|
Resolution: | → invalid |
Status: | new → closed |
Summary: | mongodb 5.0.3: Fails at configure stage on Mac OS Monterey → mongodb @5.0.3: Couldn't find SASL header/libraries |
Great! Glad we found the cause. I've updated wiki:Migration with a pointer to ProblemHotlist#reinstall-clt.
comment:13 Changed 3 years ago by dylanryan
I am having (I believe) the same issue when attempting to upgrade mongo on High Sierra. I tried updating Xcode as much as I could (10.1), and re-installed the correct command line tools, but mongo install still dies at the same point (Upgrading on Monterey seems fine, but I'd like to be able to get this working on HS as well if possible).
comment:14 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
Cc: | dylanryan added |
---|
Dylan, the cause in your case is different, so this should have been a separate ticket, but:
Your log says the failure was caused by:
ld: warning: text-based stub file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd and library file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation are out of sync. Falling back to library file for linking.
This probably means you need to install a version of the Xcode command line tools that is compatible with High Sierra, and ideally it should be the same version as the version of Xcode that you are using.
The search doesn't work well at the moment, but press Command-F on this page and search for "Command Line Tools (macOS 10.13) for Xcode 10.1":
Note that mongodb's days on High Sierra are numbered. 5.0.x is the last version that will work there. If you want to continue to use mongodb, you'll need to update to a newer macOS soon.
comment:15 Changed 3 years ago by dylanryan
I thought that was the version I installed -- I got it from software update, but the name sounds right. I'll double-check when I get back to my other computer tonight and try a direct download. If that doesn't fix it, I'll open a fresh ticket. Thanks for the help!
And yeah, I've got a much newer computer that runs Monterey just fine, just trying to keep the ancient (2011!) laptop useful for as long as possible. HS is as far as it can go IIRC, so it's a race between whether hardware fails it or software abandons it at this point. C'est la vie.
comment:16 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
If you want to try updating the old machine to a newer OS, OpenCore Legacy Patcher is worth a try. It worked for me to get macOS 11 and 12 onto a 2012 MBP that doesn't officially support those.
comment:17 Changed 3 years ago by dylanryan
Sorry, was away for a bit longer than I thought. Direct download of the CLI tools produced identical log files. A little googling led me to https://stackoverflow.com/questions/51314888/ld-warning-text-based-stub-file-are-out-of-sync-falling-back-to-library-file , which seems to imply that this was just left in a bad state by Apple and never fixed on High Sierra.
Creating the following two symlinks (as one of the answers there suggested) in /Library/Frameworks allowed the build to proceed past configuration (though on this machine the full compile will probably take over night, mongo is decidedly not a fast build, especially on aging hardware). Not ideal, but if it works, it works. I'll report back at the end (sorry for co-opting this ticket for this)
sudo ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework /Library/Frameworks/CoreFoundation.framework
sudo ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/ /Library/Frameworks/Security.framework
-- edit, added later
It got farther, eventually dying on this:
/opt/local/libexec/llvm-9.0/bin/../include/c++/v1/memory:2338:5: error: aligned deallocation function of type 'void (void *, std::size_t, std::align_val_t) noexcept' is only available on macOS 10.14 or newer
According to https://docs.mongodb.com/manual/administration/production-notes/#std-label-prod-notes-supported-platforms , 10.13 support was dropped in 5.0 entirely. Perhaps the port should indicate that somehow and fail early with a note to that effect?
comment:18 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
I am aware that upstream claims to have dropped 10.13 support as of version 5.0, however 5.0 built fine for me on 10.13 with Xcode 9 which is why I kept support available. mongodb 5.1 does not build on 10.13 with Xcode 9 anymore which is why I am planning on requiring macOS 10.14 when I introduce the mongodb-devel port with that version. Perhaps the issue you are encountering is specific to Xcode 10.
Could the reporter please attach main.log as well as
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_databases_mongodb/mongodb/work/mongodb-src-r5.0.3/build/scons/config.log
?