Skip to content

Commit

Permalink
Merge branch 'master' into cx/windows-arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
cocoa-xu authored May 20, 2024
2 parents 0641273 + 40568b0 commit f61d617
Show file tree
Hide file tree
Showing 1,738 changed files with 83,639 additions and 63,311 deletions.
18 changes: 6 additions & 12 deletions .github/actions/build-base-image/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,18 @@ runs:
using: composite
steps:
- name: Cleanup GH Runner
shell: bash -euo pipefail {0}
run: |
## Delete large files from runner to get more disk space
## See https://github.com/actions/runner-images/issues/2840
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
shell: bash
run: .github/scripts/cleanup_gh_runner.sh

- name: Cache BASE image
uses: actions/[email protected].0
uses: actions/[email protected].2
if: inputs.TYPE == '64-bit' || inputs.TYPE == 'clang'
with:
path: otp_docker_base.tar
key: ${{ runner.os }}-${{ hashFiles('.github/dockerfiles/Dockerfile.ubuntu-base', '.github/scripts/build-base-image.sh') }}-${{ hashFiles('OTP_VERSION') }}

- name: Docker login
uses: docker/login-action@v3.0.0
uses: docker/login-action@v3.1.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
Expand All @@ -45,13 +39,13 @@ runs:

- name: Cache pre-built src
if: inputs.BUILD_IMAGE == 'true'
uses: actions/[email protected].0
uses: actions/[email protected].2
with:
path: otp_src.tar.gz
key: prebuilt-src-${{ github.ref_name }}-${{ github.sha }}
- name: Cache pre-built binaries
if: inputs.BUILD_IMAGE == 'true'
uses: actions/[email protected].0
uses: actions/[email protected].2
with:
path: otp_cache.tar.gz
key: prebuilt-cache-${{ inputs.TYPE }}-${{ github.ref_name }}-${{ github.sha }}
Expand Down
2 changes: 1 addition & 1 deletion .github/dockerfiles/Dockerfile.32-bit
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN cd /buildroot && tar -xzf ./otp.tar.gz

WORKDIR /buildroot/otp/

ENV CFLAGS="-O2 -g -Werror"
ENV CFLAGS="-O2 -g -Werror -DwxSTC_DISABLE_MACRO_DEPRECATIONS=1"

## Configure, check that no application are disabled, then make and then build doc chunks
RUN ./configure --with-ssl --prefix=/otp && \
Expand Down
2 changes: 1 addition & 1 deletion .github/dockerfiles/Dockerfile.64-bit
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN cd /buildroot && tar -xzf ./otp.tar.gz

WORKDIR /buildroot/otp/

ENV CFLAGS="-O2 -g -Werror"
ENV CFLAGS="-O2 -g -Werror -DwxSTC_DISABLE_MACRO_DEPRECATIONS=1"

## Configure (if not cached), check that no application are disabled and then make
RUN if [ ! -f Makefile ]; then \
Expand Down
2 changes: 1 addition & 1 deletion .github/dockerfiles/Dockerfile.clang
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN cd /buildroot && tar -xzf ./otp.tar.gz
WORKDIR /buildroot/otp/

ENV CC=clang CXX=clang++ \
CFLAGS="-O2 -g -Werror"
CFLAGS="-O2 -g -Werror -DwxSTC_DISABLE_MACRO_DEPRECATIONS=1"

## Configure, check that no application are disabled and then make
# We need --with-ssl-lib-subdir=lib/x86_64-linux-gnu since clang does not
Expand Down
2 changes: 1 addition & 1 deletion .github/dockerfiles/Dockerfile.cross-compile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ RUN cd $ERL_TOP && CFLAGS="-Wall -O2 -g" ./configure && make && make install
ENV HOST=$HOST_TRIP \
CC=$HOST_TRIP-gcc \
CPPFLAGS="--sysroot=/buildroot/sysroot" \
CFLAGS="--sysroot=/buildroot/sysroot -O2 -g -Werror" \
CFLAGS="--sysroot=/buildroot/sysroot -O2 -g -Werror -DwxSTC_DISABLE_MACRO_DEPRECATIONS=1" \
CPP=$HOST_TRIP-cpp \
CXX=$HOST_TRIP-g++ \
LD=$CC \
Expand Down
14 changes: 7 additions & 7 deletions .github/dockerfiles/Dockerfile.debian-base
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
##
## This docker file will build a base image for building Erlang/OTP
##
ARG BASE=debian:bullseye
ARG BASE=debian:bookworm
FROM $BASE
## Need to have a second arg here as the first does not expose the $BASE in the script below
ARG BASE=debian:bullseye
ARG BASE=debian:bookworm

