Haskell.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

ghc-commits

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
ghc-commits@haskell.org

June 2026

  • 1 participants
  • 802 discussions
[Git][ghc/ghc][wip/davide/hadrian_avoid_response_files] Hadrian: disable response files for GHC/Haddock builders on non-Windows
by David Eichmann (@DavidEichmann) 01 Jun '26

01 Jun '26
David Eichmann pushed to branch wip/davide/hadrian_avoid_response_files at Glasgow Haskell Compiler / GHC Commits: ac4102d3 by David Eichmann at 2026-06-01T10:43:44+01:00 Hadrian: disable response files for GHC/Haddock builders on non-Windows This makes debugging build errors easier on non-windows hosts. See issue #27230 - - - - - 2 changed files: - hadrian/src/Builder.hs - hadrian/src/Hadrian/Utilities.hs Changes: ===================================== hadrian/src/Builder.hs ===================================== @@ -39,7 +39,6 @@ import Packages import GHC.IO.Encoding (getFileSystemEncoding) import qualified Data.ByteString as BS import qualified GHC.Foreign as GHC -import GHC.ResponseFile import GHC.Toolchain (Target(..)) import qualified GHC.Toolchain as Toolchain @@ -346,7 +345,15 @@ instance H.Builder Builder where Haddock BuildPackage -> runHaddock path buildArgs buildInputs - Ghc _ _ -> runGhcWithResponse path buildArgs buildInputs buildOptions + Ghc _ _ -> + -- Use a response file for ghc invocations to avoid issues with command line + -- size limit on Windows (#26637). + -- NB: we can't put the buildArgs in a response file, because some flags require + -- empty arguments (such as the -dep-suffix flag), but that isn't supported + -- yet due to #26560. + withResponseFileOnWindows + (\buildInputs' -> cmd [path] buildArgs buildInputs' buildOptions) + buildInputs HsCpp -> captureStdout @@ -380,29 +387,15 @@ instance H.Builder Builder where _ -> cmd' [path] buildArgs buildOptions --- | Invoke @haddock@ given a path to it and a list of arguments. The arguments --- are passed in a response file. +-- | Invoke @haddock@ given a path to it and a list of arguments. On windows, +-- the input file arguments are passed as a response file. runHaddock :: FilePath -- ^ path to @haddock@ -> [String] -> [FilePath] -- ^ input file paths -> Action () -runHaddock haddockPath flagArgs fileInputs = withResponseFile $ \tmp -> do - writeFile' tmp $ escapeArgs fileInputs - cmd [haddockPath] flagArgs ('@' : tmp) - --- | Use a response file for ghc invocations to avoid issues with command line --- size limit on Windows (#26637). -runGhcWithResponse :: FilePath -- ^ Path to ghc - -> [String] -- ^ Arguments passed on the command line - -> [FilePath] -- ^ Input file paths (passed via response file) - -> [CmdOption] - -> Action () -runGhcWithResponse ghcPath buildArgs buildInputs buildOptions = withResponseFile $ \tmp -> do - -- We can't put the buildArgs in a response file, because some flags require - -- empty arguments (such as the -dep-suffix flag), but that isn't supported - -- yet due to #26560. - writeFile' tmp (escapeArgs buildInputs) - cmd [ghcPath] buildArgs ('@' : tmp) buildOptions +runHaddock haddockPath flagArgs fileInputs = withResponseFileOnWindows + (cmd [haddockPath] flagArgs) + fileInputs -- TODO: Some builders are required only on certain platforms. For example, -- 'Objdump' is only required on OpenBSD and AIX. Add support for platform ===================================== hadrian/src/Hadrian/Utilities.hs ===================================== @@ -14,7 +14,7 @@ module Hadrian.Utilities ( -- * Paths BuildRoot (..), buildRoot, buildRootRules, isGeneratedSource, - KeepResponseFiles (..), keepResponseFiles, withResponseFile, + KeepResponseFiles (..), keepResponseFiles, withResponseFile, withResponseFileOnWindows, -- * File system operations copyFile, copyFileUntracked, createFileLink, fixFile, @@ -48,8 +48,11 @@ import Data.Typeable (TypeRep, typeOf) import Development.Shake hiding (Normal) import Development.Shake.Classes import Development.Shake.FilePath +import GHC.ResponseFile (escapeArgs) import System.Environment (lookupEnv) +import System.Info.Extra (isWindows) import System.IO (hClose, openTempFile) +import System.IO.Error (isPermissionError) import qualified Data.ByteString as BS import qualified Control.Exception.Base as IO @@ -57,8 +60,7 @@ import qualified Data.HashMap.Strict as Map import qualified System.Directory.Extra as IO import qualified System.Info.Extra as IO import qualified System.IO as IO -import System.IO.Error (isPermissionError) -import qualified System.FilePath.Posix as Posix +import qualified System.FilePath.Posix as Posix -- | Extract a value from a singleton list, or terminate with an error message -- if the list does not contain exactly one value. @@ -328,6 +330,21 @@ keepResponseFiles = do KeepResponseFiles keep <- userSetting (KeepResponseFiles False) return keep +-- | Run an action either with command arguments direcly or by, on Windows, +-- placing those arguments into a response file escaped with @GHC.ResponseFile.escapeArgs@. +-- +-- With @--keep-response-files@, the file is left on disk (if used) +withResponseFileOnWindows :: + ([String] -> Action a) -- ^ Action to perform given arguments (of the form @["\@reponseFilePath"]@ on Windows) + -> [String] -- ^ Command arguments + -> Action a +withResponseFileOnWindows action commandArgs = do + if isWindows + then withResponseFile $ \tmp -> do + writeFile' tmp (escapeArgs commandArgs) + action ['@' : tmp] + else action commandArgs + -- | Run an action with a response file path. -- -- With @--keep-response-files@, the file is left on disk. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ac4102d32aa5d8d8cc5a8bd74c76c86… -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ac4102d32aa5d8d8cc5a8bd74c76c86… You're receiving this email because of your account on gitlab.haskell.org.
1 0
0 0
[Git][ghc/ghc][wip/sjakobi/T25450-print-cpu] 10 commits: Hadrian: create a ghc-internal .def file per ghc-internal dll
by Simon Jakobi (@sjakobi2) 01 Jun '26

