diff --git a/.github/workflows/test_suite_linux.yml b/.github/workflows/test_suite_linux.yml index 4a03fad478c..e22f2d21a0f 100644 --- a/.github/workflows/test_suite_linux.yml +++ b/.github/workflows/test_suite_linux.yml @@ -8,7 +8,7 @@ on: push: tags: - nightly_* - - R20* + - R22* concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -23,7 +23,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-20.04, ubuntu-22.04] + os: [ubuntu-22.04, ubuntu-24.04] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 @@ -42,12 +42,12 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-20.04, ubuntu-22.04] + os: [ubuntu-22.04, ubuntu-24.04] include: - - os: ubuntu-20.04 - JAVA_VERSION: "16" - os: ubuntu-22.04 JAVA_VERSION: "18" + - os: ubuntu-24.04 + JAVA_VERSION: "21" runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 @@ -67,7 +67,7 @@ jobs: export LIBGL_ALWAYS_SOFTWARE=true xvfb-run --auto-servernum make distrib -j4 - name: Create/Update GitHub release - if: ${{ matrix.os == 'ubuntu-20.04' && (github.event_name == 'push' || github.event_name == 'schedule') }} + if: ${{ matrix.os == 'ubuntu-22.04' && (github.event_name == 'push' || github.event_name == 'schedule') }} run: | sudo python -m pip install requests PyGithub pip install pyopenssl --upgrade @@ -93,14 +93,14 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-20.04, ubuntu-22.04] + os: [ubuntu-22.04, ubuntu-24.04] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 - name: Download Artifacts uses: actions/download-artifact@v4.1.7 with: - name: build-ubuntu-20.04 + name: build-ubuntu-22.04 path: artifact - name: Extract Webots run: tar xjf artifact/webots-*-x86-64*.tar.bz2 -C artifact @@ -128,7 +128,7 @@ jobs: test-worlds: needs: build if: ${{ contains(github.event.pull_request.labels.*.name, 'test worlds') || github.event_name == 'schedule' }} - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Download Scripts uses: actions/checkout@v4 @@ -140,7 +140,7 @@ jobs: - name: Download Artifacts uses: actions/download-artifact@v4.1.7 with: - name: build-ubuntu-20.04 + name: build-ubuntu-22.04 path: artifact - name: Extract Webots and Cache run: | @@ -165,7 +165,7 @@ jobs: if: ${{ always() && !contains(github.event.pull_request.labels.*.name, 'test distribution') && !contains(github.event.pull_request.labels.*.name, 'test webots build') }} strategy: matrix: - os: [ubuntu-20.04, ubuntu-22.04] + os: [ubuntu-22.04, ubuntu-24.04] runs-on: ubuntu-latest steps: - name: Delete artifacts diff --git a/.github/workflows/test_suite_linux_develop.yml b/.github/workflows/test_suite_linux_develop.yml index ecb791d011d..d17551ea22b 100644 --- a/.github/workflows/test_suite_linux_develop.yml +++ b/.github/workflows/test_suite_linux_develop.yml @@ -17,7 +17,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-20.04, ubuntu-22.04] + os: [ubuntu-22.04, ubuntu-24.04] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 @@ -37,12 +37,12 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-20.04, ubuntu-22.04] + os: [ubuntu-22.04, ubuntu-24.04] include: - - os: ubuntu-20.04 - JAVA_VERSION: "16" - os: ubuntu-22.04 JAVA_VERSION: "18" + - os: ubuntu-24.04 + JAVA_VERSION: "21" runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 @@ -63,7 +63,7 @@ jobs: export LIBGL_ALWAYS_SOFTWARE=true xvfb-run --auto-servernum make distrib -j4 - name: Create/Update GitHub release - if: ${{ matrix.os == 'ubuntu-20.04' && (github.event_name == 'push' || github.event_name == 'schedule') }} + if: ${{ matrix.os == 'ubuntu-22.04' && (github.event_name == 'push' || github.event_name == 'schedule') }} run: | sudo python -m pip install requests PyGithub pip install pyopenssl --upgrade @@ -89,7 +89,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-20.04, ubuntu-22.04] + os: [ubuntu-22.04, ubuntu-24.04] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 @@ -98,7 +98,7 @@ jobs: - name: Download Artifacts uses: actions/download-artifact@v4.1.7 with: - name: build-ubuntu-20.04 + name: build-ubuntu-22.04 path: artifact - name: Extract Webots run: tar xjf artifact/webots-*-x86-64*.tar.bz2 -C artifact @@ -120,7 +120,7 @@ jobs: test-worlds: needs: build if: ${{ contains(github.event.pull_request.labels.*.name, 'test worlds') || github.event_name == 'schedule' }} - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Download Scripts uses: actions/checkout@v4 @@ -132,7 +132,7 @@ jobs: - name: Download Artifacts uses: actions/download-artifact@v4.1.7 with: - name: build-ubuntu-20.04 + name: build-ubuntu-22.04 path: artifact - name: Extract Webots and Cache run: | @@ -157,7 +157,7 @@ jobs: if: ${{ always() && !contains(github.event.pull_request.labels.*.name, 'test distribution') && !contains(github.event.pull_request.labels.*.name, 'test webots build') }} strategy: matrix: - os: [ubuntu-20.04, ubuntu-22.04] + os: [ubuntu-22.04, ubuntu-24.04] runs-on: ubuntu-latest steps: - name: Delete artifacts diff --git a/dependencies/Makefile.linux b/dependencies/Makefile.linux index 527e3d604ca..f79ab05ab6c 100644 --- a/dependencies/Makefile.linux +++ b/dependencies/Makefile.linux @@ -17,10 +17,6 @@ OPENSSL_SRC_PACKAGE=openssl-$(OPENSSL_VERSION).tar.gz PACKAGES = qt open-al ois pico assimp PACKAGES_CLEAN = $(addsuffix -clean, $(PACKAGES)) -ifeq ($(UBUNTU_VERSION), 20.04) - PACKAGES += open-ssl -endif - .PHONY: release debug distrib profile clean cleanse $(PACKAGES) $(PACKAGES_CLEAN) release debug distrib profile: ../.clang-format $(PACKAGES) @@ -30,9 +26,7 @@ cleanse: $(PACKAGES_CLEAN) ../.clang-format: @echo "# copying clang-format configuration file" -ifeq ($(UBUNTU_VERSION), 22.04) - @cp .clang-format-9 $@ -else ifeq ($(UBUNTU_VERSION), 20.04) +ifeq ($(filter $(UBUNTU_VERSION), 22.04 24.04), $(UBUNTU_VERSION)) @cp .clang-format-9 $@ else @cp .clang-format-6 $@ diff --git a/docs/guide/installation-procedure.md b/docs/guide/installation-procedure.md index 99295ee89ef..4632d2dca4a 100644 --- a/docs/guide/installation-procedure.md +++ b/docs/guide/installation-procedure.md @@ -141,7 +141,7 @@ The chapter entitled [running extern robot controllers](running-extern-robot-con #### Installing the Docker Image -[Docker](https://www.docker.com) images of Webots based on Ubuntu 20.04 are available on [dockerhub](https://hub.docker.com/r/cyberbotics/webots). +[Docker](https://www.docker.com) images of Webots based on Ubuntu 22.04 are available on [dockerhub](https://hub.docker.com/r/cyberbotics/webots). These images can be used to run Webots in your continuous integration (CI) workflow without requiring any graphical user interface or to get a clean and sandboxed environment with Webots pre-installed including GPU accelerated graphical user interface. @@ -158,7 +158,7 @@ To pull the image and start a docker container with it use the following command docker run -it cyberbotics/webots:latest ``` -> **Note**: If you need a specific version of Webots or Ubuntu and not the latest ones, replace `latest` with the version you need (e.g. `R2021b-ubuntu20.04`). +> **Note**: If you need a specific version of Webots or Ubuntu and not the latest ones, replace `latest` with the version you need (e.g. `R2023b-ubuntu22.04`). After starting the docker container you can start Webots headlessly using xvfb: ```bash diff --git a/docs/guide/prerequisites-and-overview.md b/docs/guide/prerequisites-and-overview.md index e339acca1ca..0fb9011a86e 100644 --- a/docs/guide/prerequisites-and-overview.md +++ b/docs/guide/prerequisites-and-overview.md @@ -4,7 +4,7 @@ The prerequisites for the server machine(s) are the following: -- Ubuntu 20.04 LTS or newer +- Ubuntu 22.04 LTS or newer - Web service dependencies ([installation instructions](https://github.com/cyberbotics/webots/wiki/Linux-Optional-Dependencies#webots-web-service)): The simulation server machines have to met the [Webots system requirements](system-requirements.md). diff --git a/docs/guide/protocol-and-quick-start.md b/docs/guide/protocol-and-quick-start.md index e4f3e1fce15..859c14974cc 100644 --- a/docs/guide/protocol-and-quick-start.md +++ b/docs/guide/protocol-and-quick-start.md @@ -89,7 +89,7 @@ sequenceDiagram ### Quick Start This section gives a simple step-by-step guide on how to start a streaming server with one session and one simulation server. -We assume you use Ubuntu 20.04 or newer and have the latest version of Webots installed. +We assume you use Ubuntu 22.04 or newer and have the latest version of Webots installed. First, you need to install the web service dependencies: ```bash diff --git a/docs/guide/session-server.md b/docs/guide/session-server.md index 142869d56a8..62ec117daf6 100644 --- a/docs/guide/session-server.md +++ b/docs/guide/session-server.md @@ -55,12 +55,12 @@ The setup of a mail server is not covered by this guide. ### Software Requirements -Instructions are provided here for Ubuntu 20.04, however it may work on any other version of Linux. +Instructions are provided here for Ubuntu 22.04, however it may work on any other version of Linux. It is assumed that you will be running a simulation server on the same machine. If not, you can install the server edition of Ubuntu and skip step 2. -1. Install Ubuntu 20.04: - - Choose the desktop version of Ubuntu 20.04. Simulation servers needs a X display and 3D OpenGL hardware acceleration which is easier to setup from a desktop version. +1. Install Ubuntu 22.04: + - Choose the desktop version of Ubuntu 22.04. Simulation servers needs a X display and 3D OpenGL hardware acceleration which is easier to setup from a desktop version. - Create a user account named `cyberbotics` (or anything else). 2. Makes that this user account has the auto-login feature enabled, so that when you boot the machine it get automatically logged in. 3. Configure the [unattended upgrades](https://www.linuxbabe.com/ubuntu/automatic-security-update-unattended-upgrades-ubuntu) to reboot after security updates. diff --git a/docs/guide/simulation-server.md b/docs/guide/simulation-server.md index 8196370a1a0..1627e1247cc 100644 --- a/docs/guide/simulation-server.md +++ b/docs/guide/simulation-server.md @@ -70,8 +70,8 @@ The machine running the session server should be able to access any port of the If you are installing the simulation server on the same machine as the session server, you can skip steps 1 to 4. -1. Install Ubuntu 20.04: - - Choose the desktop version of Ubuntu 20.04. Simulation servers needs a X display and 3D OpenGL hardware acceleration which is easier to setup from a desktop version. +1. Install Ubuntu 22.04: + - Choose the desktop version of Ubuntu 22.04. Simulation servers needs a X display and 3D OpenGL hardware acceleration which is easier to setup from a desktop version. - create a user account named `cyberbotics` (or anything else). 2. Makes that this user account has the auto-login feature enabled, so that when you boot the machine it get automatically logged in. 3. Configure the [unattended upgrades](https://www.linuxbabe.com/ubuntu/automatic-security-update-unattended-upgrades-ubuntu) to reboot after security updates. diff --git a/docs/guide/system-requirements.md b/docs/guide/system-requirements.md index 02b40c10604..c69de9a6277 100644 --- a/docs/guide/system-requirements.md +++ b/docs/guide/system-requirements.md @@ -13,11 +13,11 @@ Webots works well on all the graphics cards included in fairly recent Apple comp The following operating systems are supported: -- Linux: Webots is ensured to run on the latest Ubuntu Long Term Support (LTS) releases, including versions 22.04 and 20.04. +- Linux: Webots is ensured to run on the latest Ubuntu Long Term Support (LTS) releases, including versions 22.04 and 24.04. But it is also known to run on most recent major Linux distributions, including RedHat, Mandrake, Debian, Gentoo, Arch, SuSE, and Slackware. We recommend using a recent version of Linux. Webots is provided for Linux 64 (x86-64) systems only. -Webots doesn't run on Ubuntu versions earlier than 20.04. +Webots doesn't run on Ubuntu versions earlier than 22.04. - Windows: Webots runs on Windows 11 and Windows 10 (64-bit versions only). - Mac: Webots runs on macOS macOS 12 "Monterey", macOS 13 "Ventura", and macOS 14 "Sonoma". diff --git a/docs/reference/changelog-r2024.md b/docs/reference/changelog-r2024.md index 3932aeb5b9d..4d04712bcba 100644 --- a/docs/reference/changelog-r2024.md +++ b/docs/reference/changelog-r2024.md @@ -4,6 +4,7 @@ Released on December **th, 2023. - New Features - **Change the name of the web scene format from `X3D` to `W3D` ([#6280](https://github.com/cyberbotics/webots/pull/6280)).** + - Removed support for Ubuntu 20.04 "Focal Fossa" and added support for Ubuntu 24.04 "Noble Numbat" ([#6704](https://github.com/cyberbotics/webots/pull/6704)). - Removed support for macOS 11 "Big Sur" and added support for macOS 14 "Sonoma" ([#6580](https://github.com/cyberbotics/webots/pull/6580)). - Added the `indirectFieldAccess` tag to allow the `fields` variable to be used in proto templates without referencing a specific field ([#6614](https://github.com/cyberbotics/webots/pull/6614)). - Added a method to include all subtypes of a node type in a PROTO field restriction ([#6574](https://github.com/cyberbotics/webots/pull/6574)). diff --git a/projects/default/libraries/vehicle/java/Makefile b/projects/default/libraries/vehicle/java/Makefile index 63670bb34e2..512d33e9fde 100644 --- a/projects/default/libraries/vehicle/java/Makefile +++ b/projects/default/libraries/vehicle/java/Makefile @@ -76,7 +76,7 @@ $(JAR): JAVA_CLASSES @jar cfv "$@" $(MODULE_PATH)/*.class > /dev/null JAVA_CLASSES: $(JAVA_SOURCES) - @javac --release 8 -classpath $(WEBOTS_CONTROLLER_LIB_PATH)/java/Controller.jar $(JAVA_SOURCES) -d . + @javac --release 11 -classpath $(WEBOTS_CONTROLLER_LIB_PATH)/java/Controller.jar $(JAVA_SOURCES) -d . $(JAVA_SOURCES): $(WRAPPER) diff --git a/projects/languages/java/controllers/Driver/Driver.java b/projects/languages/java/controllers/Driver/Driver.java index 5fd655fb680..aa95ec06f89 100644 --- a/projects/languages/java/controllers/Driver/Driver.java +++ b/projects/languages/java/controllers/Driver/Driver.java @@ -36,6 +36,9 @@ public class Driver extends Supervisor { private double[] translation = {x, y, 0}; public Driver() { + } + + public void initialize() { emitter = getEmitter("emitter"); Node robot = getFromDef("ROBOT1"); if (robot == null) @@ -111,6 +114,7 @@ private void displayHelp(){ public static void main(String[] args) { Driver controller = new Driver(); + controller.initialize(); controller.run(); } } diff --git a/projects/languages/java/controllers/Slave/Slave.java b/projects/languages/java/controllers/Slave/Slave.java index 021b402ab78..fe54cea6c76 100644 --- a/projects/languages/java/controllers/Slave/Slave.java +++ b/projects/languages/java/controllers/Slave/Slave.java @@ -46,6 +46,9 @@ private double boundSpeed(double speed) { } public Slave() { + } + + public void initialize() { camera = getCamera("camera"); camera.enable(4*timeStep); receiver = getReceiver("receiver"); @@ -106,6 +109,7 @@ else if (message.equals("turn")) public static void main(String[] args) { Slave controller = new Slave(); + controller.initialize(); controller.run(); } } diff --git a/projects/samples/contests/ratslife/controllers/Rat0/Rat0.java b/projects/samples/contests/ratslife/controllers/Rat0/Rat0.java index 04e16d2cb23..60679ec53b8 100644 --- a/projects/samples/contests/ratslife/controllers/Rat0/Rat0.java +++ b/projects/samples/contests/ratslife/controllers/Rat0/Rat0.java @@ -38,6 +38,9 @@ public class Rat0 extends Robot { protected LED[] leds = new LED[10]; public Rat0() { + } + + public void initialize() { accelerometer = getAccelerometer("accelerometer"); camera = getCamera("camera"); camera.enable(8*timeStep); @@ -161,6 +164,7 @@ public void run() { public static void main(String[] args) { Rat0 rat0 = new Rat0(); + rat0.initialize(); rat0.run(); } } diff --git a/projects/samples/contests/ratslife/controllers/Rat1/Rat1.java b/projects/samples/contests/ratslife/controllers/Rat1/Rat1.java index 12fe9c7612b..7fc38de34d2 100644 --- a/projects/samples/contests/ratslife/controllers/Rat1/Rat1.java +++ b/projects/samples/contests/ratslife/controllers/Rat1/Rat1.java @@ -38,6 +38,10 @@ public class Rat1 extends Robot { protected LED[] leds = new LED[10]; public Rat1() { + + } + + public void initialize() { accelerometer = getAccelerometer("accelerometer"); camera = getCamera("camera"); camera.enable(8*timeStep); @@ -161,6 +165,7 @@ public void run() { public static void main(String[] args) { Rat1 rat1 = new Rat1(); + rat1.initialize(); rat1.run(); } } diff --git a/projects/samples/devices/controllers/EmitterReceiver/EmitterReceiver.java b/projects/samples/devices/controllers/EmitterReceiver/EmitterReceiver.java index 695fb522593..525d7d8ecde 100644 --- a/projects/samples/devices/controllers/EmitterReceiver/EmitterReceiver.java +++ b/projects/samples/devices/controllers/EmitterReceiver/EmitterReceiver.java @@ -36,6 +36,9 @@ protected void printConsole(String message) { } public EmitterReceiver() { + } + + public void initialize() { // As we are using the same controller for the emitter and the // receiver, we need to distinguish them. @@ -140,6 +143,7 @@ else if (ir0Value > 500) { public static void main(String[] args) { EmitterReceiver robot = new EmitterReceiver(); + robot.initialize(); robot.run(); } } diff --git a/projects/samples/robotbenchmark/include/robotbenchmark.h b/projects/samples/robotbenchmark/include/robotbenchmark.h index 0555251340a..ce93937eb07 100644 --- a/projects/samples/robotbenchmark/include/robotbenchmark.h +++ b/projects/samples/robotbenchmark/include/robotbenchmark.h @@ -88,11 +88,16 @@ static inline void robotbenchmark_record(const char *answer, const char *benchma } int l = 1024 + strlen(user) + strlen(benchmark); char *command = malloc(l); - snprintf(command, l, - "wget -qO- " - "--post-data=\"%s&record=%f&benchmark=%s&key=%s\" " - "%s/record.php", - user, record, benchmark, key, host); + int written = snprintf(command, l, + "wget -qO- " + "--post-data=\"%s&record=%f&benchmark=%s&key=%s\" " + "%s/record.php", + user, record, benchmark, key, host); + if (written < 0 || (size_t)written >= l) { + fprintf(stderr, "Error: Command construction failed or truncated.\n"); + free(command); + return; + } free(user); file = popen(command, "r"); if (!file) { diff --git a/projects/samples/robotbenchmark/wall_following/controllers/wall_following_supervisor/wall_following_supervisor.c b/projects/samples/robotbenchmark/wall_following/controllers/wall_following_supervisor/wall_following_supervisor.c index d27fda7413e..d6e63a4f0cc 100644 --- a/projects/samples/robotbenchmark/wall_following/controllers/wall_following_supervisor/wall_following_supervisor.c +++ b/projects/samples/robotbenchmark/wall_following/controllers/wall_following_supervisor/wall_following_supervisor.c @@ -25,7 +25,7 @@ #include #define BENCHMARK_DURATION 60 -//#define ALLOW_LABELS true // uncomment to enable labels +// #define ALLOW_LABELS true // uncomment to enable labels static WallFollowingMetric *generate_metric_from_proto(const double *robot_starting_position) { WallFollowingMetric *metric = NULL; diff --git a/projects/vehicles/plugins/robot_windows/automobile_window/AbstractWidget.cpp b/projects/vehicles/plugins/robot_windows/automobile_window/AbstractWidget.cpp index 4e2c3f2128d..d328dd322b8 100644 --- a/projects/vehicles/plugins/robot_windows/automobile_window/AbstractWidget.cpp +++ b/projects/vehicles/plugins/robot_windows/automobile_window/AbstractWidget.cpp @@ -22,7 +22,11 @@ AbstractWidget::AbstractWidget(QWidget *parent) : QWidget(parent) { mLayout = new QGridLayout(this); mEnableCheckBox = new QCheckBox("Disabled", this); +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + connect(mEnableCheckBox, &QCheckBox::checkStateChanged, this, &AbstractWidget::updateEnableCheckBoxText); +#else connect(mEnableCheckBox, &QCheckBox::stateChanged, this, &AbstractWidget::updateEnableCheckBoxText); +#endif mLayout->addWidget(mEnableCheckBox, 0, 0); mValueLabel = new QLabel("", this); diff --git a/projects/vehicles/plugins/robot_windows/automobile_window/GeneralInformationWidget.cpp b/projects/vehicles/plugins/robot_windows/automobile_window/GeneralInformationWidget.cpp index fb5833a5269..e2e04bffb57 100644 --- a/projects/vehicles/plugins/robot_windows/automobile_window/GeneralInformationWidget.cpp +++ b/projects/vehicles/plugins/robot_windows/automobile_window/GeneralInformationWidget.cpp @@ -31,7 +31,11 @@ using namespace std; GeneralInformationWidget::GeneralInformationWidget(QWidget *parent) : QWidget(parent) { mEnableCheckBox = new QCheckBox("Disabled", this); +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + connect(mEnableCheckBox, &QCheckBox::checkStateChanged, this, &GeneralInformationWidget::updateEnableCheckBoxText); +#else connect(mEnableCheckBox, &QCheckBox::stateChanged, this, &GeneralInformationWidget::updateEnableCheckBoxText); +#endif // define drawing position int height = parent->height(); diff --git a/resources/Makefile.java.include b/resources/Makefile.java.include index 5c1c5ebc528..ae1bbf78d8b 100644 --- a/resources/Makefile.java.include +++ b/resources/Makefile.java.include @@ -81,15 +81,15 @@ endif # set the Java compiler options ifneq ($(strip $(CLASSPATH)),) ifeq ($(OSTYPE),windows) - JAVAC_OPTS += -Xlint -classpath "$(WEBOTS_CONTROLLER_LIB_PATH)/java/Controller.jar;$(CLASSPATH);." --release 8 + JAVAC_OPTS += -Xlint -classpath "$(WEBOTS_CONTROLLER_LIB_PATH)/java/Controller.jar;$(CLASSPATH);." --release 11 else - JAVAC_OPTS += -Xlint:-options -Xlint -classpath "$(WEBOTS_CONTROLLER_LIB_PATH)/java/Controller.jar:$(CLASSPATH):." --release 8 + JAVAC_OPTS += -Xlint:-options -Xlint -classpath "$(WEBOTS_CONTROLLER_LIB_PATH)/java/Controller.jar:$(CLASSPATH):." --release 11 endif else ifeq ($(OSTYPE),windows) - JAVAC_OPTS += -Xlint -classpath "$(WEBOTS_CONTROLLER_LIB_PATH)/java/Controller.jar;." --release 8 + JAVAC_OPTS += -Xlint -classpath "$(WEBOTS_CONTROLLER_LIB_PATH)/java/Controller.jar;." --release 11 else - JAVAC_OPTS += -Xlint:-options -Xlint -classpath "$(WEBOTS_CONTROLLER_LIB_PATH)/java/Controller.jar":. --release 8 + JAVAC_OPTS += -Xlint:-options -Xlint -classpath "$(WEBOTS_CONTROLLER_LIB_PATH)/java/Controller.jar":. --release 11 endif endif diff --git a/resources/Makefile.os.include b/resources/Makefile.os.include index 7a56e5cd037..59c6887f9bd 100644 --- a/resources/Makefile.os.include +++ b/resources/Makefile.os.include @@ -59,7 +59,7 @@ ifeq ($(OSTYPE),linux) endif ifeq ($(OSTYPE),linux) ifeq ($(SNAP_NAME), webots) - UBUNTU_VERSION=20.04 + UBUNTU_VERSION=22.04 else ifneq (, $(shell which lsb_release)) UBUNTU_VERSION:=$(shell lsb_release -sr) diff --git a/scripts/install/linux_compilation_dependencies.sh b/scripts/install/linux_compilation_dependencies.sh index 90c17a42256..213b51ad584 100755 --- a/scripts/install/linux_compilation_dependencies.sh +++ b/scripts/install/linux_compilation_dependencies.sh @@ -15,9 +15,7 @@ apt update apt install --yes git lsb-release cmake swig libglu1-mesa-dev libglib2.0-dev libfreeimage3 libfreetype6-dev libxml2-dev libboost-dev libssh-gcrypt-dev libzip-dev libreadline-dev pbzip2 wget zip unzip python3 python3-pip libopenal-dev UBUNTU_VERSION=$(lsb_release -rs) -if [[ $UBUNTU_VERSION == "20.04" ]]; then - apt install --yes libzip5 perl libtext-template-perl -elif [[ $UBUNTU_VERSION == "22.04" ]]; then +if [[ $UBUNTU_VERSION == "22.04" || $UBUNTU_VERSION == "24.04" ]]; then apt install --yes libzip4 openssl else echo "Unsupported Linux version: dependencies may not be completely installed. Only the two latest Ubuntu LTS are supported." diff --git a/scripts/install/linux_optional_compilation_dependencies.sh b/scripts/install/linux_optional_compilation_dependencies.sh index 812413cbed6..60d0f28973a 100755 --- a/scripts/install/linux_optional_compilation_dependencies.sh +++ b/scripts/install/linux_optional_compilation_dependencies.sh @@ -19,11 +19,11 @@ apt install --yes lsb-release curl python3.7-dev python3.8-dev python3.9-dev pyt UBUNTU_VERSION=$(lsb_release -rs) if [[ $UBUNTU_VERSION == "22.04" ]]; then - apt install --yes openjdk-18-jdk -elif [[ $UBUNTU_VERSION == "20.04" ]]; then - apt install --yes openjdk-16-jdk + apt install --yes openjdk-18-jdk +elif [[ $UBUNTU_VERSION == "24.04" ]]; then + apt install --yes openjdk-21-jdk else - echo "Unsupported Linux version: dependencies may not be completely installed. Only the two latest Ubuntu LTS are supported." + echo "Unsupported Linux version: dependencies may not be completely installed. Only the two latest Ubuntu LTS versions are supported." fi script_full_path=$(dirname "$0") diff --git a/scripts/install/linux_runtime_dependencies.sh b/scripts/install/linux_runtime_dependencies.sh index c2011cd3cdc..4593476be2c 100755 --- a/scripts/install/linux_runtime_dependencies.sh +++ b/scripts/install/linux_runtime_dependencies.sh @@ -18,7 +18,7 @@ if [[ -z "$DISPLAY" ]]; then fi UBUNTU_VERSION=$(lsb_release -rs) -if [[ $UBUNTU_VERSION == "20.04" || $UBUNTU_VERSION == "22.04" ]]; then +if [[ $UBUNTU_VERSION == "22.04" || $UBUNTU_VERSION == "24.04" ]]; then apt install --yes ffmpeg else echo "Unsupported Linux version: dependencies may not be completely installed. Only the two latest Ubuntu LTS are supported." diff --git a/scripts/packaging/exist_in_projects_linux_20.04.txt b/scripts/packaging/exist_in_projects_linux_24.04.txt similarity index 100% rename from scripts/packaging/exist_in_projects_linux_20.04.txt rename to scripts/packaging/exist_in_projects_linux_24.04.txt diff --git a/scripts/packaging/linux_distro.py b/scripts/packaging/linux_distro.py index 3c0de417ce4..c5661109840 100644 --- a/scripts/packaging/linux_distro.py +++ b/scripts/packaging/linux_distro.py @@ -47,16 +47,6 @@ class LinuxWebotsPackage(WebotsPackage): "libxcb-xinerama.so.0", "libxcb-cursor.so.0" ] - USR_LIB_X68_64_20_04 = [ - "libHalf.so.24", - "libIex-2_3.so.24", - "libIexMath-2_3.so.24", - "libIlmThread-2_3.so.24", - "libIlmImf-2_3.so.24", - "libwebp.so.6", - "libzip.so.5", # needed by Robotis OP2 - "libx264.so.155" - ] USR_LIB_X68_64_22_04 = [ "libHalf-2_5.so.25", "libIex-2_5.so.25", @@ -67,6 +57,13 @@ class LinuxWebotsPackage(WebotsPackage): "libzip.so.4", # needed by Robotis OP2 "libx264.so.163" ] + USR_LIB_X68_64_24_04 = [ + "libIex-3_1.so.30", + "libIlmThread-3_1.so.30", + "libwebp.so.7", + "libzip.so.4", + "libx264.so.164" + ] def __init__(self, package_name): super().__init__(package_name) @@ -75,7 +72,7 @@ def __init__(self, package_name): self.snap_script_path = os.path.join(self.packaging_path, self.application_name_lowercase_and_dashes + '.snap') self.tarball_enabled = True - self.deb_enabled = distro.version() == '20.04' + self.deb_enabled = distro.version() == '22.04' self.snap_enabled = True if self.snap_enabled: # open snap script file and write header @@ -121,16 +118,7 @@ def create_webots_bundle(self, include_commit_file): # copy OpenSSL libraries from Ubuntu 20.04 system and needed on Ubuntu 22.04 system_lib_path = os.path.join('/usr', 'lib', 'x86_64-linux-gnu') package_webots_lib = os.path.join(self.package_webots_path, 'lib', 'webots') - if distro.version() == '20.04': - shutil.copy(os.path.join(self.webots_home, 'lib', 'webots', 'libcrypto.so.3'), - os.path.join(package_webots_lib, 'libcrypto.so.3')) - shutil.copy(os.path.join(self.webots_home, 'lib', 'webots', 'libcrypto.so'), - os.path.join(package_webots_lib, 'libcrypto.so')) - shutil.copy(os.path.join(self.webots_home, 'lib', 'webots', 'libssl.so.3'), - os.path.join(package_webots_lib, 'libssl.so.3')) - shutil.copy(os.path.join(self.webots_home, 'lib', 'webots', 'libssl.so'), - os.path.join(package_webots_lib, 'libssl.so')) - else: # Ubuntu 22.04 + if distro.version() == '22.04' or distro.version() == '24.04': # Ubuntu 22.04 and 24.04 openssl_libs = ['libcrypto.so.3', 'libcrypto.so', 'libssl.so.3', 'libssl.so'] for lib in openssl_libs: shutil.copy(os.path.join(system_lib_path, lib), package_webots_lib) @@ -171,10 +159,8 @@ def create_debian_bundle(self): # so that the Robotis OP2 robot window works out of the box system_lib_path = os.path.join('/usr', 'lib', 'x86_64-linux-gnu') package_webots_lib = os.path.join(self.package_webots_path, 'lib', 'webots') - if distro.version() == '22.04': + if distro.version() == '22.04' or distro.version() == '24.04': shutil.copy(os.path.join(system_lib_path, 'libzip.so.4'), package_webots_lib) - else: - shutil.copy(os.path.join(system_lib_path, 'libzip.so.5'), package_webots_lib) # write 'DEBIAN/control' file required to create debian package os.makedirs(os.path.join(self.distribution_path, 'debian', 'DEBIAN')) @@ -212,15 +198,15 @@ def create_tarball_bundle(self): print("\ncreating the {}/{}-{}-x86-64.tar.bz2 tarball" .format(self.distribution_path, self.application_name_lowercase_and_dashes, self.package_version)) - # add specific libraries needed for tarball package + # add specific libraries needed for tarball package (Ubuntu 24.04) usr_lib_x68_64 = self.USR_LIB_X68_64 usr_lib_x68_64.append('libjpeg.so.8') if distro.version() == '22.04': usr_lib_x68_64 += self.USR_LIB_X68_64_22_04 usr_lib_x68_64.append('libraw.so.20') - else: - usr_lib_x68_64 += self.USR_LIB_X68_64_20_04 - usr_lib_x68_64.append('libraw.so.19') + if distro.version() == '24.04': + usr_lib_x68_64 += self.USR_LIB_X68_64_24_04 + usr_lib_x68_64.append('libraw.so.23') system_lib_path = os.path.join('/usr', 'lib', 'x86_64-linux-gnu') package_webots_lib = os.path.join(self.package_webots_path, 'lib', 'webots') for lib in usr_lib_x68_64: @@ -243,8 +229,6 @@ def create_snap_bundle(self): "libcanberra-gtk-module", "libcanberra-gtk3-module"] - usr_lib_x68_64_linux_gnu += self.USR_LIB_X68_64 + self.USR_LIB_X68_64_20_04 - for lib in usr_lib_x68_64_linux_gnu: self.snap_script.write("cp /usr/lib/x86_64-linux-gnu/{} $DESTDIR/usr/lib/x86_64-linux-gnu/\n".format(lib)) self.snap_script.write("mkdir $DESTDIR/usr/share/webots/include/libssh\n") diff --git a/src/controller/c/robot.c b/src/controller/c/robot.c index 50616de6680..00305b4848d 100644 --- a/src/controller/c/robot.c +++ b/src/controller/c/robot.c @@ -1264,9 +1264,15 @@ static char *compute_socket_filename(char *error_buffer) { return NULL; } closedir(dr); + size_t path_length = strlen(webots_instance_folder) + 9; // check if Webots is currently loading char *loading_file_path = malloc(strlen(webots_instance_folder) + 9); // webots_instance_folder + '/loading' - snprintf(loading_file_path, strlen(webots_instance_folder) + 9, "%s/loading", webots_instance_folder); + int written = snprintf(loading_file_path, path_length, "%s/loading", webots_instance_folder); + if (written < 0 || (size_t)written >= path_length) { + fprintf(stderr, "Error: Constructing loading_file_path failed or truncated.\n"); + free(loading_file_path); + exit(EXIT_FAILURE); + } FILE *loading_file = fopen(loading_file_path, "r"); if (loading_file) { fclose(loading_file); diff --git a/src/controller/java/Makefile b/src/controller/java/Makefile index e89e798872e..cc65533704b 100644 --- a/src/controller/java/Makefile +++ b/src/controller/java/Makefile @@ -182,7 +182,7 @@ $(WEBOTS_CONTROLLER_LIB_PATH)/java/$(LIBNAME).dll: $(WRAPPER_OBJECT) $(JAR_FILE): $(WRAPPER) @echo "# compiling java sources" - javac --release 8 $(SWIG_OUTPUT_PATH)/*.java -d . + javac --release 11 $(SWIG_OUTPUT_PATH)/*.java -d . @echo "# creating "$@ @mkdir -p $(WEBOTS_CONTROLLER_LIB_PATH)/java jar cfv $(JAR_FILE) $(CONTROLLERPATH)/*.class > /dev/null diff --git a/src/webots/gui/WbNewProtoWizard.cpp b/src/webots/gui/WbNewProtoWizard.cpp index a2a8dc119f9..113deef25a9 100644 --- a/src/webots/gui/WbNewProtoWizard.cpp +++ b/src/webots/gui/WbNewProtoWizard.cpp @@ -515,7 +515,11 @@ void WbNewProtoWizard::updateBaseNode() { selectAll->setText(tr("select all")); mExposedFieldCheckBoxes.push_back(selectAll); layout->addWidget(selectAll); +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + connect(selectAll, &QCheckBox::checkStateChanged, this, &WbNewProtoWizard::updateCheckBox); +#else connect(selectAll, &QCheckBox::stateChanged, this, &WbNewProtoWizard::updateCheckBox); +#endif foreach (const QString &name, fieldNames) { mExposedFieldCheckBoxes.push_back(new QCheckBox(name)); diff --git a/src/webots/scene_tree/WbBoolEditor.cpp b/src/webots/scene_tree/WbBoolEditor.cpp index 011b0e59ec3..c96214a8f30 100644 --- a/src/webots/scene_tree/WbBoolEditor.cpp +++ b/src/webots/scene_tree/WbBoolEditor.cpp @@ -24,7 +24,11 @@ WbBoolEditor::WbBoolEditor(QWidget *parent) : WbValueEditor(parent), mCheckBox(new QCheckBox(this)) { mCheckBox->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum); +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + connect(mCheckBox, &QCheckBox::checkStateChanged, this, &WbBoolEditor::apply); +#else connect(mCheckBox, &QCheckBox::stateChanged, this, &WbBoolEditor::apply); +#endif mLayout->addWidget(mCheckBox, 1, 1); }