From 1f348d3b45a789a7e11b1de6dcfd16f15d59fbbd Mon Sep 17 00:00:00 2001 From: Brooks Davis Date: Fri, 4 Apr 2025 19:25:15 +0100 Subject: [PATCH 1/2] Silence flake8 warning about nonlocal F824 Doesn't seem to understand methods of modifying a variable that aren't direct assignment. ./pycheribuild/projects/run_fvp.py:292:21: F824 `nonlocal extra_args` is unused: name is never assigned in scope nonlocal extra_args ^ ./pycheribuild/projects/run_qemu.py:447:13: F824 `nonlocal have_9pfs_support` is unused: name is never assigned in scope nonlocal have_9pfs_support ^ ./pycheribuild/projects/run_qemu.py:448:13: F824 `nonlocal have_smbfs_support` is unused: name is never assigned in scope nonlocal have_smbfs_support ^ ./pycheribuild/projects/run_qemu.py:449:13: F824 `nonlocal qemu_command` is unused: name is never assigned in scope nonlocal qemu_command ^ 4 F824 `nonlocal extra_args` is unused: name is never assigned in scope Error: Process completed with exit code 1. --- .flake8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.flake8 b/.flake8 index 95240065f..54d69e74e 100644 --- a/.flake8 +++ b/.flake8 @@ -8,5 +8,5 @@ extend-exclude = show-source = true statistics = true # E203 is incompatible with black -ignore = E121,E123,E126,E203,E226,E24,E704,W503,W504 +ignore = E121,E123,E126,E203,E226,E24,E704,F824,W503,W504 # TODO: max-complexity = 20 From 36b0baf6f49f9cc74737629af09713f5ad218f2e Mon Sep 17 00:00:00 2001 From: Brooks Davis Date: Fri, 7 Mar 2025 00:34:45 +0000 Subject: [PATCH 2/2] cheribsd-release: support vm images I've put support behind a flag as older CheriBSD trees will break without patchs. If you add the flag --cheribsd-release/build-vm-images to a cheribsd-release-* target and the source tree supports it, an image or images will be built as part of the release process. --- pycheribuild/projects/cross/cheribsd.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pycheribuild/projects/cross/cheribsd.py b/pycheribuild/projects/cross/cheribsd.py index b40d77957..705c9264b 100644 --- a/pycheribuild/projects/cross/cheribsd.py +++ b/pycheribuild/projects/cross/cheribsd.py @@ -2179,6 +2179,15 @@ def supported_architectures(self) -> "tuple[CrossCompileTarget, ...]": class BuildFreeBSDReleaseMixin(ReleaseMixinBase): + @classmethod + def setup_config_options(cls, **kwargs) -> None: + super().setup_config_options(**kwargs) + cls.build_vm_images = cls.add_bool_option( + "build-vm-images", + _allow_unknown_targets=True, + help="Build VM images with releases.", + ) + def check_system_dependencies(self) -> None: super().check_system_dependencies() self.check_required_system_tool("bsdtar", cheribuild_target="bsdtar", apt="libarchive-tools") @@ -2244,6 +2253,10 @@ def process(self) -> None: release_args.set_env(INSTALL="sh " + str(self.source_dir / "tools/install.sh")) release_args.set_env(XZ_CMD=str(self.objdir / "tmp/legacy/usr/bin/xz -T 0")) + release_args.set_with_options(QEMU=False) + if self.build_vm_images: + release_args.set_with_options(CLOUDWARE=True) + # Need bsdtar for @file support release_args.set_env(TAR_CMD="bsdtar")