Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC

Commits:

3 changed files:

Changes:

  • hadrian/src/Rules/Gmp.hs
    ... ... @@ -12,7 +12,6 @@ import Utilities
    12 12
     import Hadrian.BuildPath
    
    13 13
     import Hadrian.Expression
    
    14 14
     import Settings.Builders.Common (cArgs, getStagedCCFlags)
    
    15
    -import GHC.Platform.ArchOS
    
    16 15
     
    
    17 16
     -- | Build in-tree GMP library objects (if GmpInTree flag is set) and return
    
    18 17
     -- their paths.
    
    ... ... @@ -128,7 +127,10 @@ gmpRules = do
    128 127
                     mconcat
    
    129 128
                         [ cArgs
    
    130 129
                         , getStagedCCFlags
    
    131
    -                    , anyTargetArch [ArchWasm32] ? arg "-fvisibility=default"
    
    130
    +                    -- gmp symbols are only used by bignum logic in
    
    131
    +                    -- ghc-internal and shouldn't be exported by the
    
    132
    +                    -- ghc-internal shared library.
    
    133
    +                    , arg "-fvisibility=hidden"
    
    132 134
                         ]
    
    133 135
                 env <- sequence
    
    134 136
                          [ builderEnvironment "CC" $ Cc CompileC (stage ctx)
    

  • libraries/ghc-heap/GHC/Exts/Heap.hs
    ... ... @@ -67,10 +67,26 @@ import GHC.Exts.Heap.ClosureTypes
    67 67
     import GHC.Exts.Heap.Constants
    
    68 68
     import GHC.Exts.Heap.ProfInfo.Types
    
    69 69
     #if defined(PROFILING)
    
    70
    +import GHC.Exts.Heap.InfoTable () -- See Note [No way-dependent imports]
    
    70 71
     import GHC.Exts.Heap.InfoTableProf
    
    71 72
     #else
    
    72 73
     import GHC.Exts.Heap.InfoTable
    
    74
    +import GHC.Exts.Heap.InfoTableProf () -- See Note [No way-dependent imports]
    
    75
    +
    
    76
    +{-
    
    77
    +Note [No way-dependent imports]
    
    78
    +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    79
    +`ghc -M` currently assumes that the imports for a module are the same
    
    80
    +in every way.  This is arguably a bug, but breaking this assumption by
    
    81
    +importing different things in different ways can cause trouble.  For
    
    82
    +example, this module in the profiling way imports and uses
    
    83
    +GHC.Exts.Heap.InfoTableProf.  When it was not also imported in the
    
    84
    +vanilla way, there were intermittent build failures due to this module
    
    85
    +being compiled in the profiling way before GHC.Exts.Heap.InfoTableProf
    
    86
    +in the profiling way. (#15197)
    
    87
    +-}
    
    73 88
     #endif
    
    89
    +
    
    74 90
     import GHC.Exts.Heap.Utils
    
    75 91
     import qualified GHC.Exts.Heap.FFIClosures as FFIClosures
    
    76 92
     import qualified GHC.Exts.Heap.ProfInfo.PeekProfInfo as PPI
    

  • utils/jsffi/dyld.mjs
    ... ... @@ -291,7 +291,7 @@ const isNode = Boolean(globalThis?.process?.versions?.node);
    291 291
     // factor out browser-only/node-only logic into different modules. For
    
    292 292
     // now, just make these global let bindings optionally initialized if
    
    293 293
     // isNode and be careful to not use them in browser-only logic.
    
    294
    -let fs, http, path, require, stream, util, wasi, ws, zlib;
    
    294
    +let fs, http, path, require, stream, wasi, ws;
    
    295 295
     
    
    296 296
     if (isNode) {
    
    297 297
       require = (await import("node:module")).createRequire(import.meta.url);
    
    ... ... @@ -300,9 +300,7 @@ if (isNode) {
    300 300
       http = require("http");
    
    301 301
       path = require("path");
    
    302 302
       stream = require("stream");
    
    303
    -  util = require("util");
    
    304 303
       wasi = require("wasi");
    
    305
    -  zlib = require("zlib");
    
    306 304
     
    
    307 305
       // Optional npm dependencies loaded via NODE_PATH
    
    308 306
       try {
    
    ... ... @@ -561,30 +559,8 @@ args.rpc.opened.then(() => main(args));
    561 559
               }[path.extname(p)] || "application/octet-stream"
    
    562 560
             );
    
    563 561
     
    
    564
    -        const buf = Buffer.from(await fs.promises.readFile(p));
    
    565
    -        const etag = `sha512-${Buffer.from(
    
    566
    -          await crypto.subtle.digest("SHA-512", buf)
    
    567
    -        ).toString("base64")}`;
    
    568
    -
    
    569
    -        res.setHeader("ETag", etag);
    
    570
    -
    
    571
    -        if (req.headers["if-none-match"] === etag) {
    
    572
    -          res.writeHead(304);
    
    573
    -          res.end();
    
    574
    -          return;
    
    575
    -        }
    
    576
    -
    
    577
    -        res.setHeader("Content-Encoding", "br");
    
    578
    -
    
    579 562
             res.writeHead(200);
    
    580
    -        res.end(
    
    581
    -          await util.promisify(zlib.brotliCompress)(buf, {
    
    582
    -            params: {
    
    583
    -              [zlib.constants.BROTLI_PARAM_QUALITY]:
    
    584
    -                zlib.constants.BROTLI_MIN_QUALITY,
    
    585
    -            },
    
    586
    -          })
    
    587
    -        );
    
    563
    +        fs.createReadStream(p).pipe(res);
    
    588 564
             return;
    
    589 565
           }
    
    590 566