Skip to content

Commit 1296bf4

Browse files
Merge branch 'master' into releng#1062-add-github-action-for-detect-secrets
2 parents ce233e7 + 41f5ee8 commit 1296bf4

2,655 files changed

Lines changed: 140772 additions & 137309 deletions

File tree

Some content is hidden

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

.devcontainer/devcontainer.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.194.0/containers/cpp
3+
{
4+
"name": "Erlang/OTP",
5+
"build": {
6+
"dockerfile": "../.github/dockerfiles/Dockerfile.ubuntu-base",
7+
"context": "../.github",
8+
"args": {
9+
"BASE": "mcr.microsoft.com/vscode/devcontainers/base:focal",
10+
"USER": "vscode",
11+
"GROUP": "vscode"
12+
}
13+
},
14+
"runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined"],
15+
16+
// Set *default* container specific settings.json values on container create.
17+
"settings": {},
18+
19+
// Add the IDs of extensions you want installed when the container is created.
20+
"extensions": [
21+
"ms-vscode.cpptools",
22+
"erlang-ls.erlang-ls" ],
23+
24+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
25+
// "forwardPorts": [],
26+
27+
// Use 'postCreateCommand' to run commands after the container is created.
28+
// "postCreateCommand": "gcc -v",
29+
30+
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
31+
"remoteUser": "vscode"
32+
}

