Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

ponyc: arm64 and Darwin fixes

Fix -fpic/-fPIC on arm64. Re-enable tests on Darwin with a new patch.

+76 -12
+32 -6
pkgs/by-name/po/ponyc/disable-networking-tests.patch
··· 1 + From e49f97eb4b0fd27b26437638db7984fbcfd3a14f Mon Sep 17 00:00:00 2001 2 + From: Morgan Jones <me@numin.it> 3 + Date: Sun, 4 May 2025 15:46:07 -0700 4 + Subject: [PATCH] net: disable tests in the Nix sandbox 5 + 6 + --- 7 + packages/net/_test.pony | 19 +------------------ 8 + 1 file changed, 1 insertion(+), 18 deletions(-) 9 + 1 10 diff --git a/packages/net/_test.pony b/packages/net/_test.pony 2 - index 9044dfb1..f0ea10f7 100644 11 + index 05462eb2..c0c6cdfa 100644 3 12 --- a/packages/net/_test.pony 4 13 +++ b/packages/net/_test.pony 5 - @@ -26,11 +26,6 @@ actor \nodoc\ Main is TestList 6 - test(_TestTCPThrottle) 7 - end 14 + @@ -15,25 +15,8 @@ actor \nodoc\ Main is TestList 15 + new make() => None 8 16 17 + fun tag tests(test: PonyTest) => 18 + - // Tests below function across all systems and are listed alphabetically 19 + + // (@numinit): only this test works in the Nix sandbox: 20 + test(_TestTCPConnectionFailed) 21 + - test(_TestTCPExpect) 22 + - test(_TestTCPExpectOverBufferSize) 23 + - test(_TestTCPMute) 24 + - test(_TestTCPProxy) 25 + - test(_TestTCPUnmute) 26 + - test(_TestTCPWritev) 27 + - 28 + - // Tests below exclude windows and are listed alphabetically 29 + - ifdef not windows then 30 + - test(_TestTCPConnectionToClosedServerFailed) 31 + - test(_TestTCPThrottle) 32 + - end 33 + - 9 34 - // Tests below exclude osx and are listed alphabetically 10 35 - ifdef not osx then 11 36 - test(_TestBroadcast) 12 37 - end 13 - - 38 + 14 39 class \nodoc\ _TestPing is UDPNotify 15 40 let _h: TestHelper 16 - let _ip: NetAddress 41 + -- 42 + 2.47.0
+26
pkgs/by-name/po/ponyc/disable-process-tests.patch
··· 1 + From 77d703b11d298f6be88b04f7e8ca85de139e82be Mon Sep 17 00:00:00 2001 2 + From: Morgan Jones <me@numin.it> 3 + Date: Mon, 5 May 2025 20:34:02 -0700 4 + Subject: [PATCH] process: disable KillLongRunningChild test 5 + 6 + --- 7 + packages/process/_test.pony | 3 ++- 8 + 1 file changed, 2 insertions(+), 1 deletion(-) 9 + 10 + diff --git a/packages/process/_test.pony b/packages/process/_test.pony 11 + index fe9fdb04..756588f9 100644 12 + --- a/packages/process/_test.pony 13 + +++ b/packages/process/_test.pony 14 + @@ -18,7 +18,8 @@ actor \nodoc\ Main is TestList 15 + test(_TestChdir) 16 + test(_TestExpect) 17 + test(_TestFileExecCapabilityIsRequired) 18 + - test(_TestKillLongRunningChild) 19 + + // (@booxter/@numinit) Appears to be flaky. 20 + + // test(_TestKillLongRunningChild) 21 + test(_TestLongRunningChild) 22 + test(_TestNonExecutablePathResultsInExecveError) 23 + test(_TestPrintvOrdering) 24 + -- 25 + 2.47.0 26 +
+18 -6
pkgs/by-name/po/ponyc/package.nix
··· 19 19 which, 20 20 z3, 21 21 cctools, 22 + procps, 22 23 }: 23 24 24 25 stdenv.mkDerivation (rec { ··· 73 74 [ 74 75 # Sandbox disallows network access, so disabling problematic networking tests 75 76 ./disable-networking-tests.patch 77 + ./disable-process-tests.patch 76 78 ] 77 79 ++ lib.optionals stdenv.hostPlatform.isDarwin [ 78 80 (replaceVars ./fix-darwin-build.patch { ··· 102 104 --replace-fail "https://github.com/google/googletest/archive/refs/tags/v$googletestRev.tar.gz" "$NIX_BUILD_TOP/deps/googletest-$googletestRev.tar" 103 105 ''; 104 106 105 - preBuild = '' 106 - make libs build_flags=-j$NIX_BUILD_CORES 107 - make configure build_flags=-j$NIX_BUILD_CORES 108 - ''; 107 + preBuild = 108 + '' 109 + extraFlags=(build_flags=-j$NIX_BUILD_CORES) 110 + '' 111 + + lib.optionalString stdenv.hostPlatform.isAarch64 '' 112 + # See this relnote about building on Raspbian: 113 + # https://github.com/ponylang/ponyc/blob/0.46.0/.release-notes/0.45.2.md 114 + extraFlags+=(pic_flag=-fPIC) 115 + '' 116 + + '' 117 + make libs "''${extraFlags[@]}" 118 + make configure "''${extraFlags[@]}" 119 + ''; 109 120 110 121 makeFlags = [ 111 122 "PONYC_VERSION=${version}" ··· 117 128 "-Wno-error=implicit-fallthrough" 118 129 ]; 119 130 120 - # make: *** [Makefile:222: test-full-programs-release] Killed: 9 121 - doCheck = !stdenv.hostPlatform.isDarwin; 131 + doCheck = true; 132 + 133 + nativeCheckInputs = [ procps ]; 122 134 123 135 installPhase = 124 136 ''