01 Jun '26
Simon Jakobi pushed to branch wip/sjakobi/T25450-print-cpu at Glasgow Haskell Compiler / GHC Commits: d603477f by David Eichmann at 2026-05-29T13:17:12-04:00 Hadrian: create a ghc-internal .def file per ghc-internal dll The .def file generated from rts/win32/libHSghc-internal.def.in contains the name of the ghc-internal dll. The correct dll name differs based on if the dll is inplace/final and if using the Dynamic way. Previously, this was not accounted for and inconsistent dlls names where used. That led to failure when loading dlls at runtime in experiments with windows dynamic linking. - - - - - 1fc21753 by Sylvain Henry at 2026-05-29T13:18:14-04:00 ghc-bignum: copy backend interface haddocks to Native backend (#27305) The haddock comments documenting the BigNat backend interface (function contracts, expected MutableWordArray# sizes, return-value semantics, etc.) were attached to the FFI backend module. Copy them to the Native backend so they remain in tree once the FFI backend is removed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply(a)anthropic.com> - - - - - 717059df by Sylvain Henry at 2026-05-29T13:18:14-04:00 ghc-bignum: remove FFI backend (#27305) The FFI backend of ghc-bignum (now part of ghc-internal) had no known users and is easy to recreate by relinking ghc-internal with a custom backend. Remove the backend module, the bignum-ffi cabal flag, and the ffi option from Hadrian's --bignum selector. The backend interface documentation now lives in the Native backend module. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply(a)anthropic.com> - - - - - 4bb3b1d8 by Sylvain Henry at 2026-05-29T13:18:14-04:00 ghc-bignum: remove Check backend (#27305) The Check backend of ghc-bignum (now part of ghc-internal) compared the selected backend's output against the Native backend for validation. It had no known users. Remove the backend module, the bignum-check cabal flag, the bignumCheck Hadrian flavour field, and the check- prefix in Hadrian's --bignum selector. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply(a)anthropic.com> - - - - - 6b3044a0 by David Eichmann at 2026-05-30T11:58:48-04:00 Add code comments to allocator code - - - - - f4e04210 by Matthew Pickering at 2026-05-30T11:59:34-04:00 hadrian: Refactor system-cxx-std-lib rules I noticed a few things wrong with the hadrian rules for `system-cxx-std-lib` rules. * For `text` there is an ad-hoc check to depend on `system-cxx-std-lib` outside of `configurePackage`. * The `system-cxx-std-lib` dependency is not read from cabal files. * Recache is not called on the packge database after the `.conf` file is generated, a more natural place for this rule is `registerRules`. Treating this uniformly like other packages is complicated by it not having any source code or a cabal file. However we can do a bit better by reporting the dependency firstly in `PackageData` and then needing the `.conf` file in the same place as every other package in `configurePackage`. This commit increases the `shakeVersion`, to provide backwards compatibility to previous builds with different PackageData. Fixes #25303 Co-authored-by: Sven Tennie <sven.tennie(a)gmail.com> - - - - - 32a90dac by Simon Jakobi at 2026-06-01T08:49:38+02:00 WIP: -print-enabled-cpu-features - - - - - 0de4c827 by Simon Jakobi at 2026-06-01T09:18:17+02:00 ghc/Main: Reject leftover flags in --print-enabled-cpu-features This mode prints before parseTargetFiles/checkOptions run, so a mistyped dynamic flag such as -mavx22 was silently left in fileish_args and the JSON output omitted the requested feature without complaint. Reject any leftover flag-like arguments via unknownFlagsErr first, matching the normal compilation path. - - - - - b1a6565d by Simon Jakobi at 2026-06-01T09:28:58+02:00 testsuite: Test --print-enabled-cpu-features rejects unknown flags Exercises the unknownFlagsErr path: ghc -mavx22 --print-enabled-cpu-features must exit 1 with an 'unrecognised flag' error rather than silently printing JSON. A normaliser keeps only the stable error line, since the program-name prefix, suggestion list, and usage trailer vary across configurations. - - - - - 4952b325 by Simon Jakobi at 2026-06-01T09:36:03+02:00 Report FMA in --print-enabled-cpu-features on all non-x86 targets FMA codegen is gated by isFmaEnabled (via stgToCmmAllowFMAInstr) on every architecture, so -mfma is meaningful on PowerPC, RISC-V and LoongArch, not just AArch64. The previous code only reported FMA for AArch64 and dropped it in the generic fallback and the LoongArch branch. Report it uniformly from the cross-platform fma flag for all non-x86 targets. Also reword the docs/changelog: dropping 'minimal'/'non-default' since AArch64 enables FMA by default yet still emits -mfma, so the empty flag set would equally reproduce the effective features there. - - - - - 43 changed files: - + changelog.d/hadrian-system-cxx-std-lib-25303 - + changelog.d/print-enabled-cpu-features - + changelog.d/remove-bignum-check-backend - + changelog.d/remove-bignum-ffi-backend - compiler/GHC/Driver/DynFlags.hs - compiler/GHC/Driver/Session.hs - docs/users_guide/using.rst - ghc/GHC/Driver/Session/Lint.hs - ghc/GHC/Driver/Session/Mode.hs - ghc/Main.hs - hadrian/README.md - hadrian/doc/user-settings.md - hadrian/src/CommandLine.hs - hadrian/src/Flavour/Type.hs - hadrian/src/Hadrian/Haskell/Cabal/Parse.hs - hadrian/src/Hadrian/Haskell/Cabal/Type.hs - hadrian/src/Main.hs - hadrian/src/Rules/Generate.hs - hadrian/src/Rules/Library.hs - hadrian/src/Rules/Register.hs - hadrian/src/Rules/Rts.hs - hadrian/src/Settings.hs - hadrian/src/Settings/Builders/RunTest.hs - hadrian/src/Settings/Default.hs - hadrian/src/Settings/Packages.hs - libraries/ghc-bignum/ghc-bignum.cabal - libraries/ghc-internal/bignum-backend.rst - libraries/ghc-internal/ghc-internal.cabal.in - libraries/ghc-internal/src/GHC/Internal/Bignum/Backend.hs - − libraries/ghc-internal/src/GHC/Internal/Bignum/Backend/Check.hs - − libraries/ghc-internal/src/GHC/Internal/Bignum/Backend/FFI.hs - libraries/ghc-internal/src/GHC/Internal/Bignum/Backend/Native.hs - − libraries/ghc-internal/src/GHC/Internal/Bignum/Backend/Selected.hs - rts/sm/BlockAlloc.c - rts/sm/MBlock.c - rts/win32/libHSghc-internal.def.in - testsuite/tests/driver/all.T - + testsuite/tests/driver/print_enabled_cpu_features.stdout - + testsuite/tests/driver/print_enabled_cpu_features_avx2.stdout - + testsuite/tests/driver/print_enabled_cpu_features_avx512.stdout - + testsuite/tests/driver/print_enabled_cpu_features_bmi2.stdout - + testsuite/tests/driver/print_enabled_cpu_features_fma.stdout - + testsuite/tests/driver/print_enabled_cpu_features_unknown_flag.stderr The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f33fa016e9e9c71c3de774da3d9aca… -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f33fa016e9e9c71c3de774da3d9aca… You're receiving this email because of your account on gitlab.haskell.org.
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 78
  • 79
  • 80
  • 81
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.