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 Aug 19, 2024
2 parents f61d617 + 0b33c5a commit 88a1244
Show file tree
Hide file tree
Showing 860 changed files with 90,732 additions and 101,408 deletions.
2 changes: 1 addition & 1 deletion .github/dockerfiles/Dockerfile.ubuntu-base
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ENV LANG=C.UTF-8 LC_ALL=C.UTF-8

## Install build tools
RUN apt-get update && apt-get -y upgrade && \
apt-get install -y build-essential m4 autoconf \
apt-get install -y build-essential m4 autoconf clang-format \
default-jdk flex pkg-config locales tzdata sudo ${INSTALL_LIBS} && \
sed -i 's@# en_US.UTF-8@en_US.UTF-8@g' /etc/locale.gen && locale-gen && \
update-alternatives --set wx-config /usr/lib/x86_64-linux-gnu/wx/config/gtk3-unicode-3.0
Expand Down
7 changes: 4 additions & 3 deletions .github/scripts/build-base-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ elif [ -f "otp_docker_base/otp_docker_base.tar" ]; then
echo "BASE_BUILD=loaded" >> $GITHUB_OUTPUT
else
if [ "${BASE_USE_CACHE}" != "false" ]; then
docker pull "${BASE_TAG}:${BASE_BRANCH}"
docker tag "${BASE_TAG}:${BASE_BRANCH}" "${BASE_TAG}:latest"
BASE_CACHE="--cache-from ${BASE_TAG}"
if docker pull "${BASE_TAG}:${BASE_BRANCH}"; then
docker tag "${BASE_TAG}:${BASE_BRANCH}" "${BASE_TAG}:latest"
BASE_CACHE="--cache-from ${BASE_TAG}"
fi
fi

BASE_IMAGE_ID=$(docker images -q "${BASE_TAG}:latest")
Expand Down
4 changes: 3 additions & 1 deletion .github/scripts/create-artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@ mkdir ${DIR}
tar -xzf otp_src.tar.gz
mv otp otp_src_${VSN}
tar -czf ${DIR}/otp_src_${VSN}.tar.gz otp_src_${VSN}
mv otp_doc_man.tar.gz ${DIR}/otp_doc_man_${VSN}.tar.gz
if [ -f otp_doc_man.tar.gz ]; then
mv otp_doc_man.tar.gz ${DIR}/otp_doc_man_${VSN}.tar.gz
fi
mv otp_doc_html.tar.gz ${DIR}/otp_doc_html_${VSN}.tar.gz
26 changes: 21 additions & 5 deletions .github/scripts/release-docs.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
#!/bin/sh
#!/bin/bash

docker run -v $PWD/:/github otp "make release docs release_docs && make release_docs DOC_TARGETS='man html pdf' RELEASE_ROOT=/github/docs"
sudo chown -R `whoami` docs
release=${1}
vsn=${2}
if [[ ${release} < 27 ]]; then
docker run -v $PWD/:/github otp "make release docs release_docs && make release_docs DOC_TARGETS='man html pdf' RELEASE_ROOT=/github/docs"
else
case "${vsn}" in
"27.0**")
DOC_TARGETS=html
;;
*)
DOC_TARGETS="html man"
;;
esac
docker run -v $PWD/:/github otp "./otp_build download_ex_doc && make release docs release_docs && make release_docs DOC_TARGETS='${DOC_TARGETS}' RELEASE_ROOT=/github/docs"
fi
sudo chown -R "$(whoami)" docs
cd docs
tar czf ../otp_doc_man.tar.gz man
rm -rf man
if test -x man; then
tar czf ../otp_doc_man.tar.gz man
rm -rf man
fi
tar czf ../otp_doc_html.tar.gz *
87 changes: 68 additions & 19 deletions .github/scripts/sync-github-releases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ HDR=(-H "Authorization: ${TOKEN}")
REPO="https://api.github.com/repos/${REPOSITORY}"

_json_escape () {
printf '```\n%s\n```' "${1}" | python -c 'import json,sys; print(json.dumps(sys.stdin.read()))'
echo "${1}" | python -c 'import json,sys; print(json.dumps(sys.stdin.read()))'
}