ARG HOST_TRIP=x86_64-linux-gnu
ENV HOST_TRIP=$HOST_TRIP
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8

ENV INSTALL_LIBS="zlib1g-dev libncurses5-dev libssl-dev unixodbc-dev libgmp3-dev libwxgtk3.0-gtk3-dev libwxgtk-webview3.0-gtk3-dev libsctp-dev lksctp-tools"
ENV CROSS_LIBS="zlib1g-dev libncurses5-dev libssl-dev unixodbc-dev libgmp3-dev libwxgtk3.0-gtk3-dev libsctp-dev lksctp-tools"
ENV INSTALL_LIBS="zlib1g-dev libncurses5-dev libssl-dev unixodbc-dev libwxgtk3.2-dev libwxgtk-webview3.2-dev libsctp-dev lksctp-tools"
ENV CROSS_LIBS="$INSTALL_LIBS"

## See https://wiki.debian.org/Multiarch/HOWTO for details on how to install things
##
## 1. Install build-essential to get access to dpkg-architecture
## 2. Use dpkg-architecture to figure out what we are running on
## 3. If the HOST_TRIP does not equal BUILD_TRIP we should cross compile
RUN apt-get update && apt-get -y upgrade && apt-get install -y build-essential && \
RUN apt-get update && apt-get -y upgrade && apt-get install -y build-essential pkg-config && \
BUILD_TRIP=`dpkg-architecture -t${HOST_TRIP} -qDEB_BUILD_MULTIARCH` && \
BUILD_ARCH=`dpkg-architecture -t${HOST_TRIP} -qDEB_BUILD_ARCH` && \
if [ "$HOST_TRIP" != "$BUILD_TRIP" ]; then \
HOST_ARCH=`dpkg-architecture -t${HOST_TRIP} -qDEB_HOST_ARCH` && \
dpkg --add-architecture $HOST_ARCH && \
sed -i "s:deb http:deb [arch=$BUILD_ARCH,$HOST_ARCH] http:g" /etc/apt/sources.list; \
sed -i "s@main\n@main\nArch: $BUILD_ARCH,$HOST_ARCH@g" /etc/apt/sources.list.d/debian.sources; \
fi && \
apt-get update && \
apt-get install -y build-essential m4 autoconf default-jdk \
Expand All @@ -42,5 +42,5 @@ RUN apt-get update && apt-get -y upgrade && apt-get install -y build-essential &
cp -r $dir/* `dirname /buildroot/sysroot$dir`; \
done; \
fi && \
update-alternatives --set wx-config /usr/lib/${BUILD_TRIP}/wx/config/gtk3-unicode-3.0 && \
update-alternatives --set wx-config /usr/lib/${BUILD_TRIP}/wx/config/gtk3-unicode-3.2 && \
rm -rf /var/lib/apt/lists/*
52 changes: 19 additions & 33 deletions .github/dockerfiles/Dockerfile.ubuntu-base
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ RUN echo "Europe/Stockholm" > /etc/timezone && \
ln -snf /usr/share/zoneinfo/$(cat /etc/timezone) /etc/localtime && \
if ! grep ":${gid}:$" /etc/group; then groupadd -g ${gid} localgroup; fi && \
if [ ! -d /home/${USER} ]; then useradd -rm -d /home/${USER} -s /bin/sh -g ${gid} -G ${gid},sudo -u ${uid} ${USER}; fi && \
echo "${USER} ALL=(ALL:ALL) NOPASSWD: ALL" > /etc/sudoers.d/${USER} && \
echo "/buildroot/** r," >> /etc/apparmor.d/local/usr.sbin.named && \
echo "/tests/** r," >> /etc/apparmor.d/local/usr.sbin.named
echo "${USER} ALL=(ALL:ALL) NOPASSWD: ALL" > /etc/sudoers.d/${USER}

## Java and log4j are used by fop to build documentation
COPY --chown=${USER}:${GROUP} dockerfiles/log4j.properties /home/${USER}/
Expand All @@ -47,19 +45,21 @@ RUN mkdir /buildroot /tests /otp && chown ${USER}:${GROUP} /buildroot /tests /ot

## We install the latest version of the previous three releases in order to do
## backwards compatability testing of Erlang.
RUN apt-get install -y git curl && \
curl -L https://raw.githubusercontent.com/kerl/kerl/3.1.0/kerl > /usr/bin/kerl && \
RUN apt-get update && apt-get install -y git curl && \
curl -L https://raw.githubusercontent.com/kerl/kerl/master/kerl > /usr/bin/kerl && \
chmod +x /usr/bin/kerl && \
kerl update releases && \
LATEST=$(kerl list releases | tail -1 | awk -F '.' '{print $1}') && \
LATEST=$(kerl list releases | grep "\*$" | tail -1 | awk -F '.' '{print $1}') && \
for release in $(seq $(( LATEST - 2 )) $(( LATEST ))); do \
VSN=$(kerl list releases | grep "^$release" | tail -1); \
VSN=$(kerl list releases | grep "^$release" | tail -1 | awk '{print $1}'); \
if [ $release = $LATEST ]; then \
echo "/usr/local/lib/erlang-${VSN}/bin" > /home/${USER}/LATEST; \
echo "${VSN}" > /home/${USER}/LATEST_VSN; \
echo "${release}" > /home/${USER}/LATEST_RELEASE; \
fi && \
echo "Building ${VSN}" && \
kerl build ${VSN} ${VSN} && \
echo "Installing ${VSN} to /usr/local/lib/erlang-${VSN}" && \
kerl install ${VSN} /usr/local/lib/erlang-${VSN}; \
done && \
rm -rf ~/.kerl
Expand All @@ -68,9 +68,9 @@ RUN apt-get install -y git curl && \
## EXTRA_LIBS are installed using a for loop because of bugs in the erlang-doc deb package
## Apache2 may already be installed, if so we do not want to install it again
ARG EXTRA_LIBS="erlang erlang-doc"
RUN apt-get install -y \
RUN apt-get update && apt-get install -y \
unixodbc odbc-postgresql postgresql ssh openssh-server groff-base gdb \
tinyproxy knot ldnsutils expect vsftpd python emacs nano vim \
tinyproxy knot ldnsutils expect vsftpd python3 emacs nano vim \
linux-tools-common linux-tools-generic jq \
xvfb libgl1-mesa-dri && \
for lib in ${EXTRA_LIBS}; do apt-get install -y ${lib}; done && \
Expand All @@ -79,8 +79,8 @@ RUN apt-get install -y linux-tools-$(uname -r) || true

## We use tmux to test terminals
RUN apt-get install -y libevent-dev libutf8proc-dev && \
cd /tmp && wget https://github.com/tmux/tmux/releases/download/3.2a/tmux-3.2a.tar.gz && \
tar xvzf tmux-3.2a.tar.gz && cd tmux-3.2a && \
cd /tmp && wget https://github.com/tmux/tmux/releases/download/3.3a/tmux-3.3a.tar.gz && \
tar xvzf tmux-3.3a.tar.gz && cd tmux-3.3a && \
./configure --enable-static --enable-utf8proc && \
make && make install

Expand All @@ -106,42 +106,28 @@ COPY --chown=${USER}:${GROUP} dockerfiles/init.sh /buildroot/

WORKDIR /buildroot/

## Build and install elixir, hex and ex_doc
ENV ELIXIR_VSN=latest \
HEX_VSN=latest \
EX_DOC_VSN=latest
## Build and install elixir and hex
ENV ELIXIR_VSN=latest
RUN export PATH="$(cat /home/${USER}/LATEST):${PATH}" && \
set -x && \
mkdir /buildroot/elixir && cd /buildroot/elixir && \
curl -s https://api.github.com/repos/elixir-lang/elixir/releases/${ELIXIR_VSN} | \
jq '.tarball_url' | xargs curl -L > elixir.tar.gz && \
tar xzf elixir.tar.gz --strip-components=1 && \
make && sudo make install && \
mkdir /buildroot/hex && cd /buildroot/hex && \
curl -s https://api.github.com/repos/hexpm/hex/releases/${HEX_VSN} | \
jq '.tarball_url' | xargs curl -L > hex.tar.gz && \
tar xzf hex.tar.gz --strip-components=1 && \
mix install && \
mkdir /buildroot/ex_doc && cd /buildroot/ex_doc && \
curl -s https://api.github.com/repos/elixir-lang/ex_doc/releases/${EX_DOC_VSN} | \
jq '.tarball_url' | xargs curl -L > ex_doc.tar.gz && \
tar xzf ex_doc.tar.gz --strip-components=1 && \
mix deps.get && MIX_ENV=prod mix escript.build && \
sudo cp ex_doc /usr/local/bin/

## Install test tools rebar3, proper and jsx
mix archive.install github hexpm/hex branch latest --force

## Install test tools rebar3 and proper
RUN export PATH="$(cat /home/${USER}/LATEST):${PATH}" && \
latest () { \
local VSN=$(curl -sL "https://api.github.com/repos/$1/tags" | jq -r ".[] | .name" | grep -E '^v?[0-9]' | sort -V | tail -1); \
curl -sL "https://github.com/$1/archive/$VSN.tar.gz" > $(basename $1).tar.gz; \
} && \
latest erlang/rebar3 && ls -la && \
latest erlang/rebar3 && \
(tar xzf rebar3.tar.gz && cd rebar3-* && ./bootstrap && sudo cp rebar3 /usr/bin) && \
latest proper-testing/proper && \
(tar xzf proper.tar.gz && mv proper-* proper && cd proper && make) && \
latest talentdeficit/jsx && \
(tar xzf jsx.tar.gz && mv jsx-* jsx && cd jsx && rebar3 compile)
(tar xzf proper.tar.gz && mv proper-* proper && cd proper && make)

ENV ERL_LIBS=/buildroot/proper:/buildroot/jsx
ENV ERL_LIBS=/buildroot/proper

ENTRYPOINT ["/buildroot/init.sh"]
6 changes: 3 additions & 3 deletions .github/scripts/build-base-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ fi

case "${BASE_TAG}" in
*i386-debian-base)
BASE="i386/debian:bullseye"
BASE="i386/debian:bookworm"
BASE_TYPE=debian-base
;;
*debian-base)
BASE="debian:bullseye"
BASE="debian:bookworm"
BASE_TYPE=debian-base
;;
*ubuntu-base)
BASE="ubuntu:20.04"
BASE="ubuntu:22.04"
BASE_TYPE=ubuntu-base
;;
esac
Expand Down
24 changes: 24 additions & 0 deletions .github/scripts/c-code-path-filters.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

cat <<EOF
changes:
- 'erts/**'
- 'make/**'
- 'lib/Makefile'
- 'Makefile.in'
- 'otp_build'
- 'configure'
EOF

APPS=$(ls -d lib/*/doc | awk -F '/' '{print $2}')
for app in $APPS; do
if find lib/$app/ -name '*.c' -o -name '*.h' \
-o -name '*.cpp' -o -name '*.hpp' \
-o -name '*.in' -o -name '*.ac' \
-o -name 'configure' \
| grep -v "lib/$app/test" \
| grep -v "lib/$app/examples"\
| grep . > /dev/null; then
echo " - 'lib/$app/**'"
fi
done
12 changes: 12 additions & 0 deletions .github/scripts/cleanup_gh_runner.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