.dir-locals.el

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
(
33
(erlang-mode (indent-tabs-mode . nil))
44
(autoconf-mode (indent-tabs-mode . nil))
5+
(m4-mode (indent-tabs-mode . nil))
56
(java-mode (indent-tabs-mode . nil))
67
(perl-mode (indent-tabs-mode . nil))
78
(xml-mode (indent-tabs-mode . nil))

.github/dockerfiles/Dockerfile.32-bit

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM docker.pkg.github.com/erlang/otp/i386-debian-base
1+
ARG BASE=docker.pkg.github.com/erlang/otp/i386-debian-base
2+
FROM $BASE
23

34
ARG MAKEFLAGS=-j4
45
ENV MAKEFLAGS=$MAKEFLAGS \
@@ -16,14 +17,8 @@ ENV CFLAGS="-O2 -g -Werror"
1617

1718
## Configure, check that no application are disabled, then make and then build doc chunks
1819
RUN ./configure --with-ssl --prefix=/otp && \
19-
if cat lib/*/CONF_INFO || cat lib/*/SKIP || cat lib/SKIP-APPLICATIONS; then exit 1; fi
20-
21-
RUN make && make install && \
22-
make install-docs DOC_TARGETS=chunks
20+
if cat lib/*/CONF_INFO || cat lib/*/SKIP || cat lib/SKIP-APPLICATIONS; then exit 1; fi && \
21+
make && make install
2322

2423
## Disable -Werror as testcases do not compile with it on
2524
ENV CFLAGS="-O2 -g"
26-
27-
RUN TESTSUITE_ROOT=/tests ./otp_build tests
28-
29-
ENTRYPOINT ["bash","-c"]
Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,24 @@
1-
FROM docker.pkg.github.com/erlang/otp/ubuntu-base
2-
## We do a SSA lint check here
3-
ENV ERL_COMPILER_OPTIONS=ssalint
1+
ARG BASE=docker.pkg.github.com/erlang/otp/ubuntu-base
2+
FROM $BASE
43

54
ARG MAKEFLAGS=-j4
65
ENV MAKEFLAGS=$MAKEFLAGS \
7-
ERLC_USE_SERVER=yes \
8-
ERL_TOP=/buildroot/otp \
9-
PATH=/buildroot/otp/bin:$PATH
6+
ERLC_USE_SERVER=yes \
7+
ERL_TOP=/buildroot/otp \
8+
PATH=/otp/bin:/buildroot/otp/bin:$PATH
109

1110
ARG ARCHIVE=./otp.tar.gz
1211
COPY $ARCHIVE /buildroot/otp.tar.gz
1312
RUN cd /buildroot && tar -xzf ./otp.tar.gz
1413

1514
WORKDIR /buildroot/otp/
1615

17-
ENV CC=clang CXX=clang++ \
18-
CFLAGS="-O2 -g -Werror"
16+
ENV CFLAGS="-O2 -g -Werror"
1917

2018
## Configure, check that no application are disabled and then make
21-
# We need --with-ssl-lib-subdir=lib/x86_64-linux-gnu since clang does not
22-
# give us this information such as gcc does...
23-
RUN ./configure --with-ssl --with-ssl-lib-subdir=lib/x86_64-linux-gnu --prefix=/otp && \
19+
RUN ./configure --prefix=/otp && \
2420
if cat lib/*/CONF_INFO || cat lib/*/SKIP || cat lib/SKIP-APPLICATIONS; then exit 1; fi && \
25-
make && make install
21+
make && sudo make install
2622

2723
## Disable -Werror as testcases do not compile with it on
2824
ENV CFLAGS="-O2 -g"
29-
30-
RUN TESTSUITE_ROOT=/tests ./otp_build tests
31-
32-
ENTRYPOINT ["bash","-c"]
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
ARG BASE=docker.pkg.github.com/erlang/otp/ubuntu-base
2+
FROM $BASE
3+
## We do a SSA lint check here
4+
ENV ERL_COMPILER_OPTIONS=ssalint
5+
6+
ARG MAKEFLAGS=-j4
7+
ENV MAKEFLAGS=$MAKEFLAGS \
8+
ERLC_USE_SERVER=yes \
9+
ERL_TOP=/buildroot/otp \
10+
PATH=/otp/bin:/buildroot/otp/bin:$PATH
11+
12+
RUN sudo apt-get install -y clang
13+
14+
ARG ARCHIVE=./otp.tar.gz
15+
COPY $ARCHIVE /buildroot/otp.tar.gz
16+
RUN cd /buildroot && tar -xzf ./otp.tar.gz
17+
18+
WORKDIR /buildroot/otp/
19+
20+
ENV CC=clang CXX=clang++ \
21+
CFLAGS="-O2 -g -Werror"
22+
23+
## Configure, check that no application are disabled and then make
24+
# We need --with-ssl-lib-subdir=lib/x86_64-linux-gnu since clang does not
25+
# give us this information such as gcc does...
26+
RUN ./configure --with-ssl --with-ssl-lib-subdir=lib/x86_64-linux-gnu --prefix=/otp && \
27+
if cat lib/*/CONF_INFO || cat lib/*/SKIP || cat lib/SKIP-APPLICATIONS; then exit 1; fi && \
28+
make && sudo make install
29+
30+
## Disable -Werror as testcases do not compile with it on
31+
ENV CFLAGS="-O2 -g"

.github/dockerfiles/Dockerfile.cross-compile

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
##
22
## This docker file will build Erlang on 32-bit to 64-bit x86
33
##
4-
FROM docker.pkg.github.com/erlang/otp/i386-debian-base as build
4+
ARG BASE=docker.pkg.github.com/erlang/otp/i386-debian-base
5+
FROM $BASE as build
56

67
ARG MAKEFLAGS=-j4
78
ENV MAKEFLAGS=$MAKEFLAGS \
@@ -17,13 +18,6 @@ RUN tar xzf ../otp.tar.gz
1718
## Build the bootstrap system
1819
RUN cd $ERL_TOP && CFLAGS="-Wall -O2 -g" ./configure && make && make install
1920

20-
## Build pre-build tar ball
21-
RUN cd $ERL_TOP && scripts/build-otp-tar -o /buildroot/otp_clean_src.tar.gz /buildroot/otp_src.tar.gz \
22-
-b /buildroot/bootstrap/otp/ /buildroot/otp.tar.gz
23-
24-
## Prepare for a new build using pre-built tar ball
25-
RUN cd ../ && tar -xzf ./otp_src.tar.gz
26-
2721
ENV HOST=$HOST_TRIP \
2822
CC=$HOST_TRIP-gcc \
2923
CPPFLAGS="--sysroot=/buildroot/sysroot" \
@@ -39,15 +33,16 @@ ENV HOST=$HOST_TRIP \
3933
erl_xcomp_sysroot=/buildroot/sysroot \
4034
ERL_TOP=/buildroot/otp
4135

36+
RUN cd /buildroot && tar xzf otp.tar.gz
37+
4238
WORKDIR /buildroot/otp
4339

4440
## Build the cross system
4541
# We cannot use config.guess for --build since its value clashes with the
4642
# canonical value of host...
47-
RUN ./configure --prefix=/otp/ --host=$HOST --build=x86-pc-linux-gnu
48-
RUN OTP_SMALL_BUILD=true V=1 make
49-
50-
RUN make odbc && make install
43+
RUN ./configure --prefix=/otp/ --host=$HOST --build=x86-pc-linux-gnu && \
44+
OTP_SMALL_BUILD=true V=1 make && \
45+
make install
5146

5247
## Build the cross tests
5348
ENV CFLAGS="--sysroot=/buildroot/sysroot -O2 -g"
@@ -64,5 +59,3 @@ COPY --from=build /otp /otp
6459
COPY --from=build /buildroot/otp/release/tests /tests
6560

6661
ENV PATH=/otp/bin:$PATH
67-
68-
ENTRYPOINT ["bash","-c"]

.github/dockerfiles/Dockerfile.documentation

Lines changed: 0 additions & 23 deletions
This file was deleted.
Lines changed: 66 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,74 @@
11
##
22
## This docker file will build a base image for building Erlang/OTP
33
##
4-
FROM ubuntu
4+
ARG BASE=gitpod/workspace-full
5+
FROM $BASE
56

6-
ENV INSTALL_LIBS="zlib1g-dev libncurses5-dev libssl-dev unixodbc-dev libgmp3-dev libwxbase3.0-dev libwxgtk3.0-gtk3-dev libwxgtk-webview3.0-gtk3-dev libsctp-dev lksctp-tools"
7+
ENV INSTALL_LIBS="zlib1g-dev libncurses5-dev libssl-dev unixodbc-dev libsctp-dev lksctp-tools libgmp3-dev libwxbase3.0-dev libwxgtk3.0-gtk3-dev libwxgtk-webview3.0-gtk3-dev"
8+
9+
ARG EXTRA_LIBS="erlang erlang-doc"
10+
11+
USER root
712

813
ENV DEBIAN_FRONTEND=noninteractive
14+
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
15+
16+
RUN apt-get update && apt-get -y upgrade && \
17+
apt-get install -y build-essential m4 autoconf fop xsltproc \
18+
default-jdk libxml2-utils flex pkg-config \
19+
unixodbc odbc-postgresql postgresql \
20+
tzdata ssh openssh-server groff-base sudo gdb tinyproxy bind9 nsd expect vsftpd python \
21+
linux-tools-common linux-tools-generic linux-tools-`uname -r` \
22+
${INSTALL_LIBS} && \
23+
for lib in ${EXTRA_LIBS}; do apt-get install -y ${lib}; done && \
24+
if [ ! -f /etc/apache2/apache2.conf ]; then apt-get install -y apache2; fi && \
25+
sed -i 's@# en_US.UTF-8@en_US.UTF-8@g' /etc/locale.gen && locale-gen && \
26+
update-alternatives --set wx-config /usr/lib/x86_64-linux-gnu/wx/config/gtk3-unicode-3.0
27+
28+
## EXTRA_LIBS are installed using a for loop because of bugs in the erlang-doc deb package
29+
## Apache2 may already be installed, if so we do not want to install it again
30+
31+
ENV LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8
32+
33+
ARG USER=gitpod
34+
ARG GROUP=gitpod
35+
ARG gid=10
36+
ARG uid=421
37+
38+
RUN echo "Europe/Stockholm" > /etc/timezone && \
39+
ln -snf /usr/share/zoneinfo/$(cat /etc/timezone) /etc/localtime && \
40+
if [ ! -d /home/${USER} ]; then useradd -rm -d /home/${USER} -s /bin/sh -g ${gid} -G ${gid},sudo -u ${uid} ${USER}; fi && \
41+
echo "${USER} ALL=(ALL:ALL) NOPASSWD: ALL" > /etc/sudoers.d/${USER} && \
42+
echo "/buildroot/** r," >> /etc/apparmor.d/local/usr.sbin.named && \
43+
echo "/tests/** r," >> /etc/apparmor.d/local/usr.sbin.named
44+
45+
## Setup progres so that the odbc test can run
46+
USER postgres
47+
48+
RUN service postgresql start && \
49+
psql -c "CREATE USER odbctest WITH SUPERUSER PASSWORD 'odbctest';" && \
50+
createdb -O odbctest odbctest && \
51+
service postgresql stop
52+
53+
COPY --chown=root:${GROUP} dockerfiles/odbc.ini /etc/
54+
COPY --chown=root:${GROUP} dockerfiles/odbcinst.ini /etc/
55+
56+
USER ${USER}
57+
58+
## Need to set USER and create a keygen file for ssh tests to pass
59+
ENV USER=${USER}
60+
RUN ssh-keygen -q -t rsa -N '' -f $HOME/.ssh/id_rsa && \
61+
cp $HOME/.ssh/id_rsa.pub $HOME/.ssh/authorized_keys
62+
63+
## Java and log4j are used by fop to build documentation
64+
COPY --chown=${USER}:${GROUP} dockerfiles/log4j.properties /home/${USER}/
65+
ENV OTP_STRICT_INSTALL=yes \
66+
JAVA_ARGS="-Dlog4j.configuration=file://home/${USER}/log4j.properties"
67+
68+
RUN sudo mkdir /buildroot /tests /otp && sudo chown ${USER}:${GROUP} /buildroot /tests /otp
69+
70+
COPY --chown=${USER}:${GROUP} dockerfiles/init.sh /buildroot/
971

10-
RUN apt-get update && \
11-
apt-get -y upgrade && \
12-
apt-get install -y build-essential m4 autoconf fop xsltproc clang clang-format \
13-
default-jdk libxml2-utils $INSTALL_LIBS
72+
## TODO: Build Erlang versions N, N-1 and N-2 for compatability testing.
1473

15-
RUN update-alternatives --set wx-config /usr/lib/x86_64-linux-gnu/wx/config/gtk3-unicode-3.0
74+
ENTRYPOINT ["/buildroot/init.sh"]

.github/dockerfiles/init.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
3+
sudo mkdir -p -m0755 /var/run/sshd
4+
5+
sudo /usr/sbin/sshd
6+
7+
sudo service postgresql start
8+
9+
sudo -E bash -c "apt-get update && apt-get install -y linux-tools-common linux-tools-generic linux-tools-`uname -r`"
10+
11+
exec /bin/bash -c "$1"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
log4j.rootLogger = INFO, console
2+
3+
log4j.appender.console = org.apache.log4j.ConsoleAppender
4+
5+
log4j.appender.console.layout = org.apache.log4j.PatternLayour
6+
log4j.appender.console.layout.ConversionPattern = %d [%t] %-5p %c{1} - %m%n
7+
8+
log4j.logger.org.apache.fop = INFO
9+
log4j.logger.org.apache.fop.render = INFO

0 commit comments

Comments
 (0)