_strip_name() {
Expand All @@ -43,9 +43,16 @@ _curl_post() {
-H "Accept: application/vnd.github.v3+json" "${@}"
}

_curl_patch() {
curl -o /dev/null --silent --fail --show-error -X PATCH "${HDR[@]}" \
-H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" \
"${@}"
}

RI=()
ALL_TAGS=()
CREATE_RELEASE=()
UPDATE_BODY=()
TAG_URL="${REPO}/tags?per_page=100"

## This function is used to loop over the pagianated results from github tags
Expand All @@ -72,6 +79,7 @@ while [ "${TAG_URL}" != "" ]; do
}
name=$(_row '.name')
stripped_name=$(_strip_name ${name})
RELEASE_VSN=$(echo "${stripped_name}" | awk -F. '{print $1}')

if echo ${stripped_name} | grep -E "${RELEASE_FILTER}" > /dev/null; then
RELEASE=$(_curl_get "${REPO}/releases/tags/${name}")
Expand All @@ -94,10 +102,34 @@ while [ "${TAG_URL}" != "" ]; do
RI=("${remotename[@]}" "${RI[@]}")
fi
}

## Check if we need to patch the body of the release
if ! echo "${RELEASE}" | jq -e 'select(.body != "")' > /dev/null; then
RELEASE_ID=$(echo "${RELEASE}" | jq '.id')
UPDATE_BODY=("${UPDATE_BODY[@]}" "${name}:${RELEASE_ID}")
if [[ ${RELEASE_VSN} -gt 26 ]]; then
RM="${name}.README.md"
else
RM="${name}.README"
fi
echo "Sync ${RM} for ${name} (for update of release body, release id = ${RELEASE_ID})"
RI=("${RM}" "${RI[@]}")
fi

_asset "${name}.README" "${name}.README" "otp_src_${stripped_name}.readme"
if [[ ${RELEASE_VSN} -gt 26 ]]; then
_asset "${name}.README.md"
fi
_asset "otp_src_${stripped_name}.tar.gz"
_asset "otp_doc_html_${stripped_name}.tar.gz"
_asset "otp_doc_man_${stripped_name}.tar.gz"
case "${stripped_name}" in
27.0**)
## There are no man pages for 27.0 release
;;
*)
_asset "otp_doc_man_${stripped_name}.tar.gz"
;;
esac
case "${stripped_name}" in
22.*.**|21.*.**)
## No need to check for windows releases in 21 and 22 patches
Expand Down Expand Up @@ -142,28 +174,44 @@ done
for name in "${CREATE_RELEASE[@]}"; do
echo "Create release for ${name}"
stripped_name=$(_strip_name ${name})
if [ -s "downloads/${name}.README" ]; then
README=`cat downloads/${name}.README`
if [ -s "downloads/${name}.README.md" ]; then
README=$(cat downloads/${name}.README.md)
README=$(_json_escape "${README}")
elif [ -s "downloads/${name}.README" ]; then
README=$(cat downloads/${name}.README)
if echo "${README}" | grep "HIGHLIGHTS" > /dev/null; then
## We have highlights, so only use those as the body

## This awk script is a hack.
## It counts the number of lines that start with '---' and
## then outputs any text after the first '---' until the 7th.
README=$(echo "${README}" | awk 'BEGIN{ echo=0 } { if ( $1 ~ /^---/ ) { echo++ } if ( echo > 0 && echo < 7 ) { print $0 } }')
fi
README=$(_json_escape "$(printf '```\n%s\n```' "${README}")")
else
README=""
fi
if echo "${README}" | grep "HIGHLIGHTS" > /dev/null; then
## We have highlights, so only use those as the body

## This awk script is a hack.
## It counts the number of lines that start with '---' and
## then outputs any text after the first '---' until the 7th.
README=`echo "${README}" | awk 'BEGIN{ echo=0 } { if ( $1 ~ /^---/ ) { echo++ } if ( echo > 0 && echo < 7 ) { print $0 } }'`
fi
if [ "${README}" != "" ]; then
RM=$(_json_escape "${README}")
BODY=", \"body\":${RM}"
else
BODY=""
fi
$(_curl_post "${REPO}/releases" -d '{"tag_name":"'"${name}"'", "name":"OTP '"${stripped_name}\"${BODY}}")
_curl_post "${REPO}/releases" -d '{"tag_name":"'"${name}"'", "name":"OTP '"${stripped_name}\"${BODY}}"
done

