[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 5 commits: hadrian: build in-tree gmp with -fvisibility=hidden
Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 77deaa7a by Cheng Shao at 2025-09-14T21:29:45-04:00 hadrian: build in-tree gmp with -fvisibility=hidden When hadrian builds in-tree gmp, it should build the shared objects with -fvisibility=hidden. The gmp symbols are only used by bignum logic in ghc-internal and shouldn't be exported by the ghc-internal shared library. We should always strive to keep shared library symbol table lean, which benefits platforms with slow dynamic linker or even hard limits about how many symbols can be exported (e.g. macos dyld, win32 dll and wasm dyld). - - - - - 42a18960 by Cheng Shao at 2025-09-14T21:30:26-04:00 Revert "wasm: add brotli compression for ghci browser mode" This reverts commit 731217ce68a1093b5f9e26a07d5bd2cdade2b352. Benchmarks show non-negligible overhead when browser runs on the same host, which is the majority of actual use cases. - - - - - e6755b9f by Cheng Shao at 2025-09-14T21:30:26-04:00 wasm: remove etag logic in ghci browser mode web server This commit removes the etag logic in dyld script's ghci browser mode web server. It was meant to support caching logic of wasm shared libraries, but even if the port is manually specified to make caching even relevant, for localhost the extra overhead around etag logic is simply not worth it according to benchmarks. - - - - - 1d3e536d by sheaf at 2025-09-16T07:48:11-04:00 Add 'Outputable Natural' instance This commit adds an Outputable instance for the Natural natural-number type, as well as a "natural :: Natural -> SDoc" function that mirrors the existing "integer" function. - - - - - 19301242 by Cheng Shao at 2025-09-16T07:48:12-04:00 autoconf: emit warning instead of error for FIND_PYTHON logic This patch makes FIND_PYTHON logic emit warning instead of error, so when the user doesn't expect to run the testsuite driver (especially when installing a bindist), python would not be mandatory. Fixes #26347. - - - - - 4 changed files: - compiler/GHC/Utils/Outputable.hs - hadrian/src/Rules/Gmp.hs - m4/find_python.m4 - utils/jsffi/dyld.mjs Changes: ===================================== compiler/GHC/Utils/Outputable.hs ===================================== @@ -39,7 +39,7 @@ module GHC.Utils.Outputable ( spaceIfSingleQuote, isEmpty, nest, ptext, - int, intWithCommas, integer, word64, word, float, double, rational, doublePrec, + int, intWithCommas, integer, natural, word64, word, float, double, rational, doublePrec, parens, cparen, brackets, braces, quotes, quote, quoteIfPunsEnabled, doubleQuotes, angleBrackets, semi, comma, colon, dcolon, space, equals, dot, vbar, @@ -150,6 +150,7 @@ import System.IO ( Handle ) import System.FilePath import Text.Printf import Numeric (showFFloat) +import Numeric.Natural (Natural) import Data.Graph (SCC(..)) import Data.List (intersperse) import Data.List.NonEmpty (NonEmpty (..)) @@ -684,6 +685,7 @@ docToSDoc d = SDoc (\_ -> d) ptext :: PtrString -> SDoc int :: IsLine doc => Int -> doc +natural :: IsLine doc => Natural -> doc integer :: IsLine doc => Integer -> doc word :: Integer -> SDoc word64 :: IsLine doc => Word64 -> doc @@ -695,6 +697,8 @@ rational :: Rational -> SDoc ptext s = docToSDoc $ Pretty.ptext s {-# INLINE CONLIKE int #-} int n = text $ show n +{-# INLINE CONLIKE natural #-} +natural n = text $ show n {-# INLINE CONLIKE integer #-} integer n = text $ show n {-# INLINE CONLIKE float #-} @@ -947,6 +951,9 @@ instance Outputable Int64 where instance Outputable Int where ppr n = int n +instance Outputable Natural where + ppr n = natural n + instance Outputable Integer where ppr n = integer n ===================================== hadrian/src/Rules/Gmp.hs ===================================== @@ -12,7 +12,6 @@ import Utilities import Hadrian.BuildPath import Hadrian.Expression import Settings.Builders.Common (cArgs, getStagedCCFlags) -import GHC.Platform.ArchOS -- | Build in-tree GMP library objects (if GmpInTree flag is set) and return -- their paths. @@ -128,7 +127,10 @@ gmpRules = do mconcat [ cArgs , getStagedCCFlags - , anyTargetArch [ArchWasm32] ? arg "-fvisibility=default" + -- gmp symbols are only used by bignum logic in + -- ghc-internal and shouldn't be exported by the + -- ghc-internal shared library. + , arg "-fvisibility=hidden" ] env <- sequence [ builderEnvironment "CC" $ Cc CompileC (stage ctx) ===================================== m4/find_python.m4 ===================================== @@ -17,7 +17,7 @@ AC_DEFUN([FIND_PYTHON],[ dnl If still not found, hard error: we require Python >= 3.7 AS_IF([test -z "$PYTHON"], [ - AC_MSG_ERROR([Python 3.7 or later is required but no python interpreter was found. Please install Python >= 3.7 and re-run configure.]) + AC_MSG_WARN([Python 3.7 or later is required but no python interpreter was found. This is needed by the testsuite driver.]) ]) dnl Query the version string (X.Y.Z) of the selected interpreter @@ -31,10 +31,10 @@ AC_DEFUN([FIND_PYTHON],[ dnl Enforce minimum version 3.7.0 AS_IF([test -z "$PythonVersion"], [ - AC_MSG_ERROR([Failed to determine Python version for $PYTHON]) + AC_MSG_WARN([Failed to determine Python version for $PYTHON]) ]) FP_COMPARE_VERSIONS([$PythonVersion], [-lt], [3.7.0], [ - AC_MSG_ERROR([Python 3.7 or later is required, but $PYTHON reports $PythonVersion]) + AC_MSG_WARN([Python 3.7 or later is required, but $PYTHON reports $PythonVersion]) ]) dnl Canonicalise path for Windows ===================================== utils/jsffi/dyld.mjs ===================================== @@ -291,7 +291,7 @@ const isNode = Boolean(globalThis?.process?.versions?.node); // factor out browser-only/node-only logic into different modules. For // now, just make these global let bindings optionally initialized if // isNode and be careful to not use them in browser-only logic. -let fs, http, path, require, stream, util, wasi, ws, zlib; +let fs, http, path, require, stream, wasi, ws; if (isNode) { require = (await import("node:module")).createRequire(import.meta.url); @@ -300,9 +300,7 @@ if (isNode) { http = require("http"); path = require("path"); stream = require("stream"); - util = require("util"); wasi = require("wasi"); - zlib = require("zlib"); // Optional npm dependencies loaded via NODE_PATH try { @@ -561,30 +559,8 @@ args.rpc.opened.then(() => main(args)); }[path.extname(p)] || "application/octet-stream" ); - const buf = Buffer.from(await fs.promises.readFile(p)); - const etag = `sha512-${Buffer.from( - await crypto.subtle.digest("SHA-512", buf) - ).toString("base64")}`; - - res.setHeader("ETag", etag); - - if (req.headers["if-none-match"] === etag) { - res.writeHead(304); - res.end(); - return; - } - - res.setHeader("Content-Encoding", "br"); - res.writeHead(200); - res.end( - await util.promisify(zlib.brotliCompress)(buf, { - params: { - [zlib.constants.BROTLI_PARAM_QUALITY]: - zlib.constants.BROTLI_MIN_QUALITY, - }, - }) - ); + fs.createReadStream(p).pipe(res); return; } View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/5b7674246e31337b19cbb409799c195... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/5b7674246e31337b19cbb409799c195... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Marge Bot (@marge-bot)