Skip to content
This repository has been archived by the owner on Nov 17, 2020. It is now read-only.

Commit

Permalink
Merge branch 'master' into rabbitmq-server-500
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelklishin committed Jul 7, 2016
2 parents 26bff83 + bd25b0e commit d35bb6e
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 53 deletions.
28 changes: 11 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,20 @@ addons:
- xsltproc
otp_release:
- "18.3"
- "19.0"

# The checkout made by Travis is a "detached HEAD". We switch back
# to a tag or a branch. This pleases our git_rmq fetch method in
# rabbitmq-components.mk and the proper tag/branch is selected in
# dependencies too.
# The checkout made by Travis is a "detached HEAD" and branches
# information is missing. Our Erlang.mk's git_rmq fetch method relies on
# it, so we need to restore it.
#
# FIXME: There is still one problem: for builds triggered by a pull
# request, $TRAVIS_BRANCH contains the target branch name, not the
# source branch name. Therefore, we can't rely on automatic checkout
# of corresponding branches in dependencies. For instance, if the pull
# request comes from a branch "rabbitmq-server-123", based on "stable",
# then this command will checkout "stable" and we won't try to checkout
# "rabbitmq-server-123" in dependencies.
#
# We also make sure the "master" branch exists, because
# rabbitmq-components.mk expects it. If it's missing, we just create a
# fake branch pointing to the same commit as $TRAVIS_BRANCH.
# We simply fetch master and, if it exists, stable branches. A branch is
# created, pointing to the detached HEAD.
before_script:
- git checkout -B "${TRAVIS_TAG:-${TRAVIS_BRANCH}}"
- git rev-parse --verify -q master -- || git branch master
- |
git checkout -B "${TRAVIS_TAG:-${TRAVIS_BRANCH}}"
git remote add upstream https://github.com/$TRAVIS_REPO_SLUG.git
git fetch upstream stable:stable || :
git fetch upstream master:master || :
script: make tests

Expand Down
10 changes: 0 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,6 @@ include erlang.mk
include mk/rabbitmq-build.mk
include mk/rabbitmq-dist.mk

# --------------------------------------------------------------------
# Compilation.
# --------------------------------------------------------------------

ERTS_VER := $(shell erl -version 2>&1 | sed -E 's/.* version //')
tls_atom_version_MAX_ERTS_VER = 6.0
ifeq ($(call compare_version,$(ERTS_VER),$(tls_atom_version_MAX_ERTS_VER),<),true)
RMQ_ERLC_OPTS += -Ddefine_tls_atom_version
endif

# --------------------------------------------------------------------
# Framing sources generation.
# --------------------------------------------------------------------
Expand Down
46 changes: 46 additions & 0 deletions mk/rabbitmq-build.mk
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# --------------------------------------------------------------------
# Compiler flags.
# --------------------------------------------------------------------

# FIXME: We copy Erlang.mk default flags here: rabbitmq-build.mk is
# loaded as a plugin, so before those variables are defined. And because
# Erlang.mk uses '?=', the flags we set here override the default set.
Expand All @@ -9,6 +13,22 @@ WARNING_OPTS += +debug_info \
ERLC_OPTS += -Werror $(WARNING_OPTS)
TEST_ERLC_OPTS += $(WARNING_OPTS)

define compare_version
$(shell awk 'BEGIN {
split("$(1)", v1, ".");
version1 = v1[1] * 1000000 + v1[2] * 10000 + v1[3] * 100 + v1[4];

split("$(2)", v2, ".");
version2 = v2[1] * 1000000 + v2[2] * 10000 + v2[3] * 100 + v2[4];

if (version1 $(3) version2) {
print "true";
} else {
print "false";
}
}')
endef

# Add Lager parse_transform module and our default Lager extra sinks.
LAGER_EXTRA_SINKS += rabbit_log \
rabbit_log_channel \
Expand All @@ -24,3 +44,29 @@ RMQ_ERLC_OPTS += +'{parse_transform,lager_transform}' \
# Push our compilation options to both the normal and test ERLC_OPTS.
ERLC_OPTS += $(RMQ_ERLC_OPTS)
TEST_ERLC_OPTS += $(RMQ_ERLC_OPTS)

# --------------------------------------------------------------------
# Common test flags.
# --------------------------------------------------------------------

# Disable most messages on Travis and Concourse.
#
# Concourse doesn't set any environment variables to help us automate
# things. In rabbitmq-ci, we run tests under the `concourse` user so,
# look at that...
CT_QUIET_FLAGS = -verbosity 50 \
-erl_args \
-kernel error_logger silent
ifdef TRAVIS
CT_OPTS += $(CT_QUIET_FLAGS)
endif
ifdef CONCOURSE
CT_OPTS += $(CT_QUIET_FLAGS)
endif

# Enable JUnit-like report on Jenkins. Jenkins parses those reports so
# the results can be browsed from its UI. Furthermore, it displays a
# graph showing evolution of the results over time.
ifdef JENKINS_HOME
CT_OPTS += -ct_hooks cth_surefire
endif
18 changes: 0 additions & 18 deletions mk/rabbitmq-dist.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,6 @@ $(shell awk '
}' $(1))
endef

# Our type specs rely on dict:dict/0 etc, which are only available in
# 17.0 upwards.
define compare_version
$(shell awk 'BEGIN {
split("$(1)", v1, ".");
version1 = v1[1] * 1000000 + v1[2] * 10000 + v1[3] * 100 + v1[4];

split("$(2)", v2, ".");
version2 = v2[1] * 1000000 + v2[2] * 10000 + v2[3] * 100 + v2[4];

if (version1 $(3) version2) {
print "true";
} else {
print "false";
}
}')
endef

# Define the target to create an .ez plugin archive. This macro is
# called like this:
#
Expand Down
7 changes: 0 additions & 7 deletions src/rabbit_net.erl