set -euo pipefail {0}

## Delete large files from runner to get more disk space
## See https://github.com/actions/runner-images/issues/2840
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
docker system prune -a -f
df -h
5 changes: 3 additions & 2 deletions .github/scripts/pr-comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,14 @@ module.exports = async({ github, context, state, pr_number }) => {

console.log(`ct_body: ${ct_body}`);

const repoURL = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}`
const body = `${ct_body}
<!-- marker -->
To speed up review, make sure that you have read [Contributing to Erlang/OTP](/${context.repo.owner}/${context.repo.repo}/blob/master/CONTRIBUTING.md) and that all [checks](/${context.repo.owner}/${context.repo.repo}/pull/${pr_number}/checks) pass.
To speed up review, make sure that you have read [Contributing to Erlang/OTP](${repoURL}/blob/master/CONTRIBUTING.md) and that all [checks](${repoURL}/pull/${pr_number}/checks) pass.
See the [TESTING](/${context.repo.owner}/${context.repo.repo}/blob/master/HOWTO/TESTING.md) and [DEVELOPMENT](/${context.repo.owner}/${context.repo.repo}/blob/master/HOWTO/DEVELOPMENT.md) HowTo guides for details about how to run test locally.
See the [TESTING](${repoURL}/blob/master/HOWTO/TESTING.md) and [DEVELOPMENT](${repoURL}/blob/master/HOWTO/DEVELOPMENT.md) HowTo guides for details about how to run test locally.
## Artifacts
* ` + (ct_logs ? `[Complete CT logs](https://erlang.github.io/prs/${pr_number}/ct_logs/index.html) ([Download Logs](${nightlyURL(ct_logs)}))` : "No CT logs found") + `
Expand Down
6 changes: 6 additions & 0 deletions .github/scripts/restore-from-prebuilt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ if [ -n "${ARCHIVE}" ]; then
echo "::group::{Run ${i} at pruning cache}"

## rlpgoD is the same as --archive, but without --times
## If you update this, make sure to update the update after the loop as well
RSYNC_ARGS=(-rlpgoD --itemize-changes --verbose --checksum --update "${EXCLUDE_BOOTSTRAP[@]}" "${ARCHIVE_DIR}/otp/" "${CACHE_DIR}/")

## We do a dry run to see if we need to purge anything from cache
Expand Down Expand Up @@ -148,11 +149,13 @@ if [ -n "${ARCHIVE}" ]; then
if grep "$(basename "${pt}")" "${CHANGES}"; then
echo "Deleting entire cache as a parse transform has changed" >&2
rm -rf "${CACHE_DIR:?}/"
break
fi
done

## The cache was deleted, so break and don't use it
if [ ! -d "${CACHE_DIR}" ]; then
EXCLUDE_BOOTSTRAP=()
break;
fi

Expand Down Expand Up @@ -192,13 +195,16 @@ if [ -n "${ARCHIVE}" ]; then
if [ "$i" = "10" ]; then
echo "Deleting entire cache as it did not stabalize in trime" >&2
rm -rf "${CACHE_DIR:?}"
EXCLUDE_BOOTSTRAP=()
else
mv "${CHANGES}" "${PREV_CHANGES}"
fi
done

echo "::group::{Sync changes over cached data}"

RSYNC_ARGS=(-rlpgoD --itemize-changes --verbose --checksum --update "${EXCLUDE_BOOTSTRAP[@]}" "${ARCHIVE_DIR}/otp/" "${CACHE_DIR}/")

## Now we do the actual sync
rsync "${RSYNC_ARGS[@]}"
fi
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/actions-updater.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ jobs:
steps:
- name: Generate token
id: generate_token
uses: actions/create-github-app-token@v1.7.0
uses: actions/create-github-app-token@v1.9.3
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PEM }}

- uses: actions/[email protected].1
- uses: actions/[email protected].4
with:
token: ${{ steps.generate_token.outputs.token }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/add-to-project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ jobs:
steps:
- name: Generate token
id: generate_token
uses: actions/create-github-app-token@v1.7.0
uses: actions/create-github-app-token@v1.9.3
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PEM }}

- uses: actions/add-to-project@v0.5.0
- uses: actions/add-to-project@v1.0.1
with:
project-url: https://github.com/orgs/erlang/projects/13
github-token: ${{ steps.generate_token.outputs.token }}
Loading

0 comments on commit f61d617

Please sign in to comment.