summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorLukas Larsson <lukas@erlang.org>2020-11-03 14:04:48 +0100
committerLukas Larsson <lukas@erlang.org>2021-01-07 14:38:56 +0100
commit0eaa18bf9caf6394f2b0b8b4e76770c745ceb049 (patch)
tree40028809c5470e8c4bbdc081e9952e05ac68530a /.github
parent8c1c3341ad8d8348df70bea2fe48354b7aa86de6 (diff)
downloaderlang-0eaa18bf9caf6394f2b0b8b4e76770c745ceb049.tar.gz
otp: Add -Werror to github actions checks
This check is made for both compilation with clang and gcc
Diffstat (limited to '.github')
-rw-r--r--.github/dockerfiles/Dockerfile.32-bit8
-rw-r--r--.github/dockerfiles/Dockerfile.64-bit8
-rw-r--r--.github/dockerfiles/Dockerfile.cross-compile32
-rw-r--r--.github/dockerfiles/Dockerfile.ubuntu-base2
-rwxr-xr-x.github/scripts/init-pre-release.sh7
-rw-r--r--.github/workflows/main.yaml19
6 files changed, 60 insertions, 16 deletions
diff --git a/.github/dockerfiles/Dockerfile.32-bit b/.github/dockerfiles/Dockerfile.32-bit
index 8d955a46e4..fd64b40c4e 100644
--- a/.github/dockerfiles/Dockerfile.32-bit
+++ b/.github/dockerfiles/Dockerfile.32-bit
@@ -12,7 +12,13 @@ RUN cd /buildroot && tar -xzf ./otp.tar.gz
WORKDIR /buildroot/otp/
-RUN ./configure --prefix=/otp && make && make install && \
+ENV CFLAGS="-O2 -g -Werror"
+
+## Configure, check that no application are disabled, then make and then build doc chunks
+RUN ./configure --prefix=/otp && \
+ if cat lib/*/CONF_INFO || cat lib/*/SKIP || cat lib/SKIP-APPLICATIONS; then exit 1; fi
+
+RUN make && make install && \
make install-docs DOC_TARGETS=chunks
RUN TESTSUITE_ROOT=/tests ./otp_build tests
diff --git a/.github/dockerfiles/Dockerfile.64-bit b/.github/dockerfiles/Dockerfile.64-bit
index c651cbc618..2074b364e2 100644
--- a/.github/dockerfiles/Dockerfile.64-bit
+++ b/.github/dockerfiles/Dockerfile.64-bit
@@ -15,7 +15,13 @@ RUN cd /buildroot && tar -xzf ./otp.tar.gz
WORKDIR /buildroot/otp/
-RUN ./configure --prefix=/otp && make && make install
+ENV CC=clang CXX=clang++ \
+ CFLAGS="-O2 -g -Werror"
+
+## Configure, check that no application are disabled and then make
+RUN ./configure --prefix=/otp && \
+ if cat lib/*/CONF_INFO || cat lib/*/SKIP || cat lib/SKIP-APPLICATIONS; then exit 1; fi && \
+ make && make install
RUN TESTSUITE_ROOT=/tests ./otp_build tests
diff --git a/.github/dockerfiles/Dockerfile.cross-compile b/.github/dockerfiles/Dockerfile.cross-compile
index 868f8beed1..43aeedfe96 100644
--- a/.github/dockerfiles/Dockerfile.cross-compile
+++ b/.github/dockerfiles/Dockerfile.cross-compile
@@ -9,38 +9,48 @@ ARG HOST_TRIP=x86_64-linux-gnu
ARG MAKEFLAGS=-j4
ENV MAKEFLAGS=$MAKEFLAGS \
ERLC_USE_SERVER=yes \
- ERL_TOP=/buildroot/otp
+ ERL_TOP=/buildroot/bootstrap/otp
+
+WORKDIR /buildroot/bootstrap
ARG ARCHIVE=./otp.tar.gz
COPY $ARCHIVE /buildroot/otp.tar.gz
-RUN cd /buildroot && tar xzf ./otp.tar.gz
-
-WORKDIR /buildroot/otp/
+RUN tar xzf ../otp.tar.gz
## Build the bootstrap system
-RUN ./configure && make && make install
+RUN cd $ERL_TOP && CFLAGS="-Wall -O2 -g" ./configure && make && make install
## Build pre-build tar ball
-RUN scripts/build-otp-tar -o /buildroot/otp_clean_src.tar.gz /buildroot/otp_src.tar.gz -b /buildroot/otp/ /buildroot/otp.tar.gz
+RUN cd $ERL_TOP && scripts/build-otp-tar -o /buildroot/otp_clean_src.tar.gz /buildroot/otp_src.tar.gz -b /buildroot/bootstrap/otp/ /buildroot/otp.tar.gz
## Prepare for a new build using pre-built tar ball
-RUN cd .. && rm -rf otp && tar -xzf ./otp_src.tar.gz
+RUN cd ../ && tar -xzf ./otp_src.tar.gz
ENV HOST=$HOST_TRIP \
CC=$HOST_TRIP-gcc \
+ CPPFLAGS="--sysroot=/buildroot/sysroot" \
+ CFLAGS="--sysroot=/buildroot/sysroot -O2 -g -Werror" \
CPP=$HOST_TRIP-cpp \
CXX=$HOST_TRIP-g++ \
LD=$CC \
- DED_LDFLAGS="-shared -Wl,-Bsymbolic" \
+ LD_FLAGS="--sysroot=/buildroot/sysroot" \
+ DED_CFLAGS="$CFLAGS" \
+ DED_LDFLAGS="$LDFLAGS -shared -Wl,-Bsymbolic" \
RANLIB=$HOST_TRIP-ranlib \
AR=$HOST_TRIP-ar \
- erl_xcomp_sysroot=/buildroot/sysroot
+ erl_xcomp_sysroot=/buildroot/sysroot \
+ ERL_TOP=/buildroot/otp
+
+WORKDIR /buildroot/otp
## Build the cross system
-RUN ./configure --prefix=/otp/ --host=$HOST --build=`erts/autoconf/config.guess` && \
- make && make install
+RUN ./configure --prefix=/otp/ --host=$HOST --build=`erts/autoconf/config.guess`
+RUN OTP_SMALL_BUILD=true V=1 make
+
+RUN make odbc && make install
## Build the cross tests
+ENV CFLAGS="--sysroot=/buildroot/sysroot -O2 -g"
RUN ./otp_build tests
RUN cd release/tests/test_server && \
erl -sname test@docker -noshell -eval "ts:install([{cross,\"yes\"},{crossflags,[{\"host\",\"$HOST\"}]},{crossroot,\"/$ERL_TOP\"}])." -s ts compile_testcases -s init stop
diff --git a/.github/dockerfiles/Dockerfile.ubuntu-base b/.github/dockerfiles/Dockerfile.ubuntu-base
index a93c8a28f0..fbfe2470c7 100644
--- a/.github/dockerfiles/Dockerfile.ubuntu-base
+++ b/.github/dockerfiles/Dockerfile.ubuntu-base
@@ -9,5 +9,5 @@ ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get -y upgrade && \
- apt-get install -y build-essential m4 autoconf fop xsltproc clang-format \
+ apt-get install -y build-essential m4 autoconf fop xsltproc clang clang-format \
default-jdk libxml2-utils $INSTALL_LIBS
diff --git a/.github/scripts/init-pre-release.sh b/.github/scripts/init-pre-release.sh
index 97378a0978..f000b250fe 100755
--- a/.github/scripts/init-pre-release.sh
+++ b/.github/scripts/init-pre-release.sh
@@ -12,7 +12,10 @@ find . -name config.h.in | xargs git add -f
find . -name config.guess | xargs git add -f
find . -name config.sub | xargs git add -f
find . -name install-sh | xargs git add -f
-git config user.email "you@example.com"
-git config user.name "Your Name"
+if ! git config user.name; then
+ git config user.email "you@example.com"
+ git config user.name "Your Name"
+fi
git commit --no-verify -m 'Add generated configure files'
git archive --prefix otp/ -o otp_src.tar.gz HEAD
+git reset --hard HEAD~1
diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml
index 13c5d729f4..5e64d6fb9a 100644
--- a/.github/workflows/main.yaml
+++ b/.github/workflows/main.yaml
@@ -52,6 +52,25 @@ jobs:
## the base debian image.
- name: Docker login
run: docker login https://docker.pkg.github.com -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}
+ - name: Build base image
+ run: |
+ BASE_TAG=$(grep "^FROM" .github/dockerfiles/Dockerfile.${{ matrix.type }} | head -1 | awk '{print $2}')
+ docker pull "${BASE_TAG}"
+ case "${BASE_TAG}" in
+ */i386-debian-base)
+ docker build -t "${BASE_TAG}" \
+ --build-arg BASE=i386/debian -f .github/dockerfiles/Dockerfile.debian-base .
+ ;;
+ */debian-base)
+ docker build -t "${BASE_TAG}" \
+ -f .github/dockerfiles/Dockerfile.debian-base .
+ ;;
+ */ubuntu-base)
+ docker build -t "${BASE_TAG}" \
+ -f .github/dockerfiles/Dockerfile.ubuntu-base .
+ ;;
+ esac
+
- name: Build ${{ matrix.type }} image
run: |
docker build -t otp --build-arg ARCHIVE=otp_src.tar.gz \