From 32d5f3b4be6db9b48f14baf744ca70ac678ce759 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Sat, 27 Jul 2024 22:17:22 +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 ffdb227..4a06d6e 100755 --- a/utils/bootstrap.py +++ b/utils/bootstrap.py @@ -19,6 +19,7 @@ import tarfile 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 dependencies_dir = project_root_dir / '.dependencies' @@ -99,7 +100,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 e7abc6a7d894b885dfcecc419ead5bba7fabaab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Sat, 27 Jul 2024 22:17:47 +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 ++++---- utils/holly/Jenkinsfile | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.vscode/cmake-kits.json b/.vscode/cmake-kits.json index 8e3bae6..7eb6ec0 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 e28c1e3..e1e858f 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Run `./utils/bootstrap.py` `bootstrap.py` will now download all the "missing" dependencies into the `.dependencies` folder: - clang-format-9.0.0-noext - cmake-3.22.5 -- ninja-1.10.2 +- ninja-1.12.1 - avr-gcc-7.3.0 ### How to build the preliminary project so far: diff --git a/utils/bootstrap.py b/utils/bootstrap.py index 4a06d6e..ea2e026 100755 --- a/utils/bootstrap.py +++ b/utils/bootstrap.py @@ -29,11 +29,11 @@ dependencies_dir = project_root_dir / '.dependencies' # 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': { diff --git a/utils/holly/Jenkinsfile b/utils/holly/Jenkinsfile index de1733f..e49b577 100644 --- a/utils/holly/Jenkinsfile +++ b/utils/holly/Jenkinsfile @@ -93,11 +93,11 @@ pipeline { steps { sh """ python3 utils/bootstrap.py - export PATH=\$PWD/.dependencies/cmake-3.22.5/bin:\$PWD/.dependencies/ninja-1.10.2:\$PATH + export PATH=\$PWD/.dependencies/cmake-3.22.5/bin:\$PWD/.dependencies/ninja-1.12.1:\$PATH export CTEST_OUTPUT_ON_FAILURE=1 mkdir -p build-test LD_LIBRARY_PATH=/usr/local/lib32 \$PWD/.dependencies/cmake-3.22.5/bin/ctest --build-and-test . build-test \ - -DCMAKE_MAKE_PROGRAM=\$PWD/.dependencies/ninja-1.10.2/ninja \ + -DCMAKE_MAKE_PROGRAM=\$PWD/.dependencies/ninja-1.12.1/ninja \ --build-generator Ninja \ --build-target tests \ --test-command ctest