Opened 13 years ago

Closed 12 years ago

#30089 closed defect (fixed)

couchdb: configure fails claiming erlang is missing openssl support

Reported by: conradwt (Conrad Taylor) Owned by: bfulgham@…
Priority: Normal Milestone:
Component: ports Version: 1.9.2
Keywords: lion Cc: paul@…, joh.dokler@…, jyrkiwahlstedt, ryandesign (Ryan Carsten Schmidt)
Port: couchdb

Description

Hi, the couchdb port failed to build failed because erlang port is missing the openssl support. Next, in ticket #30012, I updated the portfile for erlang and the build completed successfully and port was activated. However, I noticed many erlang level errors which appeared to be erlang tests.

$ sudo port -v install couchdb
Password:
--->  Computing dependencies for couchdb.
--->  Configuring couchdb
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /opt/local/bin/gmkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking for gcc... /Developer/usr/bin/llvm-gcc-4.2
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /Developer/usr/bin/llvm-gcc-4.2 accepts -g... yes
checking for /Developer/usr/bin/llvm-gcc-4.2 option to accept ISO C89... none needed
checking dependency style of /Developer/usr/bin/llvm-gcc-4.2... gcc3
checking how to run the C preprocessor... /Developer/usr/bin/llvm-gcc-4.2 -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for gcc... (cached) /Developer/usr/bin/llvm-gcc-4.2
checking whether we are using the GNU C compiler... (cached) yes
checking whether /Developer/usr/bin/llvm-gcc-4.2 accepts -g... (cached) yes
checking for /Developer/usr/bin/llvm-gcc-4.2 option to accept ISO C89... (cached) none needed
checking dependency style of /Developer/usr/bin/llvm-gcc-4.2... (cached) gcc3
checking build system type... x86_64-apple-darwin11.0.0
checking host system type... x86_64-apple-darwin11.0.0
checking for a sed that does not truncate output... /usr/bin/sed
checking for fgrep... /usr/bin/grep -F
checking for ld used by /Developer/usr/bin/llvm-gcc-4.2... /Developer/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld
checking if the linker (/Developer/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm
checking the name lister (/usr/bin/nm) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 196608
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /Developer/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld option to reload object files... -r
checking for objdump... no
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm output from /Developer/usr/bin/llvm-gcc-4.2 object... ok
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for lipo... lipo
checking for otool... otool
checking for otool64... no
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if /Developer/usr/bin/llvm-gcc-4.2 supports -fno-rtti -fno-exceptions... no
checking for /Developer/usr/bin/llvm-gcc-4.2 option to produce PIC... -fno-common -DPIC
checking if /Developer/usr/bin/llvm-gcc-4.2 PIC flag -fno-common -DPIC works... yes
checking if /Developer/usr/bin/llvm-gcc-4.2 static flag -static works... no
checking if /Developer/usr/bin/llvm-gcc-4.2 supports -c -o file.o... yes
checking if /Developer/usr/bin/llvm-gcc-4.2 supports -c -o file.o... (cached) yes
checking whether the /Developer/usr/bin/llvm-gcc-4.2 linker (/Developer/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin11.0.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking whether ln -s works... yes
checking for pthread_create in -lpthread... yes
checking for JS_NewContext in -lmozjs... no
checking for JS_NewContext in -ljs... yes
checking jsapi.h usability... yes
checking jsapi.h presence... yes
checking for jsapi.h... yes
checking for icu-config... /opt/local/bin/icu-config
checking for ICU >= 3.4.1... yes
checking ICU_CFLAGS... -pipe -O2 -arch x86_64 -O2 -Wall -ansi -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Wno-long-long   
checking ICU_CXXFLAGS... -pipe -O2 -arch x86_64 -O2 -W -Wall -ansi -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long   
checking ICU_LIBS... -arch x86_64  -lpthread -lm   -L/opt/local/lib -licui18n -licuuc -licudata  -lpthread -lm   
checking for curl-config... /opt/local/bin/curl-config
checking for curl >= 7.18.0... yes
checking CURL_CFLAGS... -I/opt/local/include
checking CURL_LIBS... -L/opt/local/lib -lcurl -L/opt/local/lib -L/opt/local/lib -L/opt/local/lib -lidn -lssl -lcrypto -lssl -lcrypto -lz -lz
checking for erl... /opt/local/bin/erl
configure: error: Could not find the Erlang crypto library. Has Erlang been compiled with OpenSSL support?
shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_databases_couchdb/couchdb/work/apache-couchdb-1.1.0" && ./configure --prefix=/opt/local --with-js-include=/opt/local/include/js --with-erlang=/opt/local/lib/erlang/usr/include " returned error 1
Error: Target org.macports.configure returned: configure failure: shell command failed (see log for details)
Warning: the following items did not execute (for couchdb): org.macports.activate org.macports.configure org.macports.build org.macports.destroot org.macports.install
Log for couchdb is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_databases_couchdb/couchdb/main.log
Error: Status 1 encountered during processing.

Change History (22)

comment:1 Changed 13 years ago by mf2k (Frank Schima)

Owner: changed from macports-tickets@… to jwa@…

comment:2 Changed 13 years ago by jyrkiwahlstedt

Resolution: wontfix
Status: newclosed

Erlang port now has the ssl support as a default, so nothing to do here. And 10.7 is not yet in the public...

comment:3 Changed 13 years ago by hypertornado@…

Resolution: wontfix
Status: closedreopened

10.7 is now in public, so what should i do to fix this error?

comment:4 Changed 13 years ago by bfulgham@…

I've just updated to Lion, and am attempting the build now.

comment:5 Changed 13 years ago by bfulgham@…

This works properly for me. Can you provide a new error message after getting a successful erlang build under 10.7?

comment:6 Changed 13 years ago by jyrkiwahlstedt

Resolution: invalid
Status: reopenedclosed

Ok, this is an erlang thing that is fixed, so I'll leave it at that…

comment:7 Changed 13 years ago by paul@…

Resolution: invalid
Status: closedreopened

Hey all, sorry to be a pain, but I'm still butting against this issue. It's odd, as I'm running the new version of Erlang (referenced in ticket #30012). Basically, CouchDB refuses to compile, barfing out with the following message:

:info:configure checking CURL_LIBS... -L/opt/local/lib -lcurl -L/opt/local/lib -L/opt/local/lib -L/opt/local/lib -lidn -lssl -lcrypto -lssl -lcrypto -lz -lz
:info:configure checking for erl... /opt/local/bin/erl
:info:configure configure: error: Could not find the Erlang crypto library. Has Erlang been compiled with OpenSSL support?
:info:configure shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_databases_couchdb/couchdb/work/apache-couchdb-1.1.0" && ./configure --prefix=/opt/local --with-js-include=/opt/local/include/js --with-erlang=/opt/local/lib/erlang/usr/include " returned error 1

The funny thing is, if I cd to the working directory, and run

./configure --prefix=/opt/local --with-js-include=/opt/local/include/js --with-erlang=/opt/local/lib/erlang/usr/include

It compiles cleanly, and the resulting binary works as expected. Any ideas on what may be going on here?

comment:8 Changed 13 years ago by conradwt (Conrad Taylor)

The couchdb port now installs for me without any issues using the standard build process (i.e. sudo port install couched).

comment:9 Changed 13 years ago by conradwt (Conrad Taylor)

Correction: (i.e. sudo port install couchdb)

comment:10 Changed 13 years ago by jmroot (Joshua Root)

Cc: paul@… added

Please cc yourself when you reopen.

comment:11 Changed 13 years ago by jmroot (Joshua Root)

paul@: Is erlang installed with +ssl? Check with

port installed erlang

It's a default variant but it can be turned off.

comment:12 Changed 13 years ago by paul@…

Thanks for the note about CCing. Erlang is definitely compiled with SSL, and couchdb will compile cleanly when run directly:

WC-MacBook ~ $ port list variant:ssl | grep erlang
erlang                         @R14B03         lang/erlang

Any chance it could be a shell issue; some permissions than an user's interactive shell would have that a subshell wouldn't?

comment:13 Changed 13 years ago by joh.dokler@…

The configure for the couchdb is run as a macports user. When checking for the ssl library using:

has_crypto=`${ERL} -eval "case application:load(crypto) of ok -> ok; _ -> exit(no_crypto) end." -noshell -s init stop`

the erl returns the following error:

=ERROR REPORT==== 13-Aug-2011::13:58:20 === file:path_eval([".","/var/root"],".erlang"): permission denied

Which indicates that the erl tries to eval the .erlang init file inside /var/root. Which is of course is inaccessible to the macports user.

comment:14 Changed 13 years ago by joh.dokler@…

Cc: joh.dokler@… added

Cc Me!

comment:15 Changed 13 years ago by joh.dokler@…

Cc: joh.dokler@… removed

Cc Me!

comment:16 Changed 13 years ago by joh.dokler@…

Cc: joh.dokler@… added

Cc Me!

comment:17 Changed 13 years ago by paul@…

Yeap, that's the ticket. I manually futzed with the Portfile, and removed the check for Erlang's crpyto library:

sudo vi /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_databases_couchdb/couchdb/work/apache-couchdb-1.1.0/configure

And just deleted the following code block:

has_crypto=`${ERL} -eval "case application:load(crypto) of ok -> ok; _ -> exit(no_crypto) end." -noshell -s init stop`

if test -n "$has_crypto"; then
    as_fn_error $? "Could not find the Erlang crypto library. Has Erlang been compiled with OpenSSL support?" "$LINENO" 5
fi

Now, this doesn't actually fix the bloody problem, but it bypasses the test for the Erlang crypto library, which is included by default in the Macports Erlang port, and allows the build to go forward.

comment:18 in reply to:  12 Changed 13 years ago by jmroot (Joshua Root)

Replying to paul@…:

port list variant:ssl | grep erlang

JFYI, that only tells you that erlang has an ssl variant, not that it is selected in the installed port.

comment:19 Changed 13 years ago by bfulgham@…

Owner: changed from jwa@… to bfulgham@…
Status: reopenednew

Couchdb builds and runs find for me R14B04 erlang. Erlang always builds with +ssl now, so I don't think you should be having any problems.

comment:20 Changed 12 years ago by dougie.richardson@…

I ran into the same problem on Snow Leopard and deleting the block paul mentioned did the trick.

comment:22 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: jwa@… ryandesign@… added
Keywords: x86_64 removed
Resolution: fixed
Status: newclosed
Summary: couchdb failed because erlang missing openssl supportcouchdb: configure fails claiming erlang is missing openssl support

I can't figure out how to reproduce the issue on my system, though I feel like I understand the problem, and feel like I should be experiencing it.

I've changed the port in r87246 to check for erlang +ssl in the portfile, so we can fail early with a nicer error message, and in r87247 I removed the same check from the configure script. This seems to have fixed the buildbot, though the pre-configure check still prints this warning:

file:path_eval([".","/var/root"],".erlang"): permission denied

I'm not sure if this means the check was done or not. So in r87248 I changed it further to set HOME to a value inside workpath, which should not have any permissions problems. See also #31827. But of course the buildbot isn't building it again now

Building couchdb (1 of 1)...package found, not building again

So I have to just assume I fixed this.

Note: See TracTickets for help on using tickets.