Skip to content

Commit 3f75f54

Browse files
authored
fixup broken build (#77)
* Test builds only on linux * linux distro of choice is ubuntu 16.04 (xenial) * update nginx versions to latest travis builds use the latest versions for mainline, stable and legacy releases of nginx * matrix is now called jobs in travis * no more sudo sudo is anyways deprecated. also, travis now offers native directives to install OS packages; so use those * name build stages move away from doing the actual build as a "before install" step. We now have labelled staged to better understand things * Move travis env prep to makefile * be silent in source download and extraction * migrate travis env prep steps to makefile * removed reference to outdated cmocka * use the newer gitlab hosted cmocka * find the ngx object files just in time the earlier implementation was building the nginx source files list at start of build. this will be an empty list in a clean build environment. hence we need to build this list after completion of the build
1 parent ce891c0 commit 3f75f54

File tree

4 files changed

+30
-20
lines changed

4 files changed

+30
-20
lines changed

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[submodule "vendor/cmocka"]
22
path = vendor/cmocka
3-
url = https://github.com/clibs/cmocka.git
3+
url = https://gitlab.com/cmocka/cmocka.git

.travis.yml

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,30 @@
11
language: c
22

3+
os:
4+
- linux
5+
dist: xenial
6+
addons:
7+
apt:
8+
packages:
9+
- libpcre3
10+
- libpcre3-dev
11+
- zlib1g-dev
12+
- libssl-dev
13+
314
env:
4-
matrix:
15+
jobs:
516
# one separate build per nginx version
617
#mainline verion
7-
- NGINX_VERSION=1.13.6
18+
- NGINX_VERSION=1.19.4
819
#stable verions
9-
- NGINX_VERSION=1.12.1
20+
- NGINX_VERSION=1.18.0
1021
#legacy verions
11-
- NGINX_VERSION=1.10.3
12-
- NGINX_VERSION=1.8.1
22+
- NGINX_VERSION=1.16.1
23+
- NGINX_VERSION=1.14.2
1324
global:
14-
- NGX_PATH=~/nginx
1525
- LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib
1626

17-
sudo: true
18-
19-
before_install:
20-
- sudo apt-get install libpcre3 libpcre3-dev zlib1g-dev libssl-dev
21-
- cd && wget https://nginx.org/download/nginx-$NGINX_VERSION.tar.gz && tar -xvzf nginx-$NGINX_VERSION.tar.gz && ln -s nginx-$NGINX_VERSION $NGX_PATH
22-
- cd $NGX_PATH && ./configure --with-http_ssl_module --add-module=$TRAVIS_BUILD_DIR
23-
- cd $TRAVIS_BUILD_DIR && make nginx
24-
2527
script:
26-
- make test
28+
make prepare-travis-env nginx test
29+
30+
# vim: ts=2 sw=2

Makefile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,16 @@ all:
77
%.o: %.c
88
$(CC) -c -o $@ $< $(CFLAGS)
99

10-
.PHONY: all clean test nginx
10+
.PHONY: all clean test nginx prepare-travis-env
1111

1212

13-
NGX_OBJS := $(shell find ${NGX_PATH}/objs -name \*.o)
13+
NGX_PATH := $(shell echo `pwd`/nginx)
14+
15+
prepare-travis-env:
16+
wget --no-verbose https://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz
17+
tar -xzf nginx-${NGINX_VERSION}.tar.gz
18+
ln -s nginx-${NGINX_VERSION} ${NGX_PATH}
19+
cd ${NGX_PATH} && ./configure --with-http_ssl_module --add-module=${TRAVIS_BUILD_DIR}
1420

1521
nginx:
1622
cd ${NGX_PATH} && rm -rf ${NGX_PATH}/objs/src/core/nginx.o && make
@@ -24,7 +30,7 @@ vendor/cmocka:
2430
test: .cmocka_build | nginx
2531
strip -N main -o ${NGX_PATH}/objs/src/core/nginx_without_main.o ${NGX_PATH}/objs/src/core/nginx.o \
2632
&& mv ${NGX_PATH}/objs/src/core/nginx_without_main.o ${NGX_PATH}/objs/src/core/nginx.o \
27-
&& $(CC) test_suite.c $(CFLAGS) -o test_suite -lcmocka ${NGX_OBJS} -ldl -lpthread -lcrypt -lssl -lpcre -lcrypto -lz \
33+
&& $(CC) test_suite.c $(CFLAGS) -o test_suite -lcmocka `find ${NGX_PATH}/objs -name \*.o` -ldl -lpthread -lcrypt -lssl -lpcre -lcrypto -lz \
2834
&& ./test_suite
2935

3036
clean:

vendor/cmocka

Submodule cmocka updated from c819db0 to f5e2cd7

0 commit comments

Comments
 (0)