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 <colby@colbyt.com> --- 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