summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Shorin <kxepal@apache.org>2015-11-12 02:03:42 +0300
committerAlexander Shorin <kxepal@apache.org>2015-11-12 02:03:42 +0300
commitbd19653c6e588ccb647f955d52524bda90d61efb (patch)
tree38ccebc0e55eafe8656a84012c5d85b72c0230bc
parent805a427b05472c4eb0b062b6e4b3ed1944a9ec19 (diff)
parent486181f87b4150c3cf2c31dd5045d4f1010ec643 (diff)
downloadcouchdb-bd19653c6e588ccb647f955d52524bda90d61efb.tar.gz
Merge branch 'master' into 2876-js-tests
-rw-r--r--.gitignore1
-rw-r--r--.travis.yml11
-rw-r--r--INSTALL.Unix.md4
-rw-r--r--INSTALL.Windows.md2
-rw-r--r--LICENSE24
-rw-r--r--Makefile308
-rw-r--r--NOTICE6
-rw-r--r--README-DEV.md190
-rw-r--r--README-DEV.rst247
-rwxr-xr-xbuild-aux/couchdb-build-release.sh9
-rwxr-xr-xconfigure18
-rwxr-xr-xdev/run21
-rw-r--r--rebar.config.script39
-rw-r--r--rel/files/eunit.config32
-rw-r--r--rel/files/sys.config2
-rw-r--r--rel/overlay/etc/default.ini5
-rwxr-xr-xrun-tests.sh9
17 files changed, 608 insertions, 320 deletions
diff --git a/.gitignore b/.gitignore
index b92f07622..77ae5209f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,5 +28,6 @@ src/couch/priv/couch_js/config.h
src/couch/priv/couchjs
src/couch/priv/couchspawnkillable
+.rebar
bin/
apache-couchdb-*/
diff --git a/.travis.yml b/.travis.yml
index 08ad9090b..f0f7126c4 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,15 +1,14 @@
before_install:
- sudo apt-get -y update
- - sudo apt-get -y install libicu-dev libmozjs-dev pkg-config help2man libcurl4-openssl-dev
+ - sudo apt-get -y install libicu-dev libmozjs185-dev pkg-config help2man libcurl4-openssl-dev
- sudo apt-get -y install libtool automake autoconf autoconf-archive
- - sudo apt-get -y install texlive-latex-base texlive-latex-recommended
- - sudo apt-get -y install texlive-latex-extra texlive-fonts-recommended texinfo
- - sudo apt-get -y install python-pygments python-docutils python-sphinx
-before_script: ./configure -c --disable-docs
+ - sudo apt-get -y install shunit2
+before_script: ./configure -c --disable-docs --disable-fauxton
script:
- - ./run-tests.sh
+ - make check
language: erlang
otp_release:
+ - 18.1
- 18.0
- 17.5
- R16B03-1
diff --git a/INSTALL.Unix.md b/INSTALL.Unix.md
index aa3817483..c6de87ad5 100644
--- a/INSTALL.Unix.md
+++ b/INSTALL.Unix.md
@@ -39,7 +39,7 @@ Dependencies
You should have the following installed:
- * Erlang OTP (>=R14B01, =<R17) (http://erlang.org/)
+ * Erlang OTP (>=R16B03-1, =<18.1) (http://erlang.org/)
* ICU (http://icu-project.org/)
* OpenSSL (http://www.openssl.org/)
* Mozilla SpiderMonkey (1.8.5) (http://www.mozilla.org/js/spidermonkey/)
@@ -50,7 +50,7 @@ You should have the following installed:
* Python (>=2.7) for docs (http://python.org/)
* Python Sphinx (>=1.1.3) (http://pypi.python.org/pypi/Sphinx)
-It is recommended that you install Erlang OTP R13B-4 or above where
+It is recommended that you install Erlang OTP R16B03-1 or above where
possible. You will only need libcurl if you plan to run the
JavaScript test suite. And help2man is only need if you plan on
installing the CouchDB man pages. Python and Sphinx are only required
diff --git a/INSTALL.Windows.md b/INSTALL.Windows.md
index 29c69b051..7622eac03 100644
--- a/INSTALL.Windows.md
+++ b/INSTALL.Windows.md
@@ -29,7 +29,7 @@ Dependencies
You will need the following installed:
- * Erlang OTP (>=14B01, <R17) (http://erlang.org/)
+ * Erlang OTP (>=R16B03-1, =<18.1) (http://erlang.org/)
* ICU (>=4.*) (http://icu-project.org/)
* OpenSSL (>=0.9.8r) (http://www.openssl.org/)
* Mozilla SpiderMonkey (=1.8.5) (http://www.mozilla.org/js/spidermonkey/)
diff --git a/LICENSE b/LICENSE
index 2deab427a..6ad7e26f3 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1408,3 +1408,27 @@ for src/fauxton/assets/js/libs/papaparse.js
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+for src/fauxton/assets/js/libs/react-bootstrap.js
+
+ The MIT License (MIT)
+
+ Copyright (c) 2014 Stephen J. Collings, Matthew Honnibal, Pieter Vanderwerff
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
diff --git a/Makefile b/Makefile
index 79b717a56..614280ce6 100644
--- a/Makefile
+++ b/Makefile
@@ -19,34 +19,188 @@ COUCHDB_VERSION = $(vsn_major).$(vsn_minor).$(vsn_patch)$(COUCHDB_VERSION_SUFFIX
DESTDIR=
+# Rebar options
+apps=
+skip_deps=folsom,lager,meck,mochiweb,proper,snappy
+suites=
+tests=
+
+EUNIT_OPTS=$(shell echo "\
+ apps=$(apps) \
+ skip_deps=$(skip_deps) \
+ suites=$(suites) \
+ tests=$(tests) \
+ " | sed -e 's/[a-z]\+= / /g')
+DIALYZE_OPTS=$(shell echo "\
+ apps=$(apps) \
+ skip_deps=$(skip_deps) \
+ " | sed -e 's/[a-z]\+= / /g')
+
+
+################################################################################
+# Main commands
+################################################################################
+
+
+.PHONY: all
+# target: all - Build everything
all: couch fauxton docs
-config.erl:
- @echo "Apache CouchDB has not been configured."
- @echo "Try \"./configure -h\" for help."
- @echo
- @false
+.PHONY: help
+# target: help - Print this help
+help:
+ @egrep "^# target: " Makefile \
+ | sed -e 's/^# target: //g' \
+ | sort \
+ | awk '{printf(" %-20s", $$1); $$1=$$2=""; print "-" $$0}'
+
+
+################################################################################
+# Building
+################################################################################
+
+
+.PHONY: couch
+# target: couch - Build CouchDB core
couch: config.erl
- @${REBAR} compile
+ @$(REBAR) compile
@cp src/couch/priv/couchjs bin/
-clean:
- @${REBAR} -r clean
- @rm -f bin/couchjs
- @rm -rf src/*/ebin
- @rm -rf src/*/.rebar
- @rm -rf src/*/priv/*.so
- @rm -rf src/couch/priv/{couchspawnkillable,couchjs}
- @rm -rf share/server/main.js share/server/main-coffee.js
- @rm -rf tmp dev/data dev/lib dev/logs
- @rm -f src/couch/priv/couchspawnkillable
- @rm -f src/couch/priv/couch_js/config.h
- @rm -f dev/boot_node.beam dev/pbkdf2.pyc log/crash.log
-check: javascript eunit build-test
+.PHONY: docs
+# target: docs - Build documentation
+docs: src/docs/build
+
+
+.PHONY: fauxton
+# target: fauxton - Build Fauxton web UI
+fauxton: share/www
+
+
+################################################################################
+# Testing
+################################################################################
+
+
+.PHONY: check
+# target: check - Test everything
+check:
+ @$(MAKE) eunit
+ @$(MAKE) javascript
+ @$(MAKE) build-test
+
+
+.PHONY: eunit
+# target: eunit - Run EUnit tests, use EUNIT_OPTS to provide custom options
+eunit: export BUILDDIR = $(shell pwd)
+eunit: export ERL_AFLAGS = -config $(shell pwd)/rel/files/eunit.config
+eunit: couch
+ @$(REBAR) setup_eunit 2> /dev/null
+ @$(REBAR) -r eunit $(EUNIT_OPTS)
+
+
+.PHONY: javascript
+# target: javascript - Run JavaScript test suites or specific ones defined by suites option
+javascript: all
+ @mkdir -p share/www/test
+ifeq ($(IN_RELEASE), true)
+ @cp test/javascript/tests/lorem*.txt share/www/test/
+else
+ # FIXME: strange path ahead!
+ @mkdir -p src/fauxton/dist/release/test
+ @cp test/javascript/tests/lorem*.txt src/fauxton/dist/release/test/
+endif
+ # 2 remedy problems w/ "internal server error" remove dev/lib
+ @dev/run -q --with-admin-party-please test/javascript/run
+ @rm -rf share/www/script
+
+
+.PHONY: list-eunit-apps
+# target: list-eunit-apps - List EUnit target apps
+list-eunit-apps:
+ @find ./src/ -type f -name *_test.erl -o -name *_tests.erl \
+ | cut -d '/' -f 3 \
+ | sort -u
+
+
+.PHONY: list-eunit-suites
+# target: list-eunit-suites - List EUnit target test suites
+list-eunit-suites:
+ @find ./src/ -type f -name *_test.erl -o -name *_tests.erl -printf "%f\n" \
+ | cut -d '.' -f -1 \
+ | sort
+
+
+.PHONY: list-js-suites
+# target: list-js-suites - List JavaScript test suites
+list-js-suites:
+ @find ./test/javascript/tests/ -type f -name *.js -printf "%f\n" \
+ | cut -d '.' -f -1 \
+ | sort
+
+
+.PHONY: build-test
+# target: build-test - Test build script
+build-test:
+ @test/build/test-configure.sh
+
+
+################################################################################
+# Developing
+################################################################################
+
+
+.PHONY: build-plt
+# target: build-plt - Build project-specific PLT
+build-plt:
+ @$(REBAR) -r build-plt $(DIALYZE_OPTS)
+
+
+.PHONY: check-plt
+# target: check-plt - Check the PLT for consistency and rebuild it if it is not up-to-date
+check-plt:
+ @$(REBAR) -r check-plt $(DIALYZE_OPTS)
+
+
+.PHONY: dialyze
+# target: dialyze - Analyze the code for discrepancies
+dialyze: .rebar
+ @$(REBAR) -r dialyze $(DIALYZE_OPTS)
+
+
+.PHONY: docker-image
+# target: docker-image - Build Docker image
+docker-image:
+ @docker build --rm -t couchdb/dev-cluster .
+
+
+.PHONY: docker-start
+# target: docker-start - Start CouchDB in Docker container
+docker-start:
+ @docker run -d -P -t couchdb/dev-cluster > .docker-id
+
+
+.PHONY: docker-stop
+# target: docker-stop - Stop Docker container
+docker-stop:
+ @docker stop `cat .docker-id`
+
+
+.PHONY: introspect
+# target: introspect - Check for commits difference between rebar.config and repository
+introspect:
+ @$(REBAR) -r update-deps
+ @./introspect
+
+
+################################################################################
+# Distributing
+################################################################################
-# creates a full erlang release
+
+.PHONY: dist
+# target: dist - Make release tarball
dist: all
@./build-aux/couchdb-build-release.sh $(COUCHDB_VERSION)
@@ -61,30 +215,17 @@ dist: all
@mkdir -p apache-couchdb-$(COUCHDB_VERSION)/share/docs/info
@cp src/docs/build/texinfo/CouchDB.info apache-couchdb-$(COUCHDB_VERSION)/share/docs/info/
-# Tar!
@tar czf apache-couchdb-$(COUCHDB_VERSION).tar.gz apache-couchdb-$(COUCHDB_VERSION)
@echo "Done: apache-couchdb-$(COUCHDB_VERSION).tar.gz"
-distclean: clean
- @rm -f install.mk
- @rm -f config.erl
- @rm -f rel/couchdb.config
-ifneq ($(IN_RELEASE), true)
-# when we are in a release, don’t delete the
-# copied sources, generated docs, or fauxton
- @rm -rf rel/couchdb
- @rm -rf share/www
- @rm -rf src/docs
-endif
-
-devclean:
- @rm -rf dev/lib/*/data
+.PHONY: install
+# target: install - Install CouchDB :-)
-include install.mk
install: all
@echo "Installing CouchDB into $(DESTDIR)/$(install_dir)..." | sed -e 's,///,/,'
@rm -rf rel/couchdb
- @${REBAR} generate # make full erlang release
+ @$(REBAR) generate # make full erlang release
@mkdir -p $(DESTDIR)/$(install_dir)
@cp -R rel/couchdb/* $(DESTDIR)/$(install_dir)
@@ -125,6 +266,52 @@ install: all
@echo "...done"
+
+################################################################################
+# Cleaning
+################################################################################
+
+
+.PHONY: clean
+# target: clean - Remove build artifacts
+clean:
+ @$(REBAR) -r clean
+ @rm -rf .rebar/
+ @rm -f bin/couchjs
+ @rm -rf src/*/ebin
+ @rm -rf src/*/.rebar
+ @rm -rf src/*/priv/*.so
+ @rm -rf src/couch/priv/{couchspawnkillable,couchjs}
+ @rm -rf share/server/main.js share/server/main-coffee.js
+ @rm -rf tmp dev/data dev/lib dev/logs
+ @rm -f src/couch/priv/couchspawnkillable
+ @rm -f src/couch/priv/couch_js/config.h
+ @rm -f dev/boot_node.beam dev/pbkdf2.pyc log/crash.log
+
+
+.PHONY: distclean
+# target: distclean - Remove build and release artifacts
+distclean: clean
+ @rm -f install.mk
+ @rm -f config.erl
+ @rm -f rel/couchdb.config
+ifneq ($(IN_RELEASE), true)
+# when we are in a release, don’t delete the
+# copied sources, generated docs, or fauxton
+ @rm -rf rel/couchdb
+ @rm -rf share/www
+ @rm -rf src/docs
+endif
+
+
+.PHONY: devclean
+# target: devclean - Remove dev cluster artifacts
+devclean:
+ @rm -rf dev/lib/*/data
+
+
+.PHONY: uninstall
+# target: uninstall - Uninstall CouchDB :-(
uninstall:
@rm -rf $(DESTDIR)/$(install_dir)
@rm -f $(DESTDIR)/$(bin_dir)/couchdb
@@ -137,61 +324,30 @@ uninstall:
@rm -rf $(DESTDIR)/$(man_dir)
@rm -rf $(DESTDIR)/$(info_dir)
-install.mk:
-# ignore install.mk missing if we are running
-# `make clean` without having run ./configure first
-ifneq ($(MAKECMDGOALS), clean)
- @echo "No install.mk found. Run ./configure"
- @exit 1
-endif
-
-docker-image:
- @docker build --rm -t couchdb/dev-cluster .
-docker-start:
- @docker run -d -P -t couchdb/dev-cluster > .docker-id
+################################################################################
+# Misc
+################################################################################
-docker-stop:
- @docker stop `cat .docker-id`
-eunit: export BUILDDIR = $(shell pwd)
-eunit: couch
- @${REBAR} setup_eunit
- @${REBAR} -r eunit skip_deps=meck,mochiweb,lager,snappy,folsom
+.rebar: build-plt
-javascript: all
- @mkdir -p share/www/test
-ifeq ($(IN_RELEASE), true)
- @cp test/javascript/tests/lorem*.txt share/www/test/
-else
- @mkdir -p src/fauxton/dist/release/test
- @cp test/javascript/tests/lorem*.txt src/fauxton/dist/release/test/
-endif
- # 2 remedy problems w/ "internal server error" remove dev/lib
- @dev/run -q --with-admin-party-please test/javascript/run
- @rm -rf share/www/script
-build-test:
- @test/build/test-configure.sh
+config.erl:
+ @echo "Apache CouchDB has not been configured."
+ @echo "Try \"./configure -h\" for help."
+ @echo
+ @false
-# build docs
-docs: src/docs/build
src/docs/build:
ifeq ($(with_docs), 1)
@cd src/docs; $(MAKE)
endif
-# build fauxton
-fauxton: share/www
share/www:
ifeq ($(with_fauxton), 1)
@echo "Building Fauxton"
@cd src/fauxton && npm install && ./node_modules/grunt-cli/bin/grunt couchdb
endif
-
-.PHONY: introspect
-introspect:
- ${REBAR} -r update-deps
- ./introspect
diff --git a/NOTICE b/NOTICE
index ea5eb56c0..978ee6e69 100644
--- a/NOTICE
+++ b/NOTICE
@@ -190,6 +190,10 @@ This product also includes the following third-party components:
Copyright Mathias Bynens
-* Papaparse.js
+* Papaparse.js
Copyright (c) 2015 Matthew Holt
+
+* react-bootstrap.js
+
+ Copyright (c) 2014 Stephen J. Collings, Matthew Honnibal, Pieter Vanderwerff
diff --git a/README-DEV.md b/README-DEV.md
deleted file mode 100644
index 81cfc4a7d..000000000
--- a/README-DEV.md
+++ /dev/null
@@ -1,190 +0,0 @@
-Apache CouchDB DEVELOPERS
-=========================
-
-Before you start here, read `INSTALL.Unix` (or `INSTALL.Windows`) and
-follow the setup instructions including the installation of all the
-listed dependencies for your system.
-
-Only follow these instructions if you are building from a source checkout.
-
-If you're unsure what this means, ignore this document.
-
-Dependencies
-------------
-
-You may need:
-
- * Sphinx (http://sphinx.pocoo.org/)
- * LaTex (http://www.latex-project.org/)
- * GNU Texinfo (http://www.gnu.org/software/texinfo/)
- * GNU help2man (http://www.gnu.org/software/help2man/)
- * GnuPG (http://www.gnupg.org/)
- * md5sum (http://www.microbrew.org/tools/md5sha1sum/)
- * sha1sum (http://www.microbrew.org/tools/md5sha1sum/)
-
-The first of these optional dependencies are required for building the
-documentation. The last three are needed to build releases.
-
-You will need these optional dependencies installed if:
-
- * You are working on the documentation, or
- * You are preparing a distribution archive
-
-However, you do not need them if:
-
- * You are building from a distribution archive, or
- * You don't care about building the documentation
-
-If you intend to build Fauxton, you will also need to install its
-dependencies. After running ./configure to download all of the
-dependent repositories, you can read about required dependencies in
-`src/fauxton/readme.md`. Typically, installing npm and node.js are
-sufficient to enable a Fauxton build.
-
-Here is a list of *optional* dependencies for various operating systems.
-Installation will be easiest, when you install them all.
-
-Debian-based (inc. Ubuntu) Systems
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- sudo apt-get install help2man python-sphinx \
- texlive-latex-base texlive-latex-recommended \
- texlive-latex-extra texlive-fonts-recommended texinfo gnupg
-
-Gentoo-based Systems
-~~~~~~~~~~~~~~~~~~~~
-
- sudo emerge texinfo gnupg coreutils pkgconfig help2man
- sudo USE=latex emerge sphinx
-
-RedHat-based (Fedora, Centos, RHEL) Systems
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- sudo yum install help2man python-sphinx python-docutils \
- python-pygments texlive-latex texlive-latex-fonts texinfo gnupg
-
-Mac OS X
-~~~~~~~~
-
-Install Homebrew, if you do not have it already:
-
- https://github.com/mxcl/homebrew
-
-Unless you want to install the optional dependencies, skip to the next section.
-
-Install what else we can with Homebrew:
-
- brew install help2man gnupg md5sha1sum
-
-If you don't already have pip installed, install it:
-
- sudo easy_install pip
-
-Now, install the required Python packages:
-
- sudo pip install sphinx
- sudo pip install docutils
- sudo pip install pygments
-
-Download MaxTeX from here:
-
- http://www.tug.org/mactex/
-
-Follow the instructions to get a working LaTeX install on your system.
-
-FreeBSD
--------
-
-
- pkg install help2man texinfo gnupg py27-sphinx texlive-full tex-formats
-
-Windows
-~~~~~~~
-
-Follow the instructions in INSTALL.Windows and build all components from
-source, using the same Visual C++ compiler and runtime.
-
-Configuring
------------
-
-Configure the source by running:
-
- ./configure
-
-If you intend to run the test suites:
-
- ./configure -c
-
-If you want to build it into different destination than `/usr/local`.
-
- ./configure --prefix=/<your directory path>
-
-Testing
--------
-
-Check the test suite by running:
-
- make check
-
-Generate a coverage report by running:
-
- make cover
-
-Please report any problems to the developer's mailing list.
-
-Testing a cluster
------------------
-
-We use Docker (https://docker.io) to safely run a local three node
-cluster all inside a single docker container.
-
-Assuming you have Docker installed and running:
-
- make docker-image
-
-This will create a docker image (tagged 'couchdb/dev-cluster') capable
-of running a joined three node cluster.
-
-To start it up:
-
- make docker-start
-
-A three node cluster should now be running (you can now use `docker ps`
-to find the exposed ports of the nodes).
-
-To stop it:
-
- make docker-stop
-
-Releasing
----------
-
-The release procedure is documented here:
-
- https://wiki.apache.org/couchdb/Release_Procedure
-
-Unix-like Systems
-~~~~~~~~~~~~~~~~~
-
-Prepare the release artefacts by running:
-
- make distcheck
-
-You can prepare signed release artefacts by running:
-
- make distsign
-
-The release artefacts can be found in the root source directory.
-
-Microsoft Windows
-~~~~~~~~~~~~~~~~~
-
-Prepare the release artefacts by running:
-
- make dist
-
-The release artefacts can be found in the `etc/windows` directory.
-
-Until the build system has been improved, you must make sure that you run this
-command from a clean source checkout. If you do not, your test database and log
-files will be bundled up in the release artefact.
diff --git a/README-DEV.rst b/README-DEV.rst
new file mode 100644
index 000000000..123568913
--- /dev/null
+++ b/README-DEV.rst
@@ -0,0 +1,247 @@
+Apache CouchDB DEVELOPERS
+=========================
+
+Before you start here, read `INSTALL.Unix` (or `INSTALL.Windows`) and
+follow the setup instructions including the installation of all the
+listed dependencies for your system.
+
+Only follow these instructions if you are building from a source checkout.
+
+If you're unsure what this means, ignore this document.
+
+Dependencies
+------------
+
+You may need:
+
+* `Sphinx <http://sphinx.pocoo.org/>`_
+* `LaTex <http://www.latex-project.org/>`_
+* `GNU Texinfo <http://www.gnu.org/software/texinfo/>`_
+* `GNU help2man <http://www.gnu.org/software/help2man/>`_
+* `GnuPG <http://www.gnupg.org/>`_
+* `md5sum <http://www.microbrew.org/tools/md5sha1sum/>`_
+* `sha1sum <http://www.microbrew.org/tools/md5sha1sum/>`_
+
+The first of these optional dependencies are required for building the
+documentation. The last three are needed to build releases.
+
+You will need these optional dependencies installed if:
+
+* You are working on the documentation, or
+* You are preparing a distribution archive
+
+However, you do not need them if:
+
+* You are building from a distribution archive, or
+* You don't care about building the documentation
+
+If you intend to build Fauxton, you will also need to install its
+dependencies. After running ./configure to download all of the
+dependent repositories, you can read about required dependencies in
+`src/fauxton/readme.md`. Typically, installing npm and node.js are
+sufficient to enable a Fauxton build.
+
+Here is a list of *optional* dependencies for various operating systems.
+Installation will be easiest, when you install them all.
+
+Debian-based (inc. Ubuntu) Systems
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+::
+
+ sudo apt-get install help2man python-sphinx \
+ texlive-latex-base texlive-latex-recommended \
+ texlive-latex-extra texlive-fonts-recommended texinfo gnupg
+
+Gentoo-based Systems
+~~~~~~~~~~~~~~~~~~~~
+
+::
+
+ sudo emerge texinfo gnupg coreutils pkgconfig help2man
+ sudo USE=latex emerge sphinx
+
+RedHat-based (Fedora, Centos, RHEL) Systems
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+::
+
+ sudo yum install help2man python-sphinx python-docutils \
+ python-pygments texlive-latex texlive-latex-fonts texinfo gnupg
+
+Mac OS X
+~~~~~~~~
+
+Install `Homebrew <https://github.com/mxcl/homebrew>`_, if you do not have
+it already.
+
+Unless you want to install the optional dependencies, skip to the next section.
+
+Install what else we can with Homebrew::
+
+ brew install help2man gnupg md5sha1sum
+
+If you don't already have pip installed, install it::
+
+ sudo easy_install pip
+
+Now, install the required Python packages::
+
+ sudo pip install sphinx
+ sudo pip install docutils
+ sudo pip install pygments
+
+Download `MacTeX <http://www.tug.org/mactex/>`_ and follow the instructions
+to get a working LaTeX install on your system.
+
+FreeBSD
+~~~~~~~
+
+::
+
+ pkg install help2man texinfo gnupg py27-sphinx texlive-full tex-formats
+
+Windows
+~~~~~~~
+
+Follow the instructions in `INSTALL.Windows` and build all components from
+source, using the same Visual C++ compiler and runtime.
+
+Configuring
+-----------
+
+Configure the source by running::
+
+ ./configure
+
+If you intend to run the test suites::
+
+ ./configure -c
+
+If you want to build it into different destination than `/usr/local`.:
+
+ ./configure --prefix=/<your directory path>
+
+If you don't want to build Fauxton or documentation specify ``--disable-fauxton``
+and/or ``--disable-docs`` arguments for `configure` to ignore their build and
+avoid any issues with their dependencies.
+
+See ``./configure --help`` for more information.
+
+Testing
+-------
+
+To run all the tests use run::
+
+ make check
+
+You can also run each test suite individually via ``eunit`` and ``javascript``
+targets::
+
+ make eunit
+ make javascript
+
+If you need to run specific Erlang tests, you can pass special "options"
+to make targets::
+
+ # Run tests only for couch and chttpd apps
+ make eunit apps=couch,chttpd
+
+ # Run only tests from couch_btree_tests suite
+ make eunit suites=couch_btree_tests
+
+ # Run only only specific tests
+ make eunit tests=btree_open_test,reductions_test
+
+ # Ignore tests for specified apps
+ make eunit skip_deps=couch_log,couch_epi
+
+The ``apps``, ``suites``, ``tests`` and ``skip_deps`` could be combined in any
+way. These are mimics to ``rebar eunit`` arguments. If you're not satisfied by
+these, you can use EUNIT_OPT environment variable to specify exact `rebar eunit`
+options::
+
+ make eunit EUNIT_OPTS="apps=couch,chttpd"
+
+JavaScript tests accepts only `suites` option, but in the same way::
+
+ # Run all JavaScript tests
+ make javascript
+
+ # Run only basic and design_options tests
+ make javascript suites="basic design_options"
+
+Note that tests are delimited here by whitespace, not by comma. You can get list
+of all possible test targets with the following command::
+
+ make list-js-suites
+
+Code analyzer could be run by::
+
+ make dialyze
+
+If you need to analyze only specific apps, you can specify them in familiar way
+::
+
+ make dialyze apps=couch,couch_epi
+
+See ``make help`` for more info and useful commands.
+
+Please report any problems to the developer's mailing list.
+
+Testing a cluster
+-----------------
+
+We use `Docker <https://docker.io>`_ to safely run a local three node
+cluster all inside a single docker container.
+
+Assuming you have Docker installed and running::
+
+ make docker-image
+
+This will create a docker image (tagged 'couchdb/dev-cluster') capable
+of running a joined three node cluster.
+
+To start it up::
+
+ make docker-start
+
+A three node cluster should now be running (you can now use ``docker ps``
+to find the exposed ports of the nodes).
+
+To stop it::
+
+ make docker-stop
+
+Releasing
+---------
+
+The release procedure is documented here::
+
+ https://wiki.apache.org/couchdb/Release_Procedure
+
+Unix-like Systems
+~~~~~~~~~~~~~~~~~
+
+Prepare the release artifacts by running::
+
+ make distcheck
+
+You can prepare signed release artifacts by running::
+
+ make distsign
+
+The release artifacts can be found in the root source directory.
+
+Microsoft Windows
+~~~~~~~~~~~~~~~~~
+
+Prepare the release artifacts by running::
+
+ make dist
+
+The release artifacts can be found in the `etc/windows` directory.
+
+Until the build system has been improved, you must make sure that you run this
+command from a clean source checkout. If you do not, your test database and log
+files will be bundled up in the release artifacts.
diff --git a/build-aux/couchdb-build-release.sh b/build-aux/couchdb-build-release.sh
index 9d2141a14..47c3926cd 100755
--- a/build-aux/couchdb-build-release.sh
+++ b/build-aux/couchdb-build-release.sh
@@ -24,17 +24,16 @@ cd src/
for repo in *; do
cd $repo
mkdir ../../$RELDIR/src/$repo
- git_ish=`git symbolic-ref -q --short HEAD || git describe --tags --exact-match`
+ git_ish=`git rev-parse --short HEAD`
git archive $git_ish | tar -xC ../../$RELDIR/src/$repo/
+ set +e
+ grep -rl '{vsn, git}' ../../$RELDIR/src/$repo/ | xargs sed -i "s/{vsn, git}/{vsn, \"`git describe --always --tags`\"}/" 2> /dev/null
+ set -e
cd ..
done
cd ..
-# update version
-# actual version detection TBD
-perl -pi -e "s/\{vsn, git\}/\{vsn, \"$VERSION\"\}/" $RELDIR/src/*/src/*.app.src
-
# create CONTRIBUTORS file
if test -e .git; then
OS=`uname -s`
diff --git a/configure b/configure
index b9c051f03..2e246b049 100755
--- a/configure
+++ b/configure
@@ -650,12 +650,14 @@ EOF
install_local_rebar() {
- if [ ! -x "${rootdir}/bin/rebar" ]; then
- git clone --depth 1 --branch 2.6.0 https://git-wip-us.apache.org/repos/asf/couchdb-rebar.git ${rootdir}/src/rebar
- make -C ${rootdir}/src/rebar
- mv ${rootdir}/src/rebar/rebar ${rootdir}/bin/rebar
- make -C ${rootdir}/src/rebar clean
- fi
+ if [ ! -x "${rootdir}/bin/rebar" ]; then
+ if [ ! -d "${rootdir}/src/rebar" ]; then
+ git clone --depth 1 --branch 2.6.0 https://git-wip-us.apache.org/repos/asf/couchdb-rebar.git ${rootdir}/src/rebar
+ fi
+ make -C ${rootdir}/src/rebar
+ mv ${rootdir}/src/rebar/rebar ${rootdir}/bin/rebar
+ make -C ${rootdir}/src/rebar clean
+ fi
}
@@ -667,6 +669,6 @@ fi
# only update dependencies, when we are not in a release tarball
if [ -d .git -a $SKIP_DEPS -ne 1 ]; then
- echo "==> updating dependencies"
- ${REBAR} get-deps # update-deps
+ echo "==> updating dependencies"
+ ${REBAR} get-deps update-deps
fi
diff --git a/dev/run b/dev/run
index 2cb1fd703..147bead8c 100755
--- a/dev/run
+++ b/dev/run
@@ -171,7 +171,8 @@ def setup_configs(ctx):
"node_name": "-name %s@127.0.0.1" % node,
"cluster_port": cluster_port,
"backend_port": backend_port,
- "fauxton_root": "src/fauxton/dist/release"
+ "fauxton_root": "src/fauxton/dist/release",
+ "uuid": "fake_uuid_for_dev"
}
if os.name == 'nt':
# Erlang always wants UNIX-style paths
@@ -476,16 +477,26 @@ def cluster_setup_with_admin_party(ctx):
create_system_databases(host, 15984)
+def try_request(host, port, meth, path, success_codes, retries=10, retry_dt=1):
+ while True:
+ conn = httpclient.HTTPConnection(host, port)
+ conn.request(meth, path)
+ resp = conn.getresponse()
+ if resp.status in success_codes:
+ return resp.status, resp.read()
+ elif retries <= 0:
+ assert resp.status in success_codes, resp.read()
+ retries -= 1
+ time.sleep(retry_dt)
+
+
def create_system_databases(host, port):
for dbname in ['_users', '_replicator', '_metadata', '_global_changes']:
conn = httpclient.HTTPConnection(host, port)
conn.request('HEAD', '/' + dbname)
resp = conn.getresponse()
if resp.status == 404:
- conn = httpclient.HTTPConnection(host, port)
- conn.request('PUT', '/' + dbname)
- resp = conn.getresponse()
- assert resp.status in (201, 202), resp.read()
+ try_request(host, port, 'PUT', '/' + dbname, (201, 202, 412))
@log('Developers cluster is set up at http://127.0.0.1:{lead_port}.\n'
diff --git a/rebar.config.script b/rebar.config.script
index 3ce5fff23..b5df6db6e 100644
--- a/rebar.config.script
+++ b/rebar.config.script
@@ -23,41 +23,41 @@ os:putenv("COUCHDB_APPS_CONFIG_DIR", filename:join([COUCHDB_ROOT, "rel/apps"])).
DepDescs = [
%% must be compiled first as it has a custom behavior
-{couch_epi, "couch-epi", "be34447c5ba0e474d851858b5346b33f864788e6"},
+{couch_epi, "couch-epi", "807aa3f58e39f1273e732020c80d630d9177790c"},
%% keep these sorted
{b64url, "b64url", "319fc604235ab1fde37047b38a432450161db750"},
-{cassim, "cassim", "1ae21f7c415acf3d1aba8b4924ca3093014b86b1"},
+{cassim, "cassim", "9bbfe82125284fa7cb3317079e8bc1dc876a07bf"},
{couch_log, "couch-log", "fb4157370403c4c97f19d958a51c889950a66a94"},
-{couch_log_lager, "couch-log-lager", "64cd100cb566ce93af9ef168fa86f9f70424b77b"},
+{couch_log_lager, "couch-log-lager", "b2a0471a87765de50c5eb05c65c121f68a9ae9fa"},
{config, "config", "b2ecd0d47a776256956ce045123423494ff85e8e"},
-{chttpd, "chttpd", "ddd63eefa9db5b533595b7ba14443a6b7581361c"},
-{couch, "couch", "4ca9e4184e3a56a34e22550a3b62cbb6ab9e46c5"},
+{chttpd, "chttpd", "a57e86994f6f5610edc3dca31ca373db92306d8b"},
+{couch, "couch", "a5aa4e17c3593a484ee8665d8b4272be05bedfe9"},
{couch_index, "couch-index", "14f579dcd142ee90300244c854b301bbd5c863ee"},
-{couch_mrview, "couch-mrview", "d7f0093b1c83a721dd8e9a9b3c625d0575e26c9f"},
-{couch_replicator, "couch-replicator", "85d62d1e2b72250c329b4b10db4df1231e647933"},
+{couch_mrview, "couch-mrview", "c3bed460ee844175b8ce11081386be27f686d8ff"},
+{couch_replicator, "couch-replicator", "3ce785710e28222064bfcfd68d7fd0af96b72add"},
{couch_plugins, "couch-plugins", "3e73b723cb126cfc471b560d17c24a8b5c540085"},
{couch_event, "couch-event", "835a41885d1e276d207758954f8238aa7bba0ae8"},
{couch_stats, "couch-stats", "7895d4d3f509ed24f09b6d1a0bd0e06af34551dc"},
{couch_peruser, "peruser", "ff7d190970a46722137fbc7a1a75466e8a544ae1"},
{docs, "documentation", "8f9f149925e3d42bebd7ffa944982c0c9af4c675", [raw]},
{ddoc_cache, "ddoc-cache", "c762e90a33ce3cda19ef142dd1120f1087ecd876"},
-{ets_lru, "ets-lru", "09128046ae9fbabfe1d70cb406aca878f6ea1dd5"},
-{fabric, "fabric", "17f0377807804b7b55db6c6b378d9e266ea52236"},
-{fauxton, "fauxton", "ebd9ced89d27de297526acf74ebad88f1c6a6711", [raw]},
-{folsom, "folsom", "fbb7bc83806520ffef84107c85f53c1f7113c20d"},
+{ets_lru, "ets-lru", "c05488c8b1d7ec1c3554a828e0c9bf2888932ed6"},
+{fabric, "fabric", "4c94f3095595a50a71860a75cc8866adb9a28ce3"},
+{fauxton, "fauxton", {tag, "v1.0.6"}, [raw]},
+{folsom, "folsom", "a5c95dec18227c977029fbd3b638966d98f17003"},
{global_changes, "global-changes", "e55de37ece29b6cbc0af540370d2425159338bf9"},
{goldrush, "goldrush", {tag, "0.1.6"}},
{ibrowse, "ibrowse", "4af2d408607874d124414ac45df1edbe3961d1cd"},
{ioq, "ioq", "c7c75ebeaf41599e3a3e211097d864f0e7785829"},
{jiffy, "jiffy", "ea19c417f9fd52fa3f7ef2d378735e5532c59b29"},
-{khash, "khash", "fc1a80fe38cb7f1c19ba0b4d275f14fbf3b5251e"},
-{mango, "mango", "46b58a3c53bc07db8b841fd55dc9fb32c1b6bb89"},
-{mem3, "mem3", "62ac9b2655cc50a9260f37d25829ab7f3c86f251"},
+{khash, "khash", "7c6a9cd9776b5c6f063ccafedfa984b00877b019"},
+{mango, "mango", "a02f6106af37dd6900ceed5288e692661c369ef1"},
+{mem3, "mem3", "80fd81b3350dc96918b460b3bfb646fddade80f2"},
{mochiweb, "mochiweb", "bd6ae7cbb371666a1f68115056f7b30d13765782"},
{oauth, "oauth", "099057a98e41f3aff91e77e3cf496d6c6fd901df"},
{rexi, "rexi", "a327b7dbeb2b0050f7ca9072047bf8ef2d282833"},
-{snappy, "snappy", "0ab2796f82789895a2a86d403e63f3823d3c5a1d"},
-{setup, "setup", "d0a9b722485639fc43ccbfc4267f3a2dd9aa9d5a"},
+{snappy, "snappy", "ce24944752ff3a60ad2710f61d4cf709a1b31863"},
+{setup, "setup", "b9e1f3b5d5a78a706abb358e17130fb7344567d2"},
{meck, "meck", {tag, "0.8.2"}}
],
@@ -85,6 +85,13 @@ AddConfig = [
{erl_opts, [debug_info]},
{eunit_opts, [verbose]},
{plugins, [eunit_plugin]},
+ {dialyzer, [
+ {plt_location, local},
+ {plt_location, COUCHDB_ROOT},
+ {plt_extra_apps, [
+ asn1, compiler, crypto, inets, kernel, os_mon, runtime_tools,
+ sasl, ssl, stdlib, syntax_tools, xmerl]},
+ {warnings, [unmatched_returns, error_handling, race_conditions]}]},
{post_hooks, [{compile, "escript support/build_js.escript"}]}
],
diff --git a/rel/files/eunit.config b/rel/files/eunit.config
new file mode 100644
index 000000000..3ed74c0b1
--- /dev/null
+++ b/rel/files/eunit.config
@@ -0,0 +1,32 @@
+% Licensed under the Apache License, Version 2.0 (the "License"); you may not
+% use this file except in compliance with the License. You may obtain a copy of
+% the License at
+%
+% http://www.apache.org/licenses/LICENSE-2.0
+%
+% Unless required by applicable law or agreed to in writing, software
+% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+% License for the specific language governing permissions and limitations under
+% the License.
+
+[
+ {kernel, [{error_logger, silent}]},
+ {sasl, [{sasl_error_logger, false}]},
+ {lager, [
+ {error_logger_hwm, 1000},
+ {error_logger_redirect, true},
+ {handlers, [
+ {lager_console_backend, [error, {
+ lager_default_formatter,
+ [
+ date, " ", time,
+ " [", severity, "] ",
+ node, " ", pid, " ",
+ message,
+ "\n"
+ ]
+ }]}
+ ]}
+ ]}
+].
diff --git a/rel/files/sys.config b/rel/files/sys.config
index 6bfc77562..95cf49e54 100644
--- a/rel/files/sys.config
+++ b/rel/files/sys.config
@@ -15,7 +15,7 @@
{error_logger_hwm, 1000},
{error_logger_redirect, true},
{handlers, [
- {lager_console_backend, [debug, {
+ {lager_console_backend, [error, {
lager_default_formatter,
[
date, " ", time,
diff --git a/rel/overlay/etc/default.ini b/rel/overlay/etc/default.ini
index 454bc7124..bcababcbb 100644
--- a/rel/overlay/etc/default.ini
+++ b/rel/overlay/etc/default.ini
@@ -3,6 +3,7 @@
name = {{package_author_name}}
[couchdb]
+uuid = {{uuid}}
database_dir = {{data_dir}}
view_index_dir = {{view_index_dir}}
; util_driver_dir =
@@ -259,6 +260,10 @@ compressible_types = text/*, application/javascript, application/json, applicati
[replicator]
db = _replicator
+; minimum time between a replicator job restart (milliseconds)
+start_delay = 0
+; random splay time between a replicator job restart (milliseconds)
+start_splay = 0
; Maximum replicaton retry count can be a non-negative integer or "infinity".
max_replication_retry_count = 10
; More worker processes can give higher network throughput but can also
diff --git a/run-tests.sh b/run-tests.sh
deleted file mode 100755
index 4e3e6816d..000000000
--- a/run-tests.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh -ev
-
-# Eunit/Javascript tests
-make check
-
-# Test Fauxton
-cd src/fauxton
-npm install
-grunt test