Magnus pushed to branch ghc-9.12 at Glasgow Haskell Compiler / GHC

Commits:

4 changed files:

Changes:

  • rts/Printer.c
    ... ... @@ -1009,8 +1009,8 @@ findPtr(P_ p, int follow)
    1009 1009
     {
    
    1010 1010
       uint32_t g, n;
    
    1011 1011
       bdescr *bd;
    
    1012
    -  const int arr_size = 1024;
    
    1013
    -  StgPtr arr[arr_size];
    
    1012
    +#define ARR_SIZE 1024
    
    1013
    +  StgPtr arr[ARR_SIZE];
    
    1014 1014
       int i = 0;
    
    1015 1015
       searched = 0;
    
    1016 1016
     
    
    ... ... @@ -1020,24 +1020,24 @@ findPtr(P_ p, int follow)
    1020 1020
       // just before a block is used.
    
    1021 1021
       for (n = 0; n < getNumCapabilities(); n++) {
    
    1022 1022
           bd = nurseries[i].blocks;
    
    1023
    -      i = findPtrBlocks(p,bd,arr,arr_size,i);
    
    1024
    -      if (i >= arr_size) return;
    
    1023
    +      i = findPtrBlocks(p,bd,arr,ARR_SIZE,i);
    
    1024
    +      if (i >= ARR_SIZE) return;
    
    1025 1025
       }
    
    1026 1026
     #endif
    
    1027 1027
     
    
    1028 1028
       for (g = 0; g < RtsFlags.GcFlags.generations; g++) {
    
    1029 1029
           bd = generations[g].blocks;
    
    1030
    -      i = findPtrBlocks(p,bd,arr,arr_size,i);
    
    1030
    +      i = findPtrBlocks(p,bd,arr,ARR_SIZE,i);
    
    1031 1031
           bd = generations[g].large_objects;
    
    1032
    -      i = findPtrBlocks(p,bd,arr,arr_size,i);
    
    1033
    -      if (i >= arr_size) return;
    
    1032
    +      i = findPtrBlocks(p,bd,arr,ARR_SIZE,i);
    
    1033
    +      if (i >= ARR_SIZE) return;
    
    1034 1034
           for (n = 0; n < getNumCapabilities(); n++) {
    
    1035 1035
               i = findPtrBlocks(p, gc_threads[n]->gens[g].part_list,
    
    1036
    -                            arr, arr_size, i);
    
    1036
    +                            arr, ARR_SIZE, i);
    
    1037 1037
               i = findPtrBlocks(p, gc_threads[n]->gens[g].todo_bd,
    
    1038
    -                            arr, arr_size, i);
    
    1038
    +                            arr, ARR_SIZE, i);
    
    1039 1039
           }
    
    1040
    -      if (i >= arr_size) return;
    
    1040
    +      if (i >= ARR_SIZE) return;
    
    1041 1041
       }
    
    1042 1042
       if (follow && i == 1) {
    
    1043 1043
           debugBelch("-->\n");
    

  • rts/posix/OSMem.c
    ... ... @@ -585,7 +585,7 @@ void *osReserveHeapMemory(void *startAddressPtr, W_ *len)
    585 585
         }
    
    586 586
     #endif
    
    587 587
     
    
    588
    -    const int MAX_ATTEMPTS = 256;
    
    588
    +#define MAX_ATTEMPTS 256
    
    589 589
         void *bad_allocs[MAX_ATTEMPTS];
    
    590 590
         size_t bad_alloc_lens[MAX_ATTEMPTS];
    
    591 591
         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, \
    25 25
     from testutil import strip_quotes, lndir, link_or_copy_file, passed, \
    
    26 26
                          failBecause, testing_metrics, residency_testing_metrics, \
    
    27 27
                          stable_perf_counters, \
    
    28
    -                     PassFail, badResult, memoize, str_removeprefix
    
    28
    +                     PassFail, badResult, str_warn, str_removeprefix
    
    29 29
     from term_color import Color, colored
    
    30 30
     import testutil
    
    31 31
     from cpu_features import have_cpu_feature
    
    ... ... @@ -2992,6 +2992,12 @@ def normalise_errmsg(s: str) -> str:
    2992 2992
         # Old emcc warns when we export HEAP8 but new one requires it (see #26290)
    
    2993 2993
         s = s.replace('warning: invalid item in EXPORTED_RUNTIME_METHODS: HEAP8\nwarning: invalid item in EXPORTED_RUNTIME_METHODS: HEAPU8\nemcc: warning: warnings in JS library compilation [-Wjs-compiler]\n','')
    
    2994 2994
     
    
    2995
    +    # on newer versions of MacOS X, the shipped ranlib warns about object files with no symbols,
    
    2996
    +    # however, these are completely benign stubs.
    
    2997
    +    # See https://gitlab.haskell.org/ghc/ghc/-/issues/27116
    
    2998
    +    if opsys('darwin'):
    
    2999
    +        s = modify_lines(s, lambda l: re.sub(r'.*ranlib:.*has no symbols', '', l))
    
    3000
    +
    
    2995 3001
         return s
    
    2996 3002
     
    
    2997 3003
     # normalise a .prof file, so that we can reasonably compare it against
    
    ... ... @@ -3407,9 +3413,20 @@ if config.msys:
    3407 3413
                     exception = e
    
    3408 3414
                 retries -= 1
    
    3409 3415
     
    
    3416
    +        # Don't fail as framework error if cleanup fails here, just
    
    3417
    +        # print the warning and proceed. I've seen new failure mode
    
    3418
    +        # here on Windows Server 2025 and recent msys2 installation:
    
    3419
    +        # fifo.lnk is created as read-only and the on_error trick
    
    3420
    +        # above somehow doesn't work.
    
    3421
    +        #
    
    3422
    +        # For a local testsuite run, it's in %TEMP% that will be
    
    3423
    +        # periodically cleaned up anyway; for CI, there's post-job
    
    3424
    +        # cleanup and runner level cleanup. It's better to report
    
    3425
    +        # actual job pass/failure than to waste CPU cycles to spurious
    
    3426
    +        # Windows misery.
    
    3410 3427
             if retries == 0 and testdir.exists():
    
    3411
    -            raise Exception("Unable to remove folder '%s': %s\nUnable to start current test."
    
    3412
    -                            % (testdir, exception))
    
    3428
    +            print(str_warn("Unable to remove folder '%s': %s\nUnable to start current test."
    
    3429
    +                            % (testdir, exception)))
    
    3413 3430
     else:
    
    3414 3431
         def cleanup() -> None:
    
    3415 3432
             testdir = getTestOpts().testdir_raw
    

  • testsuite/tests/driver/all.T
    ... ... @@ -120,9 +120,7 @@ if config.os == 'darwin':
    120 120
     else:
    
    121 121
       only_darwin = skip
    
    122 122
     
    
    123
    -test('static001', [extra_files(['Static001.hs']),
    
    124
    -                   only_darwin,
    
    125
    -                   when(arch('x86_64'), expect_broken(8127))],
    
    123
    +test('static001', [extra_files(['Static001.hs']), only_darwin],
    
    126 124
          makefile_test, ['static001'])
    
    127 125
     
    
    128 126
     test('dynHelloWorld',