From 2e70cfe63cdfdfe394f23fd8bec008880a584f83 Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Sun, 10 Aug 2025 11:57:20 -0500 Subject: [PATCH] micropython: 1.25.0 -> 1.26.0 Needs additional patch to build on `aarch64-linux` on GCC 14 due to a submodule containing a problematic version of Mbed TLS. Modeled after nixpkgs 9ff0e609fe7a6bd61e9f289b3f5c0bed3f55e751. Also disables additional flaky tests on `aarch64-darwin` (upstream has disabled some of the same as well). --- pkgs/by-name/mi/micropython/package.nix | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/mi/micropython/package.nix b/pkgs/by-name/mi/micropython/package.nix index 2bc2e567f3bd..efb64c675551 100644 --- a/pkgs/by-name/mi/micropython/package.nix +++ b/pkgs/by-name/mi/micropython/package.nix @@ -2,6 +2,7 @@ stdenv, lib, fetchFromGitHub, + fetchpatch, pkg-config, python3, libffi, @@ -10,13 +11,13 @@ stdenv.mkDerivation rec { pname = "micropython"; - version = "1.25.0"; + version = "1.26.0"; src = fetchFromGitHub { owner = "micropython"; repo = "micropython"; tag = "v${version}"; - hash = "sha256-yH5omiYs07ZKECI+DAnpYq4T+r2O/RuGdtN+dhYxePc="; + hash = "sha256-T0yaTXRQFEdx6lap+S68I2RRA2kQnjbKGz+YB6okJkY="; fetchSubmodules = true; # remove unused libraries from rp2 port's SDK. we leave this and the other @@ -30,6 +31,20 @@ stdenv.mkDerivation rec { ''; }; + patches = [ + # Fixes Mbed TLS submodule build with GCC 14. + # + # See: + # * + # * + (fetchpatch { + url = "https://raw.githubusercontent.com/openwrt/openwrt/52b6c9247997e51a97f13bb9e94749bc34e2d52e/package/libs/mbedtls/patches/100-fix-gcc14-build.patch"; + stripLen = 1; + extraPrefix = "lib/mbedtls/"; + hash = "sha256-Sllp/iWWEhykMJ3HALw5KzR4ta22120Jcl51JZCkZE0="; + }) + ]; + nativeBuildInputs = [ pkg-config python3 @@ -53,9 +68,9 @@ stdenv.mkDerivation rec { skippedTests = " -e select_poll_fd" - + lib.optionalString ( - stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64 - ) " -e ffi_callback -e float_parse -e float_parse_doubleproc" + + + lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) + " -e ffi_callback -e float_parse -e float_parse_doubleproc -e 'thread/stress_*' -e select_poll_eintr" + lib.optionalString ( stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64 ) " -e float_parse";