From a926675c35125074a007a13afea2678bbe112c8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Sat, 27 Jul 2024 21:37:43 +0000 Subject: [PATCH 1/2] bootstrap: fix DeprecationWarning DeprecationWarning: Python 3.14 will, by default, filter extracted tar archives and reject files or modify their metadata. Use the filter argument to control this behavior. See: https://docs.python.org/3.12/library/tarfile.html#tarfile-extraction-filter --- utils/bootstrap.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/utils/bootstrap.py b/utils/bootstrap.py index c0eff0a00d..fb4c36b0af 100755 --- a/utils/bootstrap.py +++ b/utils/bootstrap.py @@ -19,6 +19,7 @@ import zipfile from argparse import ArgumentParser from pathlib import Path +from tarfile import TarFile from urllib.request import urlretrieve project_root_dir = Path(__file__).resolve().parent.parent @@ -92,7 +93,11 @@ def download_and_unzip(url: str, directory: Path): obj = tarfile.open(f) else: obj = zipfile.ZipFile(f, 'r') - obj.extractall(path=str(extract_dir)) + + if isinstance(obj, TarFile): + obj.extractall(path=str(extract_dir), filter='data') + else: # Zip file + obj.extractall(path=str(extract_dir)) subdir = find_single_subdir(extract_dir) shutil.move(str(subdir), str(directory)) From 48f7cd5270489f42486c6bded570c7858db92e44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Sat, 27 Jul 2024 21:41:27 +0000 Subject: [PATCH 2/2] Upgrade ninja from 1.10.2 to 1.12.1 The update brings better support for Windows :) Changelogs: * https://github.com/ninja-build/ninja/releases/tag/v1.12.1 * https://github.com/ninja-build/ninja/releases/tag/v1.12.0 * https://github.com/ninja-build/ninja/releases/tag/v1.11.1 * https://github.com/ninja-build/ninja/releases/tag/v1.11.0 --- .vscode/cmake-kits.json | 2 +- README.md | 2 +- utils/bootstrap.py | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.vscode/cmake-kits.json b/.vscode/cmake-kits.json index 8e3bae6d64..7eb6ec0a47 100644 --- a/.vscode/cmake-kits.json +++ b/.vscode/cmake-kits.json @@ -3,7 +3,7 @@ "name": "avr-gcc", "toolchainFile": "${workspaceFolder}/cmake/AvrGcc.cmake", "cmakeSettings": { - "CMAKE_MAKE_PROGRAM": "${workspaceFolder}/.dependencies/ninja-1.10.2/ninja", + "CMAKE_MAKE_PROGRAM": "${workspaceFolder}/.dependencies/ninja-1.12.1/ninja", "CMAKE_BUILD_TYPE": "Release" } } diff --git a/README.md b/README.md index b766a776ad..26b333d6c5 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ The workflow should be pretty straightforward for anyone with development experi Building with cmake requires: - cmake >= 3.22.5 -- ninja >= 1.10.2 (optional, but recommended) +- ninja >= 1.12.1 (optional, but recommended) Python >= 3.6 is also required with the following modules: diff --git a/utils/bootstrap.py b/utils/bootstrap.py index fb4c36b0af..45e2a46588 100755 --- a/utils/bootstrap.py +++ b/utils/bootstrap.py @@ -30,11 +30,11 @@ # yapf: disable dependencies = { 'ninja': { - 'version': '1.10.2', + 'version': '1.12.1', 'url': { - 'Linux': 'https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-linux.zip', - 'Windows': 'https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-win.zip', - 'Darwin': 'https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-mac.zip', + 'Linux': 'https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-linux.zip', + 'Windows': 'https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-win.zip', + 'Darwin': 'https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-mac.zip', }, }, 'cmake': {