for name_id in "${UPDATE_BODY[@]}"; do
name=$(echo "${name_id}" | awk -F: '{print $1}')
RELEASE_ID=$(echo "${name_id}" | awk -F: '{print $2}')
if [ -s downloads/"${name}.README.md" ]; then
README=$(cat downloads/"${name}.README.md")
README=$(_json_escape "${README}")
elif [ -s downloads/"${name}.README" ]; then
README=$(cat downloads/"${name}.README")
README=$(_json_escape "$(printf '```\n%s\n```' "${README}")")
fi
echo "Update body of ${name}"
_curl_patch "${REPO}/releases/${RELEASE_ID}" -d "{\"body\":${README}}"
done

UPLOADED=false

Expand Down Expand Up @@ -193,12 +241,13 @@ _upload_artifacts() {
fi
}
_upload "${name}.README" "text"
_upload "${name}.README.md" "text"
_upload "otp_src_${stripped_name}.tar.gz" "application/gzip"
_upload "otp_doc_html_${stripped_name}.tar.gz" "application/gzip"
_upload "otp_doc_man_${stripped_name}.tar.gz" "application/gzip"
_upload "otp_win32_${stripped_name}.exe" "application/x-msdownload"
_upload "otp_win64_${stripped_name}.exe" "application/x-msdownload"
}
}

## Upload all assets for tags
for name in "${ALL_TAGS[@]}"; do
Expand All @@ -215,7 +264,7 @@ if [ ${UPLOADED} = false ]; then
for name in "${MISSING_PREBUILD[@]}"; do
stripped_name=$(_strip_name "${name}")
release=$(echo "${stripped_name}" | awk -F. '{print $1}')
if [[ $release < 24 ]]; then
if [[ $release -lt 24 ]]; then
## Releases before 24 are no longer supported and are a bit different
## from 24+ so I've removed support for them
echo "Skipping old release ${name}"
Expand All @@ -233,13 +282,13 @@ if [ ${UPLOADED} = false ]; then
-f otp_src/.github/dockerfiles/Dockerfile.64-bit .
docker run -v "$PWD":/github otp \
"/github/scripts/build-otp-tar -o /github/otp_clean_src.tar.gz /github/otp_src.tar.gz -b /buildroot/otp/ /buildroot/otp.tar.gz"
.github/scripts/release-docs.sh
.github/scripts/release-docs.sh "${release}" "${stripped_name}"
.github/scripts/create-artifacts.sh downloads "${name}"

