Couchdb: Couchdb build issue with Ubuntu 18.04

Created on 7 May 2018  路  11Comments  路  Source: apache/couchdb

Environment

  • Version used: 2.1.1
  • Operating System and version (desktop or mobile): Ubuntu 18.04

Trying to build Couchdb v2.1.1 from source on Ubuntu 18.04.
Followed the steps provided in http://docs.couchdb.org/en/2.1.1/install/unix.html#installation-from-source

One of the dependency to build couchdb is libmozjs185 which is not found on Ub18.04. So tried to build it from source using steps:

wget http://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz
tar zxf js185-1.0.0.tar.gz 
cd js-1.8.5/js/src
autoconf2.13
mkdir -p build_OPT.OBJ
cd build_OPT.OBJ
../configure --prefix=/usr
 make

However, make is failing with

../jsapi.cpp: In function 'JSIdArray* JS_Enumerate(JSContext*, JSObject*)':
../jsapi.cpp:3988:16: error: cannot convert 'bool' to 'JSIdArray*' in return
         return false;
                ^~~~~
../config/rules.mk:1475: recipe for target 'jsapi.o' failed

Any suggestions on how to resolve the failure?

build

All 11 comments

Any suggestion to resolve this failure?

The next build of CouchDB will include pre-built libmozjs185 binaries for all supported Ubuntu, Debian, CentOS and RedHad platforms. The build instructions for those builds will be made public.

Strictly speaking this is not a CouchDB issue, but since the dependency is very old and we're one of the few remaining applications that need it, we'll help out here.

Our apache/couchdb-pkg repo now has support to build SM 1.8.5 for all supported Debian and Ubuntu platforms: debian jessie / stretch and ubuntu trusty / xenial / bionic. Support is on the way for CentOS/RHEL 6 and 7.

If you have the necessary prerequisites installed, make couch-js-debs PLATFORM=bionic will build you couch-libmozjs185-1.0 and couch-libmozjs185-dev packages suitable for installing.

We'll be transitioning the couchdb package to depend on these new packages instead of the OS-provided ones with the next binary release.

Hi @wohali,

I followed guidelines in https://github.com/apache/couchdb-pkg. Still it's failing while Lookout for jsapi.h while executing
"""$ cd couchdb-pkg && make build-couch $(lsb_release -cs) PLATFORM=$(lsb_release -cs)"""
in Ubuntu 18.04.
Also I feel the documentation on quickstart should start with
1.cloning of couchdb-pkg repo https://github.com/apache/couchdb-pkg

  1. Cloning of https://github.com/apache/couchdb
  2. Configuring of couchdb clone ./configure - c
  3. cd couchdb-pkg && make build-couch $(lsb_release -cs) PLATFORM=$(lsb_release -cs)
    Since I received error of jsapi.h again because couchdb-libmozjs185-1.0 is still not formed and installed and rebarconfig script CFLAG location not yet changed pointing to location of jsapi.h,

So I tried your suggestion for building couchdb supplied ibmozjs185 using command

make couch-js-debs PLATFORM=bionic

This executed successfully and couch-libmozjs185-1.0 and couch-libmozjs185-dev were created.
But I was not able to install them using dpkg or sudo apt-get install command.
Please kindly help on getting this built libmozjs185 installed. Please share how do I install them.
Also could you please help raise PR for the same.
Thanks a lot in advance.

If you're building yourself entirely from scratch, you'll have to create your own repo and install the couch-libmozjs185-dev and -1.0 packages yourself. Under 18.04 you should be able to use the command apt install ./path/to/file1.dpkg ./path/to/file2.dpkg without the repo, but it's recommended to create your own repo.

These packages must be built and installed before building the Couch packages, as they are dependencies of the build process.

No PR is pending for this work - we've published the scripts we use, and we've also published convenience binary packages for your use, which is documented in the usual place (docs.couchdb.org). Is there a reason the couch-libmozjs185-* packages we built and published for 18.04 are not acceptable to use?

Thanks a lot @wohali
Thanks for publishing convenience binary package, which I was able to install to ubuntu 18.04. Earlier I was unable to install with convenience binary package for Ubuntu 18.04
So I tried to build couchdb from source, but failed for jsapi.h lookout
Then I found this thread where you had mentioned to use couchdb-pkg and built the libmozjs185 supplied along with couchdb-pkg repo. I was stuck after the step "make couch-js-debs PLATFORM=bionic".
I will try to install couchdb supplied couch-libmozjs185-* and let you know the result.
Thank you.

Hi @wohali
I was able to install couch-libmozjs185-.deb file formed under couchdb-pkg/js folder using your suggested query:
sudo apt install /pathtodeb package/couch-libmozjs185-
.deb

Thank you.

Hi @asterisks007,
I am trying to prepare installation of CouchDB 1.7.2 on Ubuntu 18.04 bionic and get
Building dependency tree Reading state information... Done E: Unable to locate package libmozjs185-dev
on my AMI
Installing Ubuntu on a MacBook Air both, ibmozjs185-dev and libcurl4-openssl-dev are missing.

Could you share in detail how you succeeded following the advice of @wohali?

@johs Please find attached steps which I followed.
Thank you.
Preparing couchdb-libmozjs1.8.5 for installation.zip

@asterisks007 thanks so very much for this! Exactly what I needed. We installed successfully on Ubuntu Bionic on a nano AWS instance twice to verify.

On 11/20/2019, I am hitting this issue with Ubuntu 18.04.3 LTS. Thank you all who helped create a workaround for this issue. @asterisks007 I followed your tutorial, thank you for making it.

I just wanted to add, when running make couch-js-debs PLATFORM=bionic, I initially got an error dpkg-checkbuilddeps: error: Unmet build dependencies: debhelper (>= 7.0.50~) libffi-dev libnspr4-dev (>= 4.7.0) pkg-kde-tools python autotools-dev.

I found running sudo apt install debhelper聽libffi-dev聽libnspr4-dev聽pkg-kde-tools python enabled me to successfully run make couch-js-debs PLATFORM=bionic.

Was this page helpful?
0 / 5 - 0 ratings