[Git][ghc/ghc][ghc-9.14] 3 commits: testsuite: fix testdir cleanup logic on Windows
Magnus pushed to branch ghc-9.14 at Glasgow Haskell Compiler / GHC Commits: b72cc992 by Cheng Shao at 2026-04-15T15:23:21+02:00 testsuite: fix testdir cleanup logic on Windows testdir cleanup is unreliable on Windows (#13162) and despite existing hacks in the driver, new failure mode has occurred. This patch makes it print the warning and carry on when failed to clean up a testdir, instead of reporting a spurious framework failure. See added comment for detailed explanation. (cherry picked from commit ed2c65707aacdf442edb8098a7e5cea5fee5d2b0) - - - - - b422b4c3 by Ben Gamari at 2026-04-16T10:01:33+02:00 rts: Eliminate uses of implicit constant arrays Folding of `const`-sized variable-length arrays to a constant-length array is a gnu extension which clang complains about. Closes #26502. (cherry picked from commit 0c00c9c3b4e9b8515d4839f2c1d7d771781dc6f4) - - - - - 8fb179ea by mangoiv at 2026-04-16T16:12:50+02:00 testsuite: filter stderr for static001 on darwin This reactivates the test on x86_64 darwin as this should have been done long ago and ignores warnings emitted by ranlib on newer version of the darwin toolchain since they are benign. (no symbols for stub libraries) Fixes #27116 (cherry picked from commit b822c30aa6c0bf008c06c5bd4ee86313c40f652d) - - - - - 4 changed files: - rts/Printer.c - rts/posix/OSMem.c - testsuite/driver/testlib.py - testsuite/tests/driver/all.T Changes: ===================================== rts/Printer.c ===================================== @@ -1033,8 +1033,8 @@ findPtr(P_ p, int follow) { uint32_t g, n; bdescr *bd; - const int arr_size = 1024; - StgPtr arr[arr_size]; +#define ARR_SIZE 1024 + StgPtr arr[ARR_SIZE]; int i = 0; searched = 0; @@ -1044,24 +1044,24 @@ findPtr(P_ p, int follow) // just before a block is used. for (n = 0; n < getNumCapabilities(); n++) { bd = nurseries[i].blocks; - i = findPtrBlocks(p,bd,arr,arr_size,i); - if (i >= arr_size) return; + i = findPtrBlocks(p,bd,arr,ARR_SIZE,i); + if (i >= ARR_SIZE) return; } #endif for (g = 0; g < RtsFlags.GcFlags.generations; g++) { bd = generations[g].blocks; - i = findPtrBlocks(p,bd,arr,arr_size,i); + i = findPtrBlocks(p,bd,arr,ARR_SIZE,i); bd = generations[g].large_objects; - i = findPtrBlocks(p,bd,arr,arr_size,i); - if (i >= arr_size) return; + i = findPtrBlocks(p,bd,arr,ARR_SIZE,i); + if (i >= ARR_SIZE) return; for (n = 0; n < getNumCapabilities(); n++) { i = findPtrBlocks(p, gc_threads[n]->gens[g].part_list, - arr, arr_size, i); + arr, ARR_SIZE, i); i = findPtrBlocks(p, gc_threads[n]->gens[g].todo_bd, - arr, arr_size, i); + arr, ARR_SIZE, i); } - if (i >= arr_size) return; + if (i >= ARR_SIZE) return; } if (follow && i == 1) { debugBelch("-->\n"); ===================================== rts/posix/OSMem.c ===================================== @@ -585,7 +585,7 @@ void *osReserveHeapMemory(void *startAddressPtr, W_ *len) } #endif - const int MAX_ATTEMPTS = 256; +#define MAX_ATTEMPTS 256 void *bad_allocs[MAX_ATTEMPTS]; size_t bad_alloc_lens[MAX_ATTEMPTS]; memset(bad_allocs, 0, sizeof(void*) * MAX_ATTEMPTS); ===================================== testsuite/driver/testlib.py ===================================== @@ -25,7 +25,7 @@ from testglobals import config, ghc_env, default_testopts, brokens, t, \ from testutil import strip_quotes, lndir, link_or_copy_file, passed, \ failBecause, testing_metrics, residency_testing_metrics, \ stable_perf_counters, \ - PassFail, badResult, memoize + PassFail, badResult, str_warn from term_color import Color, colored import testutil from cpu_features import have_cpu_feature @@ -3005,6 +3005,12 @@ def normalise_errmsg(s: str) -> str: # Emscripten displays cache info and old emcc doesn't support EMCC_LOGGING=0 s = re.sub('cache:INFO: .*\n', '', s) + # on newer versions of MacOS X, the shipped ranlib warns about object files with no symbols, + # however, these are completely benign stubs. + # See https://gitlab.haskell.org/ghc/ghc/-/issues/27116 + if opsys('darwin'): + s = modify_lines(s, lambda l: re.sub(r'.*ranlib:.*has no symbols', '', l)) + return s # normalise a .prof file, so that we can reasonably compare it against @@ -3420,9 +3426,20 @@ if config.msys: exception = e retries -= 1 + # Don't fail as framework error if cleanup fails here, just + # print the warning and proceed. I've seen new failure mode + # here on Windows Server 2025 and recent msys2 installation: + # fifo.lnk is created as read-only and the on_error trick + # above somehow doesn't work. + # + # For a local testsuite run, it's in %TEMP% that will be + # periodically cleaned up anyway; for CI, there's post-job + # cleanup and runner level cleanup. It's better to report + # actual job pass/failure than to waste CPU cycles to spurious + # Windows misery. if retries == 0 and testdir.exists(): - raise Exception("Unable to remove folder '%s': %s\nUnable to start current test." - % (testdir, exception)) + print(str_warn("Unable to remove folder '%s': %s\nUnable to start current test." + % (testdir, exception))) else: def cleanup() -> None: testdir = getTestOpts().testdir_raw ===================================== testsuite/tests/driver/all.T ===================================== @@ -120,9 +120,7 @@ if config.os == 'darwin': else: only_darwin = skip -test('static001', [extra_files(['Static001.hs']), - only_darwin, - when(arch('x86_64'), expect_broken(8127))], +test('static001', [extra_files(['Static001.hs']), only_darwin], makefile_test, ['static001']) test('dynHelloWorld', View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/902339d332fb4ce2b3c87dcac1ee649... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/902339d332fb4ce2b3c87dcac1ee649... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Magnus (@MangoIV)