## Delete any artifacts that we should not upload
for artifact in dowloads/*; do
if ! echo "${RI[@]}" | grep "${artifact}" 2> /dev/null > /dev/null; then
rm -f "downloads/${artifact}"
if ! echo "${RI[@]}" | grep "${artifact#downloads/}" 2> /dev/null > /dev/null; then
rm -f "${artifact}"
fi
done
_upload_artifacts "${name}"
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ jobs:
cd otp/release
./Install -sasl $PWD
./bin/erl -noshell -eval 'io:format("~s", [erlang:system_info(system_version)]), halt().'
./bin/erl -noshell -eval 'ok = crypto:start(), io:format("crypto ok~n"), halt().'
./bin/erl -noshell -eval 'ok = application:start(crypto), io:format("crypto ok~n"), halt().'
./bin/erl -noshell -eval '{wx_ref,_,_,_} = wx:new(), io:format("wx ok~n"), halt().'
- name: Upload tarball
Expand Down Expand Up @@ -449,12 +449,6 @@ jobs:
- uses: ./.github/actions/build-base-image
with:
BASE_BRANCH: ${{ env.BASE_BRANCH }}
- name: Install clang-format
run: |
docker build -t otp - <<EOF
FROM otp
RUN sudo apt-get install -y clang-format
EOF
## Check formatting of cpp code
- name: Check format
run: docker run otp "make format-check"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
matrix:
type: [debian-base,ubuntu-base,i386-debian-base]
branch: [master, maint, maint-26]
branch: [master, maint, maint-26, maint-27]
fail-fast: false

steps:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ JAVADOC-GENERATED
/doc

/make/output.mk
/make/emd2exml
/make/ex_doc_wrapper
/make/make_emakefile
/make/install_dir_data.sh

Expand Down
2 changes: 1 addition & 1 deletion HOWTO/BOOTSTRAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Primary bootstrap

The two types of version controlled code are fundamentally
different. The primary bootstrap is code compiled from source files in
the lib/{kernel,stdlib,compiler} (They are checked in in the version control system
the lib/{kernel,stdlib,compiler} (They are checked in the version control system
to make it possible to build directly from the code base tree without
the need for an earlier version of the compiler. When a new version of
OTP is released, these files are updated manually (or rather, by using
Expand Down
2 changes: 1 addition & 1 deletion HOWTO/INSTALL-RASPBERRYPI3.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ Uncheck option:

$ cat > test.c
$ int main() { printf("Hello, world!\n"); return 0; }
<CTRL+D>
<Ctrl+D>
$ armv8-rpi3-linux-gnueabihf-gcc -o test test.c


Expand Down
6 changes: 5 additions & 1 deletion HOWTO/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,11 @@ also find the utilities needed for building the documentation.
but any version after that should work just as well.

You can also use `./otp_build download_ex_doc` to download the correct version
from github.
from github. One of the following dependencies are needed to check the documentation:

- sha256sum, or
- sha1sum, or
- shasum

How to Build and Install Erlang/OTP
-----------------------------------
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

**Erlang** is a programming language and runtime system for building massively scalable soft real-time systems with requirements on high availability.

**OTP** is a set of Erlang libraries, which consists of the Erlang runtime system, a number of ready-to-use components mainly written in Erlang, and a set of design principles for Erlang programs. [Learn more about Erlang and OTP](http://erlang.org/doc/system_architecture_intro/sys_arch_intro.html).
**OTP** is a set of Erlang libraries, which consists of the Erlang runtime system, a number of ready-to-use components mainly written in Erlang, and a set of design principles for Erlang programs. [Learn more about Erlang and OTP](https://www.erlang.org/doc/system/getting_started.html).

[Learn how to program in Erlang](http://learnyousomeerlang.com/).

Expand Down Expand Up @@ -54,7 +54,7 @@ cd otp
Checkout the branch or tag of your choice

```sh
git checkout maint-26 # current latest stable version
git checkout maint-27 # current latest stable version
```

Configure, build and install
Expand Down
Binary file modified bootstrap/bin/no_dot_erlang.boot
Binary file not shown.
Binary file modified bootstrap/bin/start.boot
Binary file not shown.
Binary file modified bootstrap/bin/start_clean.boot
Binary file not shown.
Binary file modified bootstrap/lib/compiler/ebin/beam_asm.beam
Binary file not shown.
Binary file modified bootstrap/lib/compiler/ebin/beam_clean.beam
Binary file not shown.
Binary file modified bootstrap/lib/compiler/ebin/beam_core_to_ssa.beam
Binary file not shown.
Binary file modified bootstrap/lib/compiler/ebin/beam_digraph.beam
Binary file not shown.
Binary file modified bootstrap/lib/compiler/ebin/beam_jump.beam
Binary file not shown.
Binary file modified bootstrap/lib/compiler/ebin/beam_ssa.beam
Binary file not shown.
Binary file modified bootstrap/lib/compiler/ebin/beam_ssa_alias.beam
Binary file not shown.
Binary file modified bootstrap/lib/compiler/ebin/beam_ssa_bool.beam
Binary file not shown.
Binary file modified bootstrap/lib/compiler/ebin/beam_ssa_bsm.beam
Binary file not shown.
Binary file modified bootstrap/lib/compiler/ebin/beam_ssa_dead.beam
Binary file not shown.
Binary file modified bootstrap/lib/compiler/ebin/beam_ssa_opt.beam
Binary file not shown.
Binary file modified bootstrap/lib/compiler/ebin/beam_ssa_pre_codegen.beam
Binary file not shown.
Binary file modified bootstrap/lib/compiler/ebin/beam_ssa_recv.beam
Binary file not shown.
Binary file modified bootstrap/lib/compiler/ebin/beam_ssa_ss.beam
Binary file not shown.
Binary file modified bootstrap/lib/compiler/ebin/beam_ssa_throw.beam
Binary file not shown.
Binary file modified bootstrap/lib/compiler/ebin/beam_ssa_type.beam
Binary file not shown.
Binary file modified bootstrap/lib/compiler/ebin/beam_trim.beam
Binary file not shown.
Binary file modified bootstrap/lib/compiler/ebin/beam_validator.beam
Binary file not shown.
Binary file modified bootstrap/lib/compiler/ebin/compile.beam
Binary file not shown.
Binary file modified bootstrap/lib/compiler/ebin/rec_env.beam
Binary file not shown.
Binary file modified bootstrap/lib/compiler/ebin/sys_core_alias.beam
Binary file not shown.
Binary file modified bootstrap/lib/compiler/ebin/sys_core_fold.beam
Binary file not shown.
Binary file modified bootstrap/lib/compiler/ebin/v3_core.beam
Binary file not shown.
Binary file modified bootstrap/lib/kernel/ebin/code_server.beam
Binary file not shown.
Binary file modified bootstrap/lib/kernel/ebin/disk_log.beam
Binary file not shown.
Binary file modified bootstrap/lib/kernel/ebin/erl_erts_errors.beam
Binary file not shown.
Binary file modified bootstrap/lib/kernel/ebin/erpc.beam
Binary file not shown.
Binary file modified bootstrap/lib/kernel/ebin/erts_debug.beam
Binary file not shown.
Binary file modified bootstrap/lib/kernel/ebin/gen_tcp_socket.beam
Binary file not shown.
Binary file modified bootstrap/lib/kernel/ebin/global.beam
Binary file not shown.
Binary file modified bootstrap/lib/kernel/ebin/net.beam
Binary file not shown.
Binary file modified bootstrap/lib/kernel/ebin/net_kernel.beam
Binary file not shown.
Binary file modified bootstrap/lib/kernel/ebin/prim_tty.beam
Binary file not shown.
Binary file modified bootstrap/lib/kernel/ebin/socket.beam
Binary file not shown.
Binary file modified bootstrap/lib/stdlib/ebin/argparse.beam
Binary file not shown.
Binary file modified bootstrap/lib/stdlib/ebin/epp.beam
Binary file not shown.
Binary file modified bootstrap/lib/stdlib/ebin/erl_eval.beam
Binary file not shown.
Binary file modified bootstrap/lib/stdlib/ebin/erl_lint.beam
Binary file not shown.
Binary file modified bootstrap/lib/stdlib/ebin/erl_tar.beam
Binary file not shown.
Binary file modified bootstrap/lib/stdlib/ebin/escript.beam
Binary file not shown.
Binary file modified bootstrap/lib/stdlib/ebin/filelib.beam
Binary file not shown.
Binary file modified bootstrap/lib/stdlib/ebin/gen.beam
Binary file not shown.
Binary file modified bootstrap/lib/stdlib/ebin/gen_event.beam
Binary file not shown.
Binary file modified bootstrap/lib/stdlib/ebin/gen_fsm.beam
Binary file not shown.
Binary file modified bootstrap/lib/stdlib/ebin/gen_server.beam
Binary file not shown.
Binary file modified bootstrap/lib/stdlib/ebin/gen_statem.beam
Binary file not shown.
Binary file modified bootstrap/lib/stdlib/ebin/json.beam
Binary file not shown.
Binary file modified bootstrap/lib/stdlib/ebin/maps.beam
Binary file not shown.
Binary file modified bootstrap/lib/stdlib/ebin/otp_internal.beam
Binary file not shown.
Binary file modified bootstrap/lib/stdlib/ebin/sets.beam
Binary file not shown.
Binary file modified bootstrap/lib/stdlib/ebin/shell_docs_markdown.beam
Binary file not shown.
Binary file modified bootstrap/lib/stdlib/ebin/string.beam
Binary file not shown.
Binary file modified bootstrap/lib/stdlib/ebin/supervisor.beam
Binary file not shown.
3 changes: 3 additions & 0 deletions erts/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@
/* Socket address dl length */
#undef ESOCK_SDL_LEN

/* Interface hwaddr supported */
#undef ESOCK_USE_ENADDR

/* Use extended error info */
#undef ESOCK_USE_EXTENDED_ERROR_INFO

Expand Down
Loading

0 comments on commit 88a1244

Please sign in to comment.