Skip to content
This repository was archived by the owner on Dec 20, 2023. It is now read-only.

Commit 0845fee

Browse files
authored
Merge pull request #38 from openweave/feature/add-distcheck-to-travis-ci
Add Distribution Sanity Check Target to Travis CI
2 parents 61a50c1 + ca956fb commit 0845fee

File tree

2,113 files changed

+1134
-1128968
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,113 files changed

+1134
-1128968
lines changed

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ after_success:
3535

3636
matrix:
3737
include:
38+
- name: "Linux with Defaults against GCC Distribution Sanity Check"
39+
env: BUILD_TARGET="linux-auto-gcc-distcheck" CC="gcc"
40+
os: linux
41+
compiler: gcc
3842
- name: "Linux with Defaults against GCC Coding Style Check"
3943
env: BUILD_TARGET="linux-auto-gcc-lint" CC="gcc"
4044
os: linux

.travis/script.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ die()
3131

3232
case "${BUILD_TARGET}" in
3333

34+
linux-auto-*-distcheck)
35+
./configure && make distcheck
36+
;;
37+
3438
linux-auto-*-lint)
3539
./configure && make pretty-check
3640
;;

Makefile-bootstrap

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
#
2+
# Copyright 2017-2018 Nest Labs Inc. All Rights Reserved.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
#
18+
# Description:
19+
# This file is the makefile for inlining optional and required
20+
# third-party packages as package-internal copies and for providing
21+
# convenience targets for bootstrapping the GNU autotools-based build
22+
# system used by this package.
23+
#
24+
# If your package has dependent git repositories that you might
25+
# otherwise be inclined to subtree in, you can define a
26+
# "repos.conf" file at the top of your project that enumerates
27+
# the repositories, the branch thereof, and where to put it in
28+
# your project. An example is shown below:
29+
#
30+
# [submodule "nlassert"]
31+
# path = third_party/nlassert/repo
32+
# url = [email protected]:nestlabs/nlassert.git
33+
# branch = master
34+
# update = none
35+
# [submodule "nlunit-test"]
36+
# path = third_party/nlunit-test/repo
37+
# url = [email protected]:nestlabs/nlunit-test.git
38+
# branch = master
39+
# update = none
40+
#
41+
42+
ThisMakefile := $(firstword $(MAKEFILE_LIST))
43+
44+
builddir ?= .
45+
abs_builddir ?= $(realpath $(builddir))
46+
top_builddir ?= $(builddir)
47+
abs_top_builddir ?= $(realpath $(top_builddir))
48+
srcdir ?= $(dir $(realpath $(ThisMakefile)))
49+
abs_srcdir ?= $(realpath $(srcdir))
50+
top_srcdir ?= $(srcdir)
51+
abs_top_srcdir ?= $(realpath $(top_srcdir))
52+
53+
nlbuild_autotools_stem ?= third_party/nlbuild-autotools/repo
54+
abs_top_nlbuild_autotools_dir ?= $(abs_top_srcdir)/$(nlbuild_autotools_stem)
55+
56+
include $(abs_top_nlbuild_autotools_dir)/make/pre.mak
57+
include $(abs_top_nlbuild_autotools_dir)/make/host/tools/bootstrap.mak
58+
59+
#
60+
# Add any project-specific bootstrap help commands to this
61+
# 'help-hook' target.
62+
#
63+
# These commands will be executed AFTER the core bootstrap 'help'
64+
# target commands.
65+
#
66+
help-hook:
67+
68+
#
69+
# Add any project-specific bootstrap help commands to this
70+
# 'help-bootstrap-hook' target.
71+
#
72+
# These commands will be executed AFTER the core bootstrap 'help' and
73+
# 'help-bootstrap' target commands.
74+
#
75+
help-bootstrap-hook:
76+
77+
#
78+
# Add any project-specific bootstrap help commands to this
79+
# 'help-repos-hook' target.
80+
#
81+
# These commands will be executed AFTER the core bootstrap 'help' and
82+
# 'help-repos' target commands.
83+
#
84+
help-repos-hook:
85+
86+
#
87+
# Add any project-specific bootstrap repos commands to this
88+
# 'repos-hook' target.
89+
#
90+
# These commands will be executed AFTER the core bootstrap 'repos'
91+
# target commands.
92+
#
93+
repos-hook:
94+
95+
#
96+
# Add any project-specific bootstrap repos commands to this
97+
# 'clean-repos-hook' target.
98+
#
99+
# These commands will be executed BEFORE the core bootstrap 'clean-repos'
100+
# target commands.
101+
#
102+
clean-repos-hook:
103+
104+
include $(abs_top_nlbuild_autotools_dir)/make/post.mak
105+
include $(abs_top_nlbuild_autotools_dir)/make/post/rules/bootstrap.mak

Makefile.am

Lines changed: 52 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ EXTRA_DIST = \
4545
BUILDING.md \
4646
CONTRIBUTING.md \
4747
Makefile-Android \
48+
Makefile-bootstrap \
4849
Makefile-iOS \
4950
Makefile-Standalone \
5051
README.md \
@@ -56,6 +57,7 @@ EXTRA_DIST = \
5657
.travis/script.sh \
5758
bootstrap \
5859
bootstrap-configure \
60+
repos.conf \
5961
$(srcdir)/build/autoconf \
6062
$(srcdir)/build/config \
6163
$(srcdir)/build/cstyle/cstyle.options \
@@ -103,16 +105,29 @@ PRETTY_FILES := $(NULL)
103105
# .dist-version second, and the .default-version last.
104106
#
105107

108+
# VERSION_FILE should be and is intentionally an immediate (:=) rather
109+
# than a deferred (=) variable to ensure the value binds once and only once
110+
# for a given MAKELEVEL even as .local-version and .dist-version are created
111+
# during makefile execution.
112+
106113
VERSION_FILE := $(if $(wildcard $(builddir)/.local-version),$(builddir)/.local-version,$(if $(wildcard $(srcdir)/.dist-version),$(srcdir)/.dist-version,$(srcdir)/.default-version))
107114

108115
#
109116
# Override autotool's default notion of the package version variables.
110-
# This ensures that when we create a source distribution that the
111-
# version is always the current version, not the version when the
112-
# package was bootstrapped.
117+
# This ensures that when we create a source distribution the
118+
# version is always the current version, not the package bootstrap
119+
# version.
120+
#
121+
# The two-level variables and the check against MAKELEVEL ensures that
122+
# not only can the package version be overridden from the command line
123+
# but also when the version is NOT overridden that we bind the version
124+
# once and only once across potential sub-makes to prevent the version
125+
# from flapping as VERSION_FILE changes.
113126
#
114127

115-
WEAVE_VERSION ?= $(shell cat $(VERSION_FILE) 2> /dev/null)
128+
export MAYBE_WEAVE_VERSION := $(if $(filter 0,$(MAKELEVEL)),$(shell cat $(VERSION_FILE) 2> /dev/null),$(MAYBE_WEAVE_VERSION))
129+
130+
WEAVE_VERSION ?= $(MAYBE_WEAVE_VERSION)
116131

117132
PACKAGE_VERSION = $(WEAVE_VERSION)
118133
VERSION = $(PACKAGE_VERSION)
@@ -171,10 +186,42 @@ $(distdir)/.dist-version: $(builddir)/.local-version force
171186
$(distdir)/.dist-version $(builddir)/.local-version:
172187
$(call check-file,$(@F))
173188

174-
dist distcheck install-headers: $(BUILT_SOURCES)
189+
#
190+
# When we run 'distcheck' and --with-<any of the third-party packages
191+
# listed in repos.conf>, default to 'internal', the nlbuild-autotools
192+
# infrastructure will attempt to create git paths to manage the
193+
# package repo. Two directories need to be writable to facilitate
194+
# this.
195+
#
196+
197+
DISTCHECK_CONFIGURE_FLAGS = `chmod u+w .. ../third_party`
198+
199+
#
200+
# BlueZ is not well set-up without patching to handle 'make distcheck';
201+
# disable it for that target.
202+
#
203+
# We also want a more cursory sanity check for 'distcheck'; consequently,
204+
# skip running the Happy-centric tests.
205+
#
206+
207+
DISTCHECK_CONFIGURE_FLAGS += --without-bluez --without-happy
208+
209+
dist distcheck distdir install-headers: $(BUILT_SOURCES)
175210

176211
dist-hook: $(distdir)/.dist-version
177212

213+
# If you are synchronizing a package on which yours depends using 'repos.conf',
214+
# to 'third_party', uncomment and adapt or delete this, as needed. If you choose
215+
# to use this, please also take a look at Makefile.am and third_party/Makefile.am
216+
# and uncomment the appropriate sections there.
217+
218+
#
219+
# Ensure any locally synchronized repositories defined by 'repos.conf'
220+
# are cleaned up.
221+
#
222+
distclean-local:
223+
$(MAKE) -C $(srcdir) -f Makefile-bootstrap clean-repos
224+
178225
#
179226
# Top-level convenience target for making a documentation-only
180227
# distribution whose results appear at the top level of the build tree

Makefile.in

Lines changed: 63 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -295,10 +295,10 @@ AUTOCONF = @AUTOCONF@
295295
AUTOHEADER = @AUTOHEADER@
296296
AUTOMAKE = @AUTOMAKE@
297297
AWK = @AWK@
298-
BLUEZ_BUILD_DIRECTORY = @BLUEZ_BUILD_DIRECTORY@
299298
BLUEZ_CPPFLAGS = @BLUEZ_CPPFLAGS@
300299
BLUEZ_LDFLAGS = @BLUEZ_LDFLAGS@
301300
BLUEZ_LIBS = @BLUEZ_LIBS@
301+
BLUEZ_SUBDIRS = @BLUEZ_SUBDIRS@
302302
CC = @CC@
303303
CCDEPMODE = @CCDEPMODE@
304304
CFLAGS = @CFLAGS@
@@ -385,15 +385,19 @@ MKDIR_P = @MKDIR_P@
385385
NLASSERT_CPPFLAGS = @NLASSERT_CPPFLAGS@
386386
NLASSERT_LDFLAGS = @NLASSERT_LDFLAGS@
387387
NLASSERT_LIBS = @NLASSERT_LIBS@
388+
NLASSERT_SUBDIRS = @NLASSERT_SUBDIRS@
388389
NLFAULTINJECTION_CPPFLAGS = @NLFAULTINJECTION_CPPFLAGS@
389390
NLFAULTINJECTION_LDFLAGS = @NLFAULTINJECTION_LDFLAGS@
390391
NLFAULTINJECTION_LIBS = @NLFAULTINJECTION_LIBS@
392+
NLFAULTINJECTION_SUBDIRS = @NLFAULTINJECTION_SUBDIRS@
391393
NLIO_CPPFLAGS = @NLIO_CPPFLAGS@
392394
NLIO_LDFLAGS = @NLIO_LDFLAGS@
393395
NLIO_LIBS = @NLIO_LIBS@
394-
NLUNITTEST_CPPFLAGS = @NLUNITTEST_CPPFLAGS@
395-
NLUNITTEST_LDFLAGS = @NLUNITTEST_LDFLAGS@
396-
NLUNITTEST_LIBS = @NLUNITTEST_LIBS@
396+
NLIO_SUBDIRS = @NLIO_SUBDIRS@
397+
NLUNIT_TEST_CPPFLAGS = @NLUNIT_TEST_CPPFLAGS@
398+
NLUNIT_TEST_LDFLAGS = @NLUNIT_TEST_LDFLAGS@
399+
NLUNIT_TEST_LIBS = @NLUNIT_TEST_LIBS@
400+
NLUNIT_TEST_SUBDIRS = @NLUNIT_TEST_SUBDIRS@
397401
NL_PROJECT_CONFIG_INCLUDES = @NL_PROJECT_CONFIG_INCLUDES@
398402
NM = @NM@
399403
NMEDIT = @NMEDIT@
@@ -546,6 +550,7 @@ EXTRA_DIST = \
546550
BUILDING.md \
547551
CONTRIBUTING.md \
548552
Makefile-Android \
553+
Makefile-bootstrap \
549554
Makefile-iOS \
550555
Makefile-Standalone \
551556
README.md \
@@ -557,6 +562,7 @@ EXTRA_DIST = \
557562
.travis/script.sh \
558563
bootstrap \
559564
bootstrap-configure \
565+
repos.conf \
560566
$(srcdir)/build/autoconf \
561567
$(srcdir)/build/config \
562568
$(srcdir)/build/cstyle/cstyle.options \
@@ -603,7 +609,30 @@ PRETTY_FILES := $(NULL)
603609
# When present, the .local-version file is preferred first, the
604610
# .dist-version second, and the .default-version last.
605611
#
612+
613+
# VERSION_FILE should be and is intentionally an immediate (:=) rather
614+
# than a deferred (=) variable to ensure the value binds once and only once
615+
# for a given MAKELEVEL even as .local-version and .dist-version are created
616+
# during makefile execution.
606617
VERSION_FILE := $(if $(wildcard $(builddir)/.local-version),$(builddir)/.local-version,$(if $(wildcard $(srcdir)/.dist-version),$(srcdir)/.dist-version,$(srcdir)/.default-version))
618+
619+
#
620+
# When we run 'distcheck' and --with-<any of the third-party packages
621+
# listed in repos.conf>, default to 'internal', the nlbuild-autotools
622+
# infrastructure will attempt to create git paths to manage the
623+
# package repo. Two directories need to be writable to facilitate
624+
# this.
625+
#
626+
627+
#
628+
# BlueZ is not well set-up without patching to handle 'make distcheck';
629+
# disable it for that target.
630+
#
631+
# We also want a more cursory sanity check for 'distcheck'; consequently,
632+
# skip running the Happy-centric tests.
633+
#
634+
DISTCHECK_CONFIGURE_FLAGS = `chmod u+w .. ../third_party` \
635+
--without-bluez --without-happy
607636
weave_tooldist_alias = \
608637
$(PACKAGE_TARNAME)-tools
609638

@@ -1034,7 +1063,7 @@ distclean: distclean-recursive
10341063
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
10351064
-rm -f Makefile
10361065
distclean-am: clean-am distclean-generic distclean-libtool \
1037-
distclean-tags
1066+
distclean-local distclean-tags
10381067

10391068
dvi: dvi-recursive
10401069

@@ -1104,10 +1133,10 @@ uninstall-am: uninstall-dist_docDATA
11041133
clean-libtool cscope cscopelist-am ctags ctags-am dist \
11051134
dist-all dist-bzip2 dist-gzip dist-hook dist-lzip dist-shar \
11061135
dist-tarZ dist-xz dist-zip distcheck distclean \
1107-
distclean-generic distclean-libtool distclean-tags \
1108-
distcleancheck distdir distuninstallcheck dvi dvi-am html \
1109-
html-am info info-am install install-am install-data \
1110-
install-data-am install-dist_docDATA install-dvi \
1136+
distclean-generic distclean-libtool distclean-local \
1137+
distclean-tags distcleancheck distdir distuninstallcheck dvi \
1138+
dvi-am html html-am info info-am install install-am \
1139+
install-data install-data-am install-dist_docDATA install-dvi \
11111140
install-dvi-am install-exec install-exec-am install-html \
11121141
install-html-am install-info install-info-am install-man \
11131142
install-pdf install-pdf-am install-ps install-ps-am \
@@ -1127,12 +1156,20 @@ include $(abs_top_nlbuild_autotools_dir)/automake/pre.am
11271156

11281157
#
11291158
# Override autotool's default notion of the package version variables.
1130-
# This ensures that when we create a source distribution that the
1131-
# version is always the current version, not the version when the
1132-
# package was bootstrapped.
1159+
# This ensures that when we create a source distribution the
1160+
# version is always the current version, not the package bootstrap
1161+
# version.
1162+
#
1163+
# The two-level variables and the check against MAKELEVEL ensures that
1164+
# not only can the package version be overridden from the command line
1165+
# but also when the version is NOT overridden that we bind the version
1166+
# once and only once across potential sub-makes to prevent the version
1167+
# from flapping as VERSION_FILE changes.
11331168
#
11341169

1135-
WEAVE_VERSION ?= $(shell cat $(VERSION_FILE) 2> /dev/null)
1170+
export MAYBE_WEAVE_VERSION := $(if $(filter 0,$(MAKELEVEL)),$(shell cat $(VERSION_FILE) 2> /dev/null),$(MAYBE_WEAVE_VERSION))
1171+
1172+
WEAVE_VERSION ?= $(MAYBE_WEAVE_VERSION)
11361173

11371174
#
11381175
# check-file-.local-version
@@ -1188,10 +1225,22 @@ $(distdir)/.dist-version: $(builddir)/.local-version force
11881225
$(distdir)/.dist-version $(builddir)/.local-version:
11891226
$(call check-file,$(@F))
11901227

1191-
dist distcheck install-headers: $(BUILT_SOURCES)
1228+
dist distcheck distdir install-headers: $(BUILT_SOURCES)
11921229

11931230
dist-hook: $(distdir)/.dist-version
11941231

1232+
# If you are synchronizing a package on which yours depends using 'repos.conf',
1233+
# to 'third_party', uncomment and adapt or delete this, as needed. If you choose
1234+
# to use this, please also take a look at Makefile.am and third_party/Makefile.am
1235+
# and uncomment the appropriate sections there.
1236+
1237+
#
1238+
# Ensure any locally synchronized repositories defined by 'repos.conf'
1239+
# are cleaned up.
1240+
#
1241+
distclean-local:
1242+
$(MAKE) -C $(srcdir) -f Makefile-bootstrap clean-repos
1243+
11951244
#
11961245
# Top-level convenience target for making a documentation-only
11971246
# distribution whose results appear at the top level of the build tree

0 commit comments

Comments
 (0)