diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 291644fdeb6e..fce8ecf9fb85 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -26,7 +26,7 @@ "dockerfile": "../.github/dockerfiles/Dockerfile.ubuntu-base", "context": "../.github", "args": { - "BASE": "mcr.microsoft.com/vscode/devcontainers/base:focal", + "BASE": "mcr.microsoft.com/devcontainers/base:noble", "USER": "vscode", "GROUP": "vscode" } diff --git a/.github/dockerfiles/Dockerfile.64-bit b/.github/dockerfiles/Dockerfile.64-bit index f026fe20ed1f..58ff3070c57d 100644 --- a/.github/dockerfiles/Dockerfile.64-bit +++ b/.github/dockerfiles/Dockerfile.64-bit @@ -44,7 +44,7 @@ ENV CXXFLAGS="-Wno-maybe-uninitialized" ENV SKIPPED_OSSF_CFLAGS="-Wconversion -mbranch-protection=standard \ -Wextra -Werror=implicit -Werror=incompatible-pointer-types -Werror=int-conversion \ -Wsign-conversion" -ENV LDFLAGS="" +ENV LDFLAGS="-fsanitize=signed-integer-overflow" ## OpenSSF recommended LDFLAGS, skipped are: ## -Wl,-z,nodlopen - as opening drivers/nifs needs this ## -fPIE - not needed with gcc 11 diff --git a/.github/dockerfiles/Dockerfile.clang b/.github/dockerfiles/Dockerfile.clang index 05ebe8efa317..fee5eb4476b7 100644 --- a/.github/dockerfiles/Dockerfile.clang +++ b/.github/dockerfiles/Dockerfile.clang @@ -29,7 +29,7 @@ ENV MAKEFLAGS=$MAKEFLAGS \ ERL_TOP=/buildroot/otp \ PATH=/otp/bin:/buildroot/otp/bin:$PATH -RUN sudo apt-get update && sudo apt-get install -y clang +RUN sudo apt-get update && sudo apt-get install -y clang libstdc++-14-dev ARG ARCHIVE=./otp.tar.gz COPY $ARCHIVE /buildroot/otp.tar.gz diff --git a/.github/dockerfiles/Dockerfile.debian-base b/.github/dockerfiles/Dockerfile.debian-base index 5ab91d6a057e..8aff841f1147 100644 --- a/.github/dockerfiles/Dockerfile.debian-base +++ b/.github/dockerfiles/Dockerfile.debian-base @@ -21,17 +21,17 @@ ## ## This docker file will build a base image for building Erlang/OTP ## -ARG BASE=debian:bookworm +ARG BASE=debian:trixie FROM $BASE ## Need to have a second arg here as the first does not expose the $BASE in the script below -ARG BASE=debian:bookworm +ARG BASE=debian:trixie 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 libwxgtk3.2-dev libwxgtk-webview3.2-dev libsctp-dev lksctp-tools" +ENV INSTALL_LIBS="zlib1g-dev libncurses-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 diff --git a/.github/dockerfiles/Dockerfile.ubuntu-base b/.github/dockerfiles/Dockerfile.ubuntu-base index 528deced2e90..295a412fd4ab 100644 --- a/.github/dockerfiles/Dockerfile.ubuntu-base +++ b/.github/dockerfiles/Dockerfile.ubuntu-base @@ -21,10 +21,10 @@ ## ## This docker file will build a base image for building Erlang/OTP ## -ARG BASE=gitpod/workspace-full +ARG BASE=ubuntu:24.04 FROM $BASE -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" +ENV INSTALL_LIBS="zlib1g-dev libncurses5-dev libssl-dev unixodbc-dev libsctp-dev lksctp-tools libgmp3-dev libwxgtk3.2-dev libwxgtk-webview3.2-dev" USER root @@ -36,9 +36,8 @@ RUN apt-get update && apt-get -y upgrade && \ apt-get install -y build-essential m4 autoconf clang-format \ 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 && \ apt-get install -y openjdk-8-jdk-headless && apt-get install -y openjdk-11-jdk-headless && \ - (update-java-alternatives -s java-1.8.0-openjdk-amd64 || true) && \ + update-java-alternatives -s java-1.8.0-openjdk-$(dpkg --print-architecture) && \ java -version 2>&1 | grep 'version "1[.]8' > /dev/null || exit 1 ARG MAKEFLAGS=-j4 @@ -47,8 +46,8 @@ ENV MAKEFLAGS=$MAKEFLAGS \ ENV LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 -ARG USER=gitpod -ARG GROUP=gitpod +ARG USER=otptest +ARG GROUP=uucp ARG gid=10 ARG uid=421 diff --git a/.github/scripts/build-base-image.sh b/.github/scripts/build-base-image.sh index 9328639d6f15..6f41814d23fe 100755 --- a/.github/scripts/build-base-image.sh +++ b/.github/scripts/build-base-image.sh @@ -55,15 +55,15 @@ fi case "${BASE_TAG}" in *i386-debian-base) - BASE="i386/debian:bookworm" + BASE="i386/debian:trixie" BASE_TYPE=debian-base ;; *debian-base) - BASE="debian:bookworm" + BASE="debian:trixie" BASE_TYPE=debian-base ;; *ubuntu-base) - BASE="ubuntu:22.04" + BASE="ubuntu:24.04" BASE_TYPE=ubuntu-base ;; esac @@ -92,7 +92,6 @@ else ${BASE_CACHE} \ --file ".github/dockerfiles/Dockerfile.${BASE_TYPE}" \ --build-arg MAKEFLAGS=-j6 \ - --build-arg USER=otptest --build-arg GROUP=uucp \ --build-arg uid="$(id -u)" \ --build-arg LATEST_ERLANG_VERSION="${LATEST_ERLANG_VERSION}" \ --build-arg BASE="${BASE}" \ diff --git a/.github/workflows/reusable-sbom.yaml b/.github/workflows/reusable-sbom.yaml index 8885a2c6a7fd..2ff78ad5f52a 100644 --- a/.github/workflows/reusable-sbom.yaml +++ b/.github/workflows/reusable-sbom.yaml @@ -126,8 +126,8 @@ jobs: FROM otp RUN echo 'export PATH="\$HOME/.local/bin:\$PATH"' >> /home/otptest/.profile RUN sudo apt-get install -y libicu-dev pip && \ - pip install click==8.3.1 scancode-toolkit==${SCANCODE_VERSION} reuse && \ - pip install -U ntia-conformance-checker + pip install --break-system-packages click==8.3.1 scancode-toolkit==${SCANCODE_VERSION} reuse && \ + pip install --break-system-packages -U ntia-conformance-checker EOF - name: Restore from cache diff --git a/.gitpod.yml b/.gitpod.yml deleted file mode 100644 index 8c78aae86c5e..000000000000 --- a/.gitpod.yml +++ /dev/null @@ -1,27 +0,0 @@ -## %CopyrightBegin% -## -## SPDX-License-Identifier: Apache-2.0 -## -## Copyright Ericsson AB 2021-2025. All Rights Reserved. -## -## Licensed under the Apache License, Version 2.0 (the "License"); -## you may not use this file except in compliance with the License. -## You may obtain a copy of the License at -## -## http://www.apache.org/licenses/LICENSE-2.0 -## -## Unless required by applicable law or agreed to in writing, software -## distributed under the License is distributed on an "AS IS" BASIS, -## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -## See the License for the specific language governing permissions and -## limitations under the License. -## -## %CopyrightEnd% - -image: - file: .github/dockerfiles/Dockerfile.ubuntu-base - context: .github -vscode: - extensions: - - ms-vscode.cpptools - - erlang-ls.erlang-ls diff --git a/HOWTO/DEVELOPMENT.md b/HOWTO/DEVELOPMENT.md index d17d8b7c08e8..11ce01be2f41 100644 --- a/HOWTO/DEVELOPMENT.md +++ b/HOWTO/DEVELOPMENT.md @@ -65,7 +65,7 @@ with. 7. [Github Actions](#github-actions) 1. [Debugging github actions failures](#debugging-github-actions-failures) 8. [Using Docker](#using-docker) - 1. [Gidpod.io or VSCode dev container](#gitpod-io-or-vscode-dev-container) + 1. [VSCode dev container](#vscode-dev-container) ## Short version @@ -554,8 +554,7 @@ you can do that like this: ```bash docker build -t ghcr.io/erlang/otp/ubuntu-base \ - --build-arg BASE=ubuntu:20.04 --build-arg USER=otptest --build-arg uid=$(id -u) \ - --build-arg GROUP=uucp --build-arg gid=$(id -g) \ + --build-arg uid=$(id -u) --build-arg gid=$(id -g) \ -f .github/dockerfiles/Dockerfile.ubuntu-base .github/ ``` @@ -577,24 +576,21 @@ docker run --init -v $PWD/make_test_dir:/buildroot/otp/lib/stdlib/make_test_dir The Common Test logs will be placed in `make_test_dir/ct_logs`. -### Gidpod.io or VSCode dev container +### VSCode dev container -This git repository is also prepared to run using [Gitpod](https://gitpod.io/) or +This git repository is also prepared to run using a [VSCode Devcontainer](https://code.visualstudio.com/docs/remote/containers). -The support for these environments is very early so it will be a bit unstable. - -To access the gitpod for Erlang/OTP you just navigate to -[https://gitpod.io/#https://github.com/erlang/otp](https://gitpod.io/#https://github.com/erlang/otp). +The support for this environment is very early so it will be a bit unstable. When using a VSCode dev container, you only need to open [VSCode](https://code.visualstudio.com/) in the Erlang/OTP repository and you should get a popup that asks if you want to run in a dev container. -The gitpod and dev container both use the base ubuntu image built in [Using Docker](#using-docker). -So it should be possible to run all tests inside the containers with all test +The dev container uses the base ubuntu image built in [Using Docker](#using-docker). +So it should be possible to run all tests inside the container with all test dependencies available. -*WARNING*: Using VSCode dev container on macOS can be very slow because of limitations -in the filesystem. So I would recommend either using gitpod or just work locally without +*WARNING*: Using a VSCode dev container on macOS can be very slow because of limitations +in the filesystem. So I would recommend just working locally without the dev container on macOS. diff --git a/erts/emulator/beam/beam_bp.c b/erts/emulator/beam/beam_bp.c index 9c18ec5148dc..9cab23a8f146 100644 --- a/erts/emulator/beam/beam_bp.c +++ b/erts/emulator/beam/beam_bp.c @@ -1618,7 +1618,7 @@ static void collect_timem_info(BpTimemTrace* bdt, } } -void erts_timem_info_consolidate() +void erts_timem_info_consolidate(void) { FinishTimemInfo *fin = &finish_timem_info; GenericBpData *staging = &fin->g->data[erts_staging_bp_ix()]; diff --git a/erts/emulator/beam/erl_bits.c b/erts/emulator/beam/erl_bits.c index f23648af2c73..02bc512f6c49 100644 --- a/erts/emulator/beam/erl_bits.c +++ b/erts/emulator/beam/erl_bits.c @@ -423,6 +423,7 @@ erts_bs_get_binary_2(Process *p, Uint num_bits, ErlSubBits *sb) return result; } +#if !((SIZEOF__FLOAT16 == 2) && defined(FLOAT16_IS_CONVERTIBLE)) static ERTS_INLINE Uint16 f32_to_f16(float fp) { union { @@ -531,6 +532,7 @@ static ERTS_INLINE float f16_to_f32(Uint16 fp) u.u32 = res; return u.f32; } +#endif Eterm erts_bs_get_float_2(Process *p, Uint num_bits, unsigned flags, ErlSubBits *sb) diff --git a/erts/emulator/beam/erl_crash_dump.c b/erts/emulator/beam/erl_crash_dump.c index 8b45bbd88430..f6b12f68b279 100644 --- a/erts/emulator/beam/erl_crash_dump.c +++ b/erts/emulator/beam/erl_crash_dump.c @@ -238,7 +238,7 @@ erl_crash_dump_init_envelope(EVP_PKEY *public_key, free(key); } -void erl_crash_dump_init() { +void erl_crash_dump_init(void) { unsigned char iv[AES_256_CBC_IV_SIZE]; unsigned char *secret; size_t secret_size; @@ -339,7 +339,7 @@ crash_dump_encrypted_close(void *to_arg) { } #else /* !defined(ENCRYPTED_CRASH_DUMPS) */ -void erl_crash_dump_init() { +void erl_crash_dump_init(void) { /* Nothing to do. */ } #endif diff --git a/erts/emulator/beam/erl_gc.c b/erts/emulator/beam/erl_gc.c index 04a771233ead..b766d89c0116 100644 --- a/erts/emulator/beam/erl_gc.c +++ b/erts/emulator/beam/erl_gc.c @@ -1057,7 +1057,6 @@ garbage_collect_hibernate(Process* p, int check_long_gc) stack_area_sz = stack_size * sizeof(Eterm); erts_deallocate_young_generation(p); - erts_free(ERTS_ALC_T_TMP_HEAP, collection_heap); p->heap = final_heap; p->heap_sz = final_size; @@ -1075,6 +1074,8 @@ garbage_collect_hibernate(Process* p, int check_long_gc) stack_offset, stack_area, stack_area_sz, p->arg_reg, p->arity); + erts_free(ERTS_ALC_T_TMP_HEAP, collection_heap); + if (erts_frame_layout == ERTS_FRAME_LAYOUT_FP_RA) { FRAME_POINTER(p) += stack_offset; } diff --git a/erts/emulator/beam/erl_lock_count.c b/erts/emulator/beam/erl_lock_count.c index 6399c16f2d2b..18d7b8c228ea 100644 --- a/erts/emulator/beam/erl_lock_count.c +++ b/erts/emulator/beam/erl_lock_count.c @@ -463,7 +463,7 @@ void lcnt_register_static_lock__(erts_lcnt_ref_t *reference, const char *name, E /* - Initialization - */ -void erts_lcnt_pre_thr_init() { +void erts_lcnt_pre_thr_init(void) { /* Ensure that the dependency hack mentioned in the header doesn't * explode at runtime. */ ERTS_CT_ASSERT(sizeof(LcntThrPrgrLaterOp) >= sizeof(ErtsThrPrgrLaterOp)); @@ -476,7 +476,7 @@ void erts_lcnt_pre_thr_init() { lcnt_init_static_lock_registry(); } -void erts_lcnt_post_thr_init() { +void erts_lcnt_post_thr_init(void) { /* ASSUMPTION: this is safe since it runs prior to the creation of other * threads (Directly after ethread init). */ @@ -485,7 +485,7 @@ void erts_lcnt_post_thr_init() { erts_lcnt_thread_setup(); } -void erts_lcnt_late_init() { +void erts_lcnt_late_init(void) { /* Set start timer and zero all statistics */ erts_lcnt_clear_counters(); erts_thr_install_exit_handler(erts_lcnt_thread_exit_handler); @@ -502,7 +502,7 @@ void erts_lcnt_post_startup(void) { erts_lcnt_set_category_mask(ERTS_LOCK_FLAGS_MASK_CATEGORY); } -void erts_lcnt_thread_setup() { +void erts_lcnt_thread_setup(void) { lcnt_thread_data_t__ *eltd = lcnt_thread_data_alloc(); ASSERT(eltd); @@ -510,7 +510,7 @@ void erts_lcnt_thread_setup() { ethr_tsd_set(lcnt_thr_data_key__, eltd); } -void erts_lcnt_thread_exit_handler() { +void erts_lcnt_thread_exit_handler(void) { lcnt_thread_data_t__ *eltd = lcnt_get_thread_data__(); if (eltd) { diff --git a/erts/emulator/beam/erl_term.h b/erts/emulator/beam/erl_term.h index 8263706dc394..f731d740f30a 100644 --- a/erts/emulator/beam/erl_term.h +++ b/erts/emulator/beam/erl_term.h @@ -1154,7 +1154,7 @@ typedef struct external_thing_ { #endif } port; Uint32 ui32[2]; - Uint ui[1]; + Uint ui[sizeof(Uint64) / sizeof(Uint)]; } data; } ExternalThing; diff --git a/erts/lib_src/yielding_c_fun/ycf_utils.c b/erts/lib_src/yielding_c_fun/ycf_utils.c index 10f3a60acc36..aa1e88d192d1 100644 --- a/erts/lib_src/yielding_c_fun/ycf_utils.c +++ b/erts/lib_src/yielding_c_fun/ycf_utils.c @@ -38,7 +38,7 @@ bool ycf_track_memory = false; size_t ycf_memory_usage = 0; size_t ycf_max_memory_usage = 0; -void ycf_enable_memory_tracking(){ +void ycf_enable_memory_tracking(void){ ycf_track_memory = true; } diff --git a/lib/wx/configure b/lib/wx/configure index 3a9fb665527c..09890bdbf283 100755 --- a/lib/wx/configure +++ b/lib/wx/configure @@ -8043,7 +8043,7 @@ int main (void) { - #if wxMAJOR_VERSION > 2 && (wxMINOR_VERSION == 0 || WXWIN_COMPATIBILITY_3_0 == 1) + #if wxMAJOR_VERSION > 2 && (wxMINOR_VERSION == 0 || wxMINOR_VERSION >= 2 || WXWIN_COMPATIBILITY_3_0 == 1) ; #else #error barf diff --git a/lib/wx/configure.ac b/lib/wx/configure.ac index c3825e2a54d6..e53768706a3c 100644 --- a/lib/wx/configure.ac +++ b/lib/wx/configure.ac @@ -603,7 +603,7 @@ AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[ #include "wx/wx.h" ]], [[ - #if wxMAJOR_VERSION > 2 && (wxMINOR_VERSION == 0 || WXWIN_COMPATIBILITY_3_0 == 1) + #if wxMAJOR_VERSION > 2 && (wxMINOR_VERSION == 0 || wxMINOR_VERSION >= 2 || WXWIN_COMPATIBILITY_3_0 == 1) ; #else #error barf