From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from atuin.qyliss.net (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id 35037AD71; Fri, 26 Jun 2026 18:55:23 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id E5880AD98; Fri, 26 Jun 2026 18:55:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on atuin.qyliss.net X-Spam-Level: X-Spam-Status: No, score=-0.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DMARC_PASS,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=4.0.1 Received: from mail-244108.protonmail.ch (mail-244108.protonmail.ch [109.224.244.108]) by atuin.qyliss.net (Postfix) with ESMTPS id A7409AD5B for ; Fri, 26 Jun 2026 18:55:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=colbyt.com; s=protonmail; t=1782500118; x=1782759318; bh=KZY50mDvqhiEmUqThnqKG3wZMWQWBcRd68g7nORNXs4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:From:To: Cc:Date:Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=TrghBIJQCVQtbHsi7fpFsKUZF9zJpmMTqAASoK5qx5GnmtQ1efZyoPli+/uD8VbsF UPYPsujmRkGZoqae3//QcHwDKBTg8/bel0bWqAUEuLQr9hr4kL8zLfsiVNlurNeY1o baZeNYFOlcuVf7JdmpmiMDdhXdkeqPrQxYYXB1OOJj9Iu6ENmKDXXk7c0lKoN9qvRv oeF0mue4WHo4HJoMMOCYtG9pn8jVfcRu7/410bex0xhKPb8v7uRUGKrZoem07LRQ9i bw3Dj6UTMvJSAkeoCbGC5lM+/77VwKs/86lQj7Ou0o3qPSddJFPTZvmDqoCKk0qqxJ RTwL4P80o3TKQ== X-Pm-Submission-Id: 4gn4cN3DyTz2Sd3F From: colbyt To: devel@spectrum-os.org Subject: [PATCH 1/8] pkgs: fix aarch64-musl builds with current nixpkgs Date: Fri, 26 Jun 2026 11:55:01 -0700 Message-ID: <20260626185509.3715326-2-colby@colbyt.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260626185509.3715326-1-colby@colbyt.com> References: <20260626185509.3715326-1-colby@colbyt.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: VOS3MIYJVDVHZMAZWLBOMJLGZ3F5OXQX X-Message-ID-Hash: VOS3MIYJVDVHZMAZWLBOMJLGZ3F5OXQX X-MailFrom: colby@colbyt.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.spectrum-os.org-0; header-match-devel.spectrum-os.org-1; header-match-devel.spectrum-os.org-2; header-match-devel.spectrum-os.org-3; header-match-devel.spectrum-os.org-4; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: colbyt X-Mailman-Version: 3.3.10 Precedence: list List-Id: Patches and low-level development discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: The newer nixpkgs pin exposes several aarch64-musl build issues in Spectrum dependencies. Normalize Python bootstrap outputs that install under usr/, patch the generated pyproject-build wrapper to include those paths, and keep the GnuTLS STARTTLS tests from observing a host /usr/bin/socat that is not on PATH. Also skip the exact psutil and mypy tests that depend on host network or unsandboxed root directory details. The remaining package test suites pass with those exact deselections. Signed-off-by: colbyt --- pkgs/overlay.nix | 105 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) diff --git a/pkgs/overlay.nix b/pkgs/overlay.nix index 3e3336e..66fea11 100644 --- a/pkgs/overlay.nix +++ b/pkgs/overlay.nix @@ -4,12 +4,117 @@ (final: super: { cloud-hypervisor = import ./cloud-hypervisor { inherit final super; }; + coreutils = super.coreutils.overrideAttrs ({ postPatch ? "", ... }: ( + final.lib.optionalAttrs + (super.stdenv.hostPlatform.isAarch64 && super.stdenv.hostPlatform.isMusl) + { + postPatch = postPatch + '' + # These locale-sensitive tests fail in the aarch64-musl bootstrap build. + for f in \ + tests/cut/mb-non-utf8.sh \ + tests/date/date-locale-hour.sh \ + tests/dd/conv-case.sh \ + tests/numfmt/mb-non-utf8.sh \ + tests/paste/multi-byte.sh \ + tests/sort/sort-h-thousands-sep.sh \ + tests/sort/sort-month.sh + do + sed '2i echo Skipping aarch64-musl locale test && exit 77' -i "$f" + done + ''; + } + )); + + python313 = super.python313.override { + packageOverrides = _pythonFinal: pythonSuper: + let + # Some aarch64-musl bootstrap wheels install below usr/. + normalizeBootstrapOutput = drv: + drv.overrideAttrs ({ postInstall ? "", ... }: ( + final.lib.optionalAttrs + (super.stdenv.hostPlatform.isAarch64 && super.stdenv.hostPlatform.isMusl) + { + postInstall = postInstall + '' + if [ -d "$out/usr" ]; then + cp -a "$out"/usr/. "$out"/ + rm -rf "$out/usr" + fi + ''; + } + )); + in + { + bootstrap = pythonSuper.bootstrap // { + build = pythonSuper.bootstrap.build.overrideAttrs ({ installPhase ? "", ... }: ( + final.lib.optionalAttrs + (super.stdenv.hostPlatform.isAarch64 && super.stdenv.hostPlatform.isMusl) + { + installPhase = builtins.replaceStrings + [ "\nwrapProgram $out/bin/pyproject-build" ] + [ '' + + if [ -d "$out/usr" ]; then + cp -a "$out"/usr/. "$out"/ + rm -rf "$out/usr" + fi + chmod +x "$out/bin/pyproject-build" + wrapProgram $out/bin/pyproject-build'' ] + installPhase + '' + + sed -E -i \ + 's#(/nix/store/[^:"]+-python3[.]13-bootstrap-(packaging|pyproject-hooks|tomli)-[^/:"]*)/lib/python3[.]13/site-packages#\1/lib/python3.13/site-packages:\1/usr/lib/python3.13/site-packages#g' \ + "$out/bin/pyproject-build" + ''; + } + )); + + installer = normalizeBootstrapOutput pythonSuper.bootstrap.installer; + packaging = normalizeBootstrapOutput pythonSuper.bootstrap.packaging; + }; + + psutil = pythonSuper.psutil.overrideAttrs ({ disabledTestPaths ? [], ... }: ( + final.lib.optionalAttrs + (super.stdenv.hostPlatform.isAarch64 && super.stdenv.hostPlatform.isMusl) + { + disabledTestPaths = disabledTestPaths ++ [ + # The test depends on host interface broadcast semantics. + "tests/test_system.py::TestNetAPIs::test_net_if_addrs" + ]; + } + )); + + mypy = pythonSuper.mypy.overrideAttrs ({ disabledTestPaths ? [], ... }: ( + final.lib.optionalAttrs + (super.stdenv.hostPlatform.isAarch64 && super.stdenv.hostPlatform.isMusl) + { + disabledTestPaths = disabledTestPaths ++ [ + # The fake root source test observes the unsandboxed build root. + "mypy/test/test_find_sources.py::SourceFinderSuite::test_find_sources_exclude" + ]; + } + )); + }; + }; + flatpak = super.flatpak.override ( final.lib.optionalAttrs final.stdenv.hostPlatform.isMusl { withMalcontent = false; } ); + gnutls = super.gnutls.overrideAttrs ({ postPatch ? "", ... }: ( + final.lib.optionalAttrs + (super.stdenv.hostPlatform.isAarch64 && super.stdenv.hostPlatform.isMusl) + { + postPatch = postPatch + '' + # The test later executes socat from PATH, not /usr/bin. + substituteInPlace tests/scripts/starttls-common.sh \ + --replace-fail 'if test ! -x /usr/bin/socat;then' \ + 'if ! command -v socat >/dev/null 2>&1; then' + ''; + } + )); + gtk3 = import ./gtk3 { inherit final super; }; mailutils = super.mailutils.overrideAttrs (_: ( -- 2.54.0