From 4c8b97f8e3ef9d1e80c9462b1653e79f635b52e5 Mon Sep 17 00:00:00 2001 From: Jonas Blixt Date: Tue, 20 Aug 2024 19:56:47 +0200 Subject: [PATCH 1/4] ci: Bump cibuildwheel Current version was using EOL'ed version of centos and broke the build. --- .github/workflows/punchboot-tools.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/punchboot-tools.yml b/.github/workflows/punchboot-tools.yml index 64419d82..b1250604 100644 --- a/.github/workflows/punchboot-tools.yml +++ b/.github/workflows/punchboot-tools.yml @@ -49,7 +49,7 @@ jobs: install_name_tool -id @rpath/libusb-1.0.0.dylib libusb_arm64/1.0.26/lib/libusb-1.0.0.dylib - name: Build wheels - uses: pypa/cibuildwheel@v2.16.5 + uses: pypa/cibuildwheel@v2.20.0 with: package-dir: . output-dir: wheelhouse From 247b3fd0c27e44cf4058db46816c4d53c6d9a11a Mon Sep 17 00:00:00 2001 From: Jonas Blixt Date: Tue, 20 Aug 2024 20:12:58 +0200 Subject: [PATCH 2/4] build: Fix some ruff config issues Ignore files in scripts/ for now. --- pyproject.toml | 4 +--- setup.py | 2 +- tools/punchboot/punchboot/session.py | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b1393773..69efe877 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,9 +3,7 @@ line-length = 100 extend-exclude = [ "pki", "doc", - "scripts/genconfig.py", - "scripts/kconfiglib.py", - "scripts/menuconfig.py", + "scripts/**", ] target-version = "py38" diff --git a/setup.py b/setup.py index 0a89888a..e0074c80 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ import platform from pathlib import Path -from setuptools import Extension, setup # type: ignore +from setuptools import Extension, setup # type: ignore # noqa: PGH003 pb_base_path: str = "tools/punchboot" plat: str = platform.system() diff --git a/tools/punchboot/punchboot/session.py b/tools/punchboot/punchboot/session.py index eecfe4c8..04639b8c 100644 --- a/tools/punchboot/punchboot/session.py +++ b/tools/punchboot/punchboot/session.py @@ -394,7 +394,7 @@ def board_run_command(self, cmd: Union[str, int], args: bytes = b"") -> bytes: def board_read_status(self) -> str: """Read board status.""" - return self.pb_s.board_read_status().strip() + return str(self.pb_s.board_read_status().strip()) def slc_set_configuration(self) -> None: """Set SLC to configuration. From e9eb808b83fbaa548859363c6259042b80860f9e Mon Sep 17 00:00:00 2001 From: Jonas Blixt Date: Tue, 20 Aug 2024 20:24:45 +0200 Subject: [PATCH 3/4] build: macos: Update libusb --- .github/workflows/punchboot-tools.yml | 8 ++++---- pyproject.toml | 2 +- setup.py | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/punchboot-tools.yml b/.github/workflows/punchboot-tools.yml index b1250604..d589aed4 100644 --- a/.github/workflows/punchboot-tools.yml +++ b/.github/workflows/punchboot-tools.yml @@ -6,8 +6,8 @@ on: [pull_request, push, workflow_dispatch] # version information in path's. env: PYTHON_VERSION: "3.12" - LIBUSB_MACOS_ARM64_URL: "https://ghcr.io/v2/homebrew/core/libusb/blobs/sha256:ab90516396d8dc99f96d31615bcbddfcfd2082fcc7494dabb9d22b275628e800" - LIBUSB_MACOS_X86_64_URL: "https://ghcr.io/v2/homebrew/core/libusb/blobs/sha256:e79be7d4c611f0017567172771761b1df62d140e79ffa6d2538577eb24a48e44" + LIBUSB_MACOS_ARM64_URL: "https://ghcr.io/v2/homebrew/core/libusb/blobs/sha256:05c5363ff9f8a4aeaf65eb3f95fba3a4fc7f665d35a627a2d212c43fb7ad5838" + LIBUSB_MACOS_X86_64_URL: "https://ghcr.io/v2/homebrew/core/libusb/blobs/sha256:e02e54902348f1918adf758a6b2f4c5d113570f4c98e9f0a38b8d3b24c50c942" jobs: build_wheels: @@ -45,8 +45,8 @@ jobs: # in binary wheels. # # If we prefix it with "@rpath" it works better. - install_name_tool -id @rpath/libusb-1.0.0.dylib libusb_x86_64/1.0.26/lib/libusb-1.0.0.dylib - install_name_tool -id @rpath/libusb-1.0.0.dylib libusb_arm64/1.0.26/lib/libusb-1.0.0.dylib + install_name_tool -id @rpath/libusb-1.0.0.dylib libusb_x86_64/1.0.27/lib/libusb-1.0.0.dylib + install_name_tool -id @rpath/libusb-1.0.0.dylib libusb_arm64/1.0.27/lib/libusb-1.0.0.dylib - name: Build wheels uses: pypa/cibuildwheel@v2.20.0 diff --git a/pyproject.toml b/pyproject.toml index 69efe877..224b959b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -65,4 +65,4 @@ environment = "PB_MACOS_ARCH=x86_64" [tool.cibuildwheel.macos] archs = ["x86_64", "arm64"] -repair-wheel-command = "DYLD_LIBRARY_PATH=libusb_{delocate_archs}/1.0.26/lib delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}" +repair-wheel-command = "DYLD_LIBRARY_PATH=libusb_{delocate_archs}/1.0.27/lib delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}" diff --git a/setup.py b/setup.py index e0074c80..7277ac28 100644 --- a/setup.py +++ b/setup.py @@ -20,8 +20,8 @@ # get target arch here when cross compiling wheels. _target_arch = os.environ["PB_MACOS_ARCH"] _libraries = ["usb-1.0"] - _library_dirs = [f"libusb_{_target_arch}/1.0.26/lib"] - _include_dirs = ["include", f"libusb_{_target_arch}/1.0.26/include"] + _library_dirs = [f"libusb_{_target_arch}/1.0.27/lib"] + _include_dirs = ["include", f"libusb_{_target_arch}/1.0.27/include"] else: _libraries = ["usb-1.0"] _library_dirs = [] From 4728731da5dad2a6d5e52315e5d4ca43406581a6 Mon Sep 17 00:00:00 2001 From: Jonas Blixt Date: Tue, 20 Aug 2024 20:45:01 +0200 Subject: [PATCH 4/4] ci: macos: Bump min required version to 12. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 224b959b..6953e551 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -65,4 +65,4 @@ environment = "PB_MACOS_ARCH=x86_64" [tool.cibuildwheel.macos] archs = ["x86_64", "arm64"] -repair-wheel-command = "DYLD_LIBRARY_PATH=libusb_{delocate_archs}/1.0.27/lib delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}" +repair-wheel-command = "DYLD_LIBRARY_PATH=libusb_{delocate_archs}/1.0.27/lib delocate-wheel --require-target-macos-version 12.0 --require-archs {delocate_archs} -w {dest_dir} -v {wheel}"