Skip to content

Commit c13ee7b

Browse files
authored
Merge pull request #1177 from jimklimov/default-travis-dist
Problem : default travis dist is hardcoded (xenial)
2 parents 76c775f + 77d1a73 commit c13ee7b

File tree

3 files changed

+70
-11
lines changed

3 files changed

+70
-11
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ zproject's `project.xml` contains an extensive description of the available conf
197197
redhat Packaging for RedHat
198198
ruby Ruby binding
199199
travis Travis CI scripts
200+
<option name="dist" value="trusty" /> Select a Linux distribution to use by default on Travis CI, also impacts the OBS-served repository of ZMQ-family packages to use (if not building from source all the time per use_pkg_deps_prereqs_source below). By default it would be "xenial" as of now.
200201
<option name="distcheck" value="0" /> "0" will disable run of make distcheck in Travis CI, "2" will enable it as a special testcase allowed to fail (default: 1 to enable and require to pass)
201202
<option name="use_pkg_deps_prereqs_source" value="0" /> "0" will disable use of use_pkg_deps_prereqs_source list in Travis CI and so cause rebuild of everything from scratch (default: 1, recently packaged prereqs must exist then)
202203
<option name="use_cmake" value="0" /> "0" will disable use of CMake recipes in Travis CI (default: 1)

project.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
redhat Packaging for RedHat
2121
ruby Ruby binding
2222
travis Travis CI scripts
23+
<option name="dist" value="trusty" /> Select a Linux distribution to use by default on Travis CI, also impacts the OBS-served repository of ZMQ-family packages to use (if not building from source all the time per use_pkg_deps_prereqs_source below). By default it would be "xenial" as of now.
2324
<option name="distcheck" value="0" /> "0" will disable run of make distcheck in Travis CI, "2" will enable it as a special testcase allowed to fail (default: 1 to enable and require to pass)
2425
<option name="use_pkg_deps_prereqs_source" value="0" /> "0" will disable use of use_pkg_deps_prereqs_source list in Travis CI and so cause rebuild of everything from scratch (default: 1, recently packaged prereqs must exist then)
2526
<option name="use_cmake" value="0" /> "0" will disable use of CMake recipes in Travis CI (default: 1)

zproject_travis.gsl

Lines changed: 68 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,43 @@ cache:
3333
os:
3434
- linux
3535

36-
# The default distro for env:/matrix: tests and unspecified matrix: tests;
36+
# The default distro for env:/matrix:/* and unspecified-dist matrix:/* tests;
3737
# for the latter see also addons/apt/sources with the package repos in use.
3838
# See https://docs.travis-ci.com/user/reference/overview/ for up-to-date
3939
# allowed values of "dist" supported by the Travis CI service.
40+
.# Note: by default zproject before 2019-05-22 enforced xenial
41+
.# in specific build items in the matrix: below, and nothing here
42+
.if defined(project.travis_dist)
43+
. if project.travis_dist ?= ""
44+
#dist:
45+
#- xenial
46+
. else
47+
dist:
48+
- $(project.travis_dist)
49+
. endif
50+
.else
4051
dist:
4152
- xenial
53+
.endif
54+
.#
55+
.if !defined(project.travis_dist) | (project.travis_dist ?= "")
56+
. if project.travis_use_pkg_deps_prereqs_source ?= 1
57+
.# Even if our zproject user did not want a distro specified,
58+
.# we need something specific installed in the build env
59+
. project.travis_dist = "xenial"
60+
. else
61+
.# Have it defined() at least
62+
. project.travis_dist = ""
63+
. endif
64+
.endif
65+
.#
66+
.# TODO: Add the older "precise"/"ubuntu12" back for completness?
67+
.pkg_src_zeromq_dist = ""
68+
.if (project.travis_dist ?= "trusty")
69+
. pkg_src_zeromq_dist = "pkg_src_zeromq_ubuntu14"
70+
.elsif (project.travis_dist ?= "xenial")
71+
. pkg_src_zeromq_dist = "pkg_src_zeromq_ubuntu16"
72+
.endif
4273

4374
#services:
4475
#- docker
@@ -171,20 +202,25 @@ pkg_deps_doctools: &pkg_deps_doctools
171202
pkg_deps_devtools: &pkg_deps_devtools
172203
- git
173204

205+
# dist==trusty means ubuntu14
174206
pkg_src_zeromq_ubuntu14: &pkg_src_zeromq_ubuntu14
175207
- sourceline: 'deb http://download.opensuse.org/repositories/network:/messaging:/zeromq:/git-draft/xUbuntu_14.04/ ./'
176208
key_url: 'http://download.opensuse.org/repositories/network:/messaging:/zeromq:/git-draft/xUbuntu_14.04/Release.key'
177209

210+
# dist==xenial means ubuntu16
178211
pkg_src_zeromq_ubuntu16: &pkg_src_zeromq_ubuntu16
179212
- sourceline: 'deb http://download.opensuse.org/repositories/network:/messaging:/zeromq:/git-draft/xUbuntu_16.04/ ./'
180213
key_url: 'http://download.opensuse.org/repositories/network:/messaging:/zeromq:/git-draft/xUbuntu_16.04/Release.key'
181214

182-
# Note: refer to ubuntu16 if you use dist==xenial
183215
# Also note that as of early 2017, either dist==trusty or services==docker
184-
# is needed for C++11 support; docker envs are usually faster to start up
216+
# is needed for some C++11 support; docker envs are usually faster to start up
217+
# A newer dist==xenial completes the C++11 support with gcc-5+
185218
addons:
186219
apt:
187-
sources: *pkg_src_zeromq_ubuntu16
220+
.if (pkg_src_zeromq_dist ?<> "")
221+
sources:
222+
- *$(pkg_src_zeromq_dist)
223+
.endif
188224
packages: &pkg_deps_common
189225
- *pkg_deps_devtools
190226
- *pkg_deps_prereqs
@@ -193,36 +229,57 @@ matrix:
193229
include:
194230
- env: BUILD_TYPE=default-with-docs
195231
os: linux
232+
.if (project.travis_dist ?<> "")
233+
dist: $(project.travis_dist)
234+
.endif
196235
addons:
197236
apt:
198-
sources: *pkg_src_zeromq_ubuntu16
237+
.if (pkg_src_zeromq_dist ?<> "")
238+
sources:
239+
- *$(pkg_src_zeromq_dist)
240+
.endif
199241
packages:
200242
- *pkg_deps_common
201243
- *pkg_deps_doctools
202244
- env: BUILD_TYPE=valgrind
203245
os: linux
204-
dist: xenial
246+
.if (project.travis_dist ?<> "")
247+
dist: $(project.travis_dist)
248+
.endif
205249
addons:
206250
apt:
207-
sources: *pkg_src_zeromq_ubuntu16
251+
.if (pkg_src_zeromq_dist ?<> "")
252+
sources:
253+
- *$(pkg_src_zeromq_dist)
254+
.endif
208255
packages:
209256
- valgrind
210257
- *pkg_deps_common
211258
- env: BUILD_TYPE=default ADDRESS_SANITIZER=enabled
212259
os: linux
213-
dist: xenial
260+
.if (project.travis_dist ?<> "")
261+
dist: $(project.travis_dist)
262+
.endif
214263
addons:
215264
apt:
216-
sources: *pkg_src_zeromq_ubuntu16
265+
.if (pkg_src_zeromq_dist ?<> "")
266+
sources:
267+
- *$(pkg_src_zeromq_dist)
268+
.endif
217269
packages:
218270
- *pkg_deps_common
219271
.if defined(project.travis_check_zproject) & !(project.travis_check_zproject ?= 0)
220272
- env: BUILD_TYPE=check_zproject
221273
os: linux
222-
dist: xenial
274+
. if (project.travis_dist ?<> "")
275+
dist: $(project.travis_dist)
276+
. endif
223277
addons:
224278
apt:
225-
sources: *pkg_src_zeromq_ubuntu16
279+
. if (pkg_src_zeromq_dist ?<> "")
280+
sources:
281+
- *$(pkg_src_zeromq_dist)
282+
. endif
226283
packages:
227284
- *pkg_deps_devtools
228285
- *pkg_deps_zproject

0 commit comments

Comments
 (0)