[Git][ghc/ghc][wip/remove-legacy-define-in-foreign-stub] 20 commits: task: Substitute some datatypes for newtypes
by Cheng Shao (@TerrorJack) 10 Dec '25
by Cheng Shao (@TerrorJack) 10 Dec '25
10 Dec '25
Cheng Shao pushed to branch wip/remove-legacy-define-in-foreign-stub at Glasgow Haskell Compiler / GHC
Commits:
beae879b by Rodrigo Mesquita at 2025-12-03T15:42:37+01:00
task: Substitute some datatypes for newtypes
* Substitutes some data type declarations for newtype declarations
* Adds comment to `LlvmConfigCache`, which must decidedly not be a
newtype.
Fixes #23555
- - - - -
3bd7dd44 by mangoiv at 2025-12-04T04:36:45-05:00
Renamer: reinstate the template haskell level check in notFound
Out-of-scope names might be caused by a staging error, as is explained by
Note [Out of scope might be a staging error] in GHC.Tc.Utils.Env.hs.
This logic was assumed to be dead code after 217caad1 and has thus been
removed. This commit reintroduces it and thus fixes issue #26099.
- - - - -
0318010b by Zubin Duggal at 2025-12-04T04:37:27-05:00
testlib: Optionally include the way name in the expected output file
This allows us to have different outputs for different ways.
- - - - -
6d945fdd by Zubin Duggal at 2025-12-04T04:37:27-05:00
testsuite: Accept output of tests failing in ext-interp way due to differing compilation requirements
Fixes #26552
- - - - -
0ffc5243 by Cheng Shao at 2025-12-04T04:38:09-05:00
devx: minor fixes for compile_flags.txt
This patch includes minor fixes for compile_flags.txt to improve
developer experience when using clangd as language server to hack on
RTS C sources:
- Ensure `-fPIC` is passed and `__PIC__` is defined, to be coherent
with `-DDYNAMIC` and ensure the `__PIC__` guarded code paths are
indexed
- Add the missing `-DRtsWay` definition, otherwise a few source files
like `RtsUtils.c` and `Trace.c` would produce clangd errors
- - - - -
e36a5fcb by Matthew Pickering at 2025-12-05T16:25:57-05:00
Add support for building bytecode libraries
A bytecode library is a collection of bytecode files (.gbc) and a
library which combines together additional object files.
A bytecode library is created by invoking GHC with the `-bytecodelib`
flag.
A library can be created from in-memory `ModuleByteCode` linkables or
by passing `.gbc` files as arguments on the command line.
Fixes #26298
- - - - -
8f9ae339 by Matthew Pickering at 2025-12-05T16:25:57-05:00
Load bytecode libraries to satisfy package dependencies
This commit allows you to use a bytecode library to satisfy a package
dependency when using the interpreter.
If a user enables `-fprefer-byte-code`, then if a package provides a
bytecode library, that will be loaded and used to satisfy the
dependency.
The main change is to separate the relevant parts of the `LoaderState`
into external and home package byte code. Bytecode is loaded into either
the home package or external part (similar to HPT/EPS split), HPT
bytecode can be unloaded. External bytecode is never unloaded.
The unload function has also only been called with an empty list of
"stable linkables" for a long time. It has been modified to directly
implement a complete unloading of the home package bytecode linkables.
At the moment, the bytecode libraries are found in the "library-dirs"
field from the package description. In the future when `Cabal`
implements support for "bytecode-library-dirs" field, we can read the
bytecode libraries from there. No changes to the Cabal submodule are
necessary at the moment.
Four new tests are added in testsuite/tests/cabal, which generate fake
package descriptions and test loading the libraries into GHCi.
Fixes #26298
- - - - -
54458ce4 by mangoiv at 2025-12-05T16:26:50-05:00
ExplicitLevelImports: improve documentation of the code
- more explicit names for variable names like `flg` or `topLevel`
- don't pass the same value twice to functions
- some explanations of interesting but undocumented code paths
- adjust comment to not mention non-existent error message
- - - - -
c7061392 by mangoiv at 2025-12-05T16:27:42-05:00
driver: don't expect nodes to exist when checking paths between them
In `mgQueryZero`, previously node lookups were expected to never fail,
i.e. it was expected that when calculating the path between two nodes in
a zero level import graph, both nodes would always exist. This is not
the case, e.g. in some situations involving exact names (see the
test-case). The fix is to first check whether the node is present in the
graph at all, instead of panicking, just to report that there is no
path.
Closes #26568
- - - - -
d6cf8463 by Peng Fan at 2025-12-06T11:06:28-05:00
NCG/LA64: Simplify genCCall into two parts
genCCall is too long, so it's been simplified into two parts:
genPrim and genLibCCall.
Suggested by Andreas Klebinger
- - - - -
9d371d23 by Matthew Pickering at 2025-12-06T11:07:09-05:00
hadrian: Use a response file to invoke GHC for dep gathering.
In some cases we construct an argument list too long for GHC to
handle directly on windows. This happens when we generate
the dependency file because the command line will contain
references to a large number of .hs files.
To avoid this we now invoke GHC using a response file when
generating dependencies to sidestep length limitations.
Note that we only pass the actual file names in the dependency
file. Why? Because this side-steps #26560
- - - - -
0043bfb0 by Marc Scholten at 2025-12-06T11:08:03-05:00
update xhtml to 3000.4.0.0
haddock-api: bump xhtml bounds
haddock-api: use lazy text instead of string to support xhtml 3000.4.0.0
Bumping submodule xhtml to 3000.4.0.0
add xhtml to stage0Packages
remove unused import of writeUtf8File
Remove redundant import
Update haddock golden files for xhtml 3000.4.0.0
Metric Decrease:
haddock.Cabal
haddock.base
- - - - -
fc958fc9 by Julian Ospald at 2025-12-06T11:08:53-05:00
rts: Fix object file format detection in loadArchive
Commit 76d1041dfa4b96108cfdd22b07f2b3feb424dcbe seems to
have introduced this bug, ultimately leading to failure of
test T11788. I can only theorize that this test isn't run
in upstream's CI, because they don't build a static GHC.
The culprit is that we go through the thin archive, trying
to follow the members on the filesystem, but don't
re-identify the new object format of the member. This pins
`object_fmt` to `NotObject` from the thin archive.
Thanks to @angerman for spotting this.
- - - - -
0f297f6e by mangoiv at 2025-12-06T11:09:44-05:00
users' guide: don't use f strings in the python script to ensure compatibility with python 3.5
- - - - -
3bfe7aa2 by Matthew Pickering at 2025-12-07T12:18:57-05:00
ci: Try using multi repl in ghc-in-ghci test
This should be quite a bit faster than the ./hadrian/ghci command as it
doesn't properly build all the dependencies.
- - - - -
2ef1601a by Rodrigo Mesquita at 2025-12-07T12:19:38-05:00
Stack.Decode: Don't error on bitmap size 0
A RET_BCO may have a bitmap with no payload.
In that case, the bitmap = 0.
One can observe this by using -ddump-bcos and interpreting
```
main = pure ()
```
Observe, for instance, that the BCO for this main function has size 0:
```
ProtoBCO Main.main#0:
\u []
break<main:Main,0>() GHC.Internal.Base.pure
GHC.Internal.Base.$fApplicativeIO GHC.Internal.Tuple.()
bitmap: 0 []
BRK_FUN <breakarray> main:Main 0 <cc>
PACK () 0
PUSH_G GHC.Internal.Base.$fApplicativeIO
PUSH_APPLY_PP
PUSH_G GHC.Internal.Base.pure
ENTER
```
Perhaps we never tried to decode a stack in which a BCO like this was
present. However, for the debugger, we want to decode stacks of threads
stopped at breakpoints, and these kind of BCOs do get on a stack under
e.g. `stg_apply_interp_info` frames.
See the accompanying test in the next commit for an example to trigger
the bug this commit fixes.
Fixes #26640
- - - - -
747153d2 by Rodrigo Mesquita at 2025-12-07T12:19:38-05:00
Add test for #26640
- - - - -
d4b1e353 by Simon Hengel at 2025-12-10T00:00:02-05:00
Fix syntax error in gadt_syntax.rst
- - - - -
91cc8be6 by Cheng Shao at 2025-12-10T00:00:43-05:00
ci: fix "ci.sh clean" to address frequent out of space error on windows runners
This patch fixes the `ci.sh clean` logic to address frequent out of
space error on windows runners; previously it didn't clean up the
inplace mingw blobs, which is the largest source of space leak on
windows runners. See added comment for detailed explanation.
- - - - -
536680d7 by Cheng Shao at 2025-12-10T12:03:30+01:00
compiler: remove unused CPP code in foreign stub
This patch removes unused CPP code in the generated foreign stub:
- `#define IN_STG_CODE 0` is not needed, since `Rts.h` already
includes this definition
- The `if defined(__cplusplus)` code paths are not needed in the `.c`
file, since we don't generate C++ stubs and don't include C++
headers in our stubs. But it still needs to be present in the `.h`
header since it might be later included into C++ source files.
- - - - -
118 changed files:
- .gitlab-ci.yml
- .gitlab/ci.sh
- .gitlab/generate-ci/gen_ci.hs
- compile_flags.txt
- compiler/GHC/ByteCode/Linker.hs
- compiler/GHC/ByteCode/Serialize.hs
- compiler/GHC/CmmToAsm/AArch64/RegInfo.hs
- compiler/GHC/CmmToAsm/LA64/CodeGen.hs
- compiler/GHC/CmmToAsm/PPC/RegInfo.hs
- compiler/GHC/Core/Map/Type.hs
- compiler/GHC/Driver/Backpack.hs
- compiler/GHC/Driver/CodeOutput.hs
- compiler/GHC/Driver/Downsweep.hs
- compiler/GHC/Driver/DynFlags.hs
- compiler/GHC/Driver/Errors/Ppr.hs
- compiler/GHC/Driver/Errors/Types.hs
- compiler/GHC/Driver/LlvmConfigCache.hs
- compiler/GHC/Driver/Make.hs
- compiler/GHC/Driver/Phases.hs
- compiler/GHC/Driver/Pipeline.hs
- compiler/GHC/Driver/Pipeline/Phases.hs
- compiler/GHC/Driver/Session.hs
- + compiler/GHC/Linker/ByteCode.hs
- compiler/GHC/Linker/Loader.hs
- compiler/GHC/Linker/Types.hs
- compiler/GHC/Rename/Splice.hs
- compiler/GHC/Runtime/Debugger.hs
- compiler/GHC/Runtime/Eval.hs
- compiler/GHC/Settings.hs
- compiler/GHC/Tc/Solver/Monad.hs
- compiler/GHC/Tc/Utils/Env.hs
- compiler/GHC/Types/Error/Codes.hs
- compiler/GHC/Unit/Home/PackageTable.hs
- compiler/GHC/Unit/Info.hs
- compiler/GHC/Unit/Module/Graph.hs
- compiler/GHC/Unit/State.hs
- compiler/ghc.cabal.in
- docs/users_guide/conf.py
- docs/users_guide/exts/gadt_syntax.rst
- docs/users_guide/phases.rst
- hadrian/src/Builder.hs
- hadrian/src/Rules/ToolArgs.hs
- hadrian/src/Settings/Builders/Ghc.hs
- hadrian/src/Settings/Default.hs
- libraries/ghc-boot/GHC/Unit/Database.hs
- libraries/ghc-internal/src/GHC/Internal/Stack/Decode.hs
- libraries/xhtml
- rts/linker/LoadArchive.c
- testsuite/config/ghc
- testsuite/driver/testlib.py
- testsuite/mk/boilerplate.mk
- + testsuite/tests/bytecode/T26640.hs
- + testsuite/tests/bytecode/T26640.script
- + testsuite/tests/bytecode/T26640.stdout
- testsuite/tests/bytecode/all.T
- + testsuite/tests/cabal/Bytecode.hs
- + testsuite/tests/cabal/BytecodeForeign.c
- + testsuite/tests/cabal/BytecodeForeign.hs
- testsuite/tests/cabal/Makefile
- testsuite/tests/cabal/all.T
- + testsuite/tests/cabal/bytecode.pkg
- + testsuite/tests/cabal/bytecode.script
- + testsuite/tests/cabal/bytecode_foreign.pkg
- + testsuite/tests/cabal/bytecode_foreign.script
- testsuite/tests/cabal/ghcpkg03.stderr
- testsuite/tests/cabal/ghcpkg03.stderr-mingw32
- testsuite/tests/cabal/ghcpkg05.stderr
- testsuite/tests/cabal/ghcpkg05.stderr-mingw32
- + testsuite/tests/cabal/pkg_bytecode.stderr
- + testsuite/tests/cabal/pkg_bytecode.stdout
- + testsuite/tests/cabal/pkg_bytecode_foreign.stderr
- + testsuite/tests/cabal/pkg_bytecode_foreign.stdout
- + testsuite/tests/cabal/pkg_bytecode_with_gbc.stderr
- + testsuite/tests/cabal/pkg_bytecode_with_gbc.stdout
- + testsuite/tests/cabal/pkg_bytecode_with_o.stderr
- + testsuite/tests/cabal/pkg_bytecode_with_o.stdout
- + testsuite/tests/driver/T20696/T20696.stderr-ext-interp
- testsuite/tests/driver/T20696/all.T
- testsuite/tests/driver/bytecode-object/Makefile
- testsuite/tests/driver/bytecode-object/all.T
- testsuite/tests/driver/bytecode-object/bytecode_object19.stdout
- + testsuite/tests/driver/bytecode-object/bytecode_object20.stdout
- + testsuite/tests/driver/bytecode-object/bytecode_object21.stderr
- + testsuite/tests/driver/bytecode-object/bytecode_object21.stdout
- + testsuite/tests/driver/bytecode-object/bytecode_object23.stdout
- + testsuite/tests/driver/bytecode-object/bytecode_object24.stdout
- testsuite/tests/driver/fat-iface/all.T
- + testsuite/tests/driver/fat-iface/fat012.stderr-ext-interp
- + testsuite/tests/driver/fat-iface/fat015.stderr-ext-interp
- + testsuite/tests/splice-imports/SI07.stderr-ext-interp
- testsuite/tests/splice-imports/all.T
- + testsuite/tests/th/T26099.hs
- + testsuite/tests/th/T26099.stderr
- + testsuite/tests/th/T26568.hs
- + testsuite/tests/th/T26568.stderr
- testsuite/tests/th/all.T
- utils/ghc-pkg/Main.hs
- utils/haddock/cabal.project
- utils/haddock/haddock-api/haddock-api.cabal
- utils/haddock/haddock-api/src/Haddock/Backends/Hoogle.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Names.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Themes.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Utils.hs
- utils/haddock/haddock-api/src/Haddock/Doc.hs
- utils/haddock/haddock-api/src/Haddock/Utils.hs
- utils/haddock/html-test/ref/Bug26.html
- utils/haddock/html-test/ref/Bug298.html
- utils/haddock/html-test/ref/Bug458.html
- utils/haddock/html-test/ref/Nesting.html
- utils/haddock/html-test/ref/TitledPicture.html
- utils/haddock/html-test/ref/Unicode.html
- utils/haddock/html-test/ref/Unicode2.html
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/af3e2a558fd489da67599bec7d0c5b…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/af3e2a558fd489da67599bec7d0c5b…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 4 commits: Fix syntax error in gadt_syntax.rst
by Marge Bot (@marge-bot) 10 Dec '25
by Marge Bot (@marge-bot) 10 Dec '25
10 Dec '25
Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC
Commits:
d4b1e353 by Simon Hengel at 2025-12-10T00:00:02-05:00
Fix syntax error in gadt_syntax.rst
- - - - -
91cc8be6 by Cheng Shao at 2025-12-10T00:00:43-05:00
ci: fix "ci.sh clean" to address frequent out of space error on windows runners
This patch fixes the `ci.sh clean` logic to address frequent out of
space error on windows runners; previously it didn't clean up the
inplace mingw blobs, which is the largest source of space leak on
windows runners. See added comment for detailed explanation.
- - - - -
ea311591 by Recursion Ninja at 2025-12-10T00:33:12-05:00
Narrow before optimising MUL/DIV/REM into shifts
The MUL/DIV/REM operations can be optimised into shifts when one of the
operands is a constant power of 2. However, as literals in Cmm are
stored as 'Integer', for this to be correct we first need to narrow the
literal to the appropriate width before checking whether the literal is
a power of 2.
Fixes #25664
- - - - -
935c9d27 by Recursion Ninja at 2025-12-10T00:33:12-05:00
Decouple 'Language.Haskell.Syntax.Type' from 'GHC.Utils.Panic'
- Remove the *original* defintion of 'hsQTvExplicit' defined within 'Language.Haskell.Syntax.Type'
- Redefine 'hsQTvExplicit' as 'hsq_explicit' specialized to 'GhcPass' exported by 'GHC.Utils.Panic'
- Define 'hsQTvExplicitBinders' as 'hsq_explicit' specialized to 'DocNameI' exported by 'Haddock.GhcUtils'.
- Replace all call sites of the original 'hsQTvExplicit' definition with either:
1. 'hsQTvExplicit' updated definition
2. 'hsQTvExplicitBinders'
All call sites never entered the 'XLHsQTyVars' constructor branch, but a call to 'panic' existed on this code path because the type system was not strong enought to guarantee that the 'XLHsQTyVars' construction was impossible.
These two specialized functions provide the type system with enough information to make that guarantee, and hence the dependancy on 'panic' can be removed.
- - - - -
12 changed files:
- .gitlab/ci.sh
- .gitlab/generate-ci/gen_ci.hs
- compiler/GHC/Cmm/Opt.hs
- compiler/GHC/Hs/Type.hs
- compiler/Language/Haskell/Syntax/Type.hs
- docs/users_guide/exts/gadt_syntax.rst
- + testsuite/tests/cmm/opt/T25664.hs
- + testsuite/tests/cmm/opt/T25664.stdout
- testsuite/tests/cmm/opt/all.T
- utils/haddock/haddock-api/src/Haddock/Backends/LaTeX.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
- utils/haddock/haddock-api/src/Haddock/GhcUtils.hs
Changes:
=====================================
.gitlab/ci.sh
=====================================
@@ -275,7 +275,7 @@ function setup() {
function fetch_ghc() {
local should_fetch=false
-
+
if [ ! -e "$GHC" ]; then
if [ -z "${FETCH_GHC_VERSION:-}" ]; then
fail "GHC not found at '$GHC' and FETCH_GHC_VERSION is not set"
@@ -292,7 +292,7 @@ function fetch_ghc() {
fi
fi
fi
-
+
if [ "$should_fetch" = true ]; then
local v="$FETCH_GHC_VERSION"
@@ -887,8 +887,28 @@ function save_cache () {
}
function clean() {
- rm -R tmp
- run rm -Rf _build
+ # When CI_DISPOSABLE_ENVIRONMENT is not true (e.g. using shell
+ # executor on windows/macos), the project directory is not removed
+ # by gitlab runner automatically after each job. To mitigate the
+ # space leak, other than periodic cleaning on the runner host, we
+ # also must aggressively cleanup build products, otherwise we run
+ # into out of space errors too frequently.
+ #
+ # When CI_DISPOSABLE_ENVIRONMENT is true (using docker executor on
+ # linux), the runner will do proper cleanup, so no need to do
+ # anything here.
+ #
+ # The exclude list are the artifacts that we do expect to be
+ # uploaded. Keep in sync with `jobArtifacts` in
+ # `.gitlab/generate-ci/gen_ci.hs`!
+ if [[ "${CI_DISPOSABLE_ENVIRONMENT:-}" != true ]]; then
+ git submodule foreach --recursive git clean -xdf
+ git clean -xdf \
+ --exclude=ci_timings.txt \
+ --exclude=ghc-*.tar.xz \
+ --exclude=junit.xml \
+ --exclude=unexpected-test-output.tar.gz
+ fi
}
function run_hadrian() {
=====================================
.gitlab/generate-ci/gen_ci.hs
=====================================
@@ -889,6 +889,8 @@ job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} }
, if testsuiteUsePerf buildConfig then "RUNTEST_ARGS" =: "--config perf_path=perf" else mempty
]
+ -- Keep in sync with the exclude list in `function clean()` in
+ -- `.gitlab/ci.sh`!
jobArtifacts = Artifacts
{ junitReport = "junit.xml"
, expireIn = "2 weeks"
=====================================
compiler/GHC/Cmm/Opt.hs
=====================================
@@ -395,26 +395,39 @@ cmmMachOpFoldM platform mop [x, (CmmLit (CmmInt 1 rep))]
one = CmmLit (CmmInt 1 (wordWidth platform))
-- Now look for multiplication/division by powers of 2 (integers).
-
-cmmMachOpFoldM platform mop [x, (CmmLit (CmmInt n _))]
+--
+-- Naively this is as simple a matter as left/right bit shifts,
+-- but the Cmm representation if integral values quickly complicated the matter.
+--
+-- We must carefully narrow the value to be within the range of values for the
+-- type's logical bit-width. However, Cmm only represents values as *signed*
+-- integers internally yet the logical type may be unsigned. If we are dealing
+-- with a negative integer type at width @_w@, the only negative number that
+-- wraps around to be a positive power of 2 after calling narrowU is -2^(_w - 1)
+-- which wraps round to 2^(_w - 1), and multiplying by -2^(_w - 1) is indeed
+-- the same as a left shift by (w - 1), so this is OK.
+--
+-- ToDo: See #25664 (comment 605821) describing a change to the Cmm literal representation.
+-- When/If this is completed, this code must be refactored to account for the explicit width sizes.
+cmmMachOpFoldM platform mop [x, (CmmLit (CmmInt n _w))]
= case mop of
MO_Mul rep
- | Just p <- exactLog2 n ->
+ | Just p <- exactLog2 (narrowU rep n) ->
Just $! (cmmMachOpFold platform (MO_Shl rep) [x, CmmLit (CmmInt p $ wordWidth platform)])
MO_U_Quot rep
- | Just p <- exactLog2 n ->
+ | Just p <- exactLog2 (narrowU rep n) ->
Just $! (cmmMachOpFold platform (MO_U_Shr rep) [x, CmmLit (CmmInt p $ wordWidth platform)])
MO_U_Rem rep
- | Just _ <- exactLog2 n ->
+ | Just _ <- exactLog2 (narrowU rep n) ->
Just $! (cmmMachOpFold platform (MO_And rep) [x, CmmLit (CmmInt (n - 1) rep)])
MO_S_Quot rep
- | Just p <- exactLog2 n,
+ | Just p <- exactLog2 (narrowS rep n),
CmmReg _ <- x -> -- We duplicate x in signedQuotRemHelper, hence require
-- it is a reg. FIXME: remove this restriction.
Just $! (cmmMachOpFold platform (MO_S_Shr rep)
[signedQuotRemHelper rep p, CmmLit (CmmInt p $ wordWidth platform)])
MO_S_Rem rep
- | Just p <- exactLog2 n,
+ | Just p <- exactLog2 (narrowS rep n),
CmmReg _ <- x -> -- We duplicate x in signedQuotRemHelper, hence require
-- it is a reg. FIXME: remove this restriction.
-- We replace (x `rem` 2^p) by (x - (x `quot` 2^p) * 2^p).
=====================================
compiler/GHC/Hs/Type.hs
=====================================
@@ -640,6 +640,9 @@ hsLTyVarName = hsTyVarName . unLoc
hsLTyVarNames :: [LHsTyVarBndr flag (GhcPass p)] -> [IdP (GhcPass p)]
hsLTyVarNames = mapMaybe hsLTyVarName
+hsQTvExplicit :: LHsQTyVars (GhcPass p) -> [LHsTyVarBndr (HsBndrVis (GhcPass p)) (GhcPass p)]
+hsQTvExplicit = hsq_explicit
+
hsForAllTelescopeBndrs :: HsForAllTelescope (GhcPass p) -> [LHsTyVarBndr ForAllTyFlag (GhcPass p)]
hsForAllTelescopeBndrs (HsForAllVis _ bndrs) = map (fmap (setHsTyVarBndrFlag Required)) bndrs
hsForAllTelescopeBndrs (HsForAllInvis _ bndrs) = map (fmap (updateHsTyVarBndrFlag Invisible)) bndrs
=====================================
compiler/Language/Haskell/Syntax/Type.hs
=====================================
@@ -55,7 +55,6 @@ module Language.Haskell.Syntax.Type (
FieldOcc(..), LFieldOcc,
mapHsOuterImplicit,
- hsQTvExplicit,
isHsKindedTyVar
) where
@@ -68,7 +67,6 @@ import Language.Haskell.Syntax.Specificity
import GHC.Hs.Doc (LHsDoc)
import GHC.Data.FastString (FastString)
-import GHC.Utils.Panic( panic )
import Data.Data hiding ( Fixity, Prefix, Infix )
import Data.Maybe
@@ -326,10 +324,6 @@ data LHsQTyVars pass -- See Note [HsType binders]
}
| XLHsQTyVars !(XXLHsQTyVars pass)
-hsQTvExplicit :: LHsQTyVars pass -> [LHsTyVarBndr (HsBndrVis pass) pass]
-hsQTvExplicit (HsQTvs { hsq_explicit = explicit_tvs }) = explicit_tvs
-hsQTvExplicit (XLHsQTyVars {}) = panic "hsQTvExplicit"
-
------------------------------------------------
-- HsOuterTyVarBndrs
-- Used to quantify the outermost type variable binders of a type that obeys
=====================================
docs/users_guide/exts/gadt_syntax.rst
=====================================
@@ -387,6 +387,6 @@ type declarations.
::
- infix 6 (:--:)
+ infix 6 :--:
data T a where
(:--:) :: Int -> Bool -> T Int
=====================================
testsuite/tests/cmm/opt/T25664.hs
=====================================
@@ -0,0 +1,17 @@
+{-# OPTIONS_GHC -O -fno-full-laziness #-}
+{-# LANGUAGE MagicHash #-}
+
+import GHC.Exts
+import GHC.Int
+
+mb8 :: Int8 -> Int8
+{-# OPAQUE mb8 #-}
+mb8 (I8# i) = I8# (i `quotInt8#` (noinline intToInt8# 128#))
+
+mb16 :: Int16 -> Int16
+{-# OPAQUE mb16 #-}
+mb16 (I16# i) = I16# (i `quotInt16#` (noinline intToInt16# 32768#))
+
+main :: IO ()
+main = print (mb8 minBound) >> print (mb16 minBound)
+
=====================================
testsuite/tests/cmm/opt/T25664.stdout
=====================================
@@ -0,0 +1,2 @@
+1
+1
=====================================
testsuite/tests/cmm/opt/all.T
=====================================
@@ -12,3 +12,6 @@ test('T25771', [cmm_src, only_ways(['optasm']),
grep_errmsg(r'(12\.345|0\.6640625)',[1]),
],
compile, ['-ddump-cmm'])
+
+# Cmm should correctly account for word size when performing MUL/DIV/REM by a power of 2 optimization.
+test('T25664', normal, compile_and_run, [''])
\ No newline at end of file
=====================================
utils/haddock/haddock-api/src/Haddock/Backends/LaTeX.hs
=====================================
@@ -435,7 +435,7 @@ ppFamHeader
| associated = id
| otherwise = (<+> keyword "family")
- famName = ppAppDocNameTyVarBndrs unicode name (hsq_explicit tvs)
+ famName = ppAppDocNameTyVarBndrs unicode name (hsQTvExplicitBinders tvs)
famSig = case result of
NoSig _ -> empty
@@ -644,7 +644,7 @@ ppTyVars :: RenderableBndrFlag flag => Bool -> [LHsTyVarBndr flag DocNameI] -> [
ppTyVars unicode tvs = map (ppHsTyVarBndr unicode . unLoc) tvs
tyvarNames :: LHsQTyVars DocNameI -> [Maybe Name]
-tyvarNames = map (fmap getName . hsLTyVarNameI) . hsQTvExplicit
+tyvarNames = map (fmap getName . hsLTyVarNameI) . hsQTvExplicitBinders
declWithDoc :: LaTeX -> Maybe LaTeX -> LaTeX
declWithDoc decl doc =
=====================================
utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
=====================================
@@ -468,7 +468,7 @@ ppTySyn
hdr =
hsep
( [keyword "type", ppBinder summary occ]
- ++ ppTyVars unicode qual (hsQTvExplicit ltyvars)
+ ++ ppTyVars unicode qual (hsQTvExplicitBinders ltyvars)
)
full = hdr <+> def
def = case unLoc ltype of
@@ -595,7 +595,7 @@ ppFamHeader
qual =
hsep
[ ppFamilyLeader associated info
- , ppAppDocNameTyVarBndrs summary unicode qual name (hsq_explicit tvs)
+ , ppAppDocNameTyVarBndrs summary unicode qual name (hsQTvExplicitBinders tvs)
, ppResultSig result unicode qual
, injAnn
, whereBit
@@ -760,7 +760,7 @@ ppClassHdr
ppClassHdr summ lctxt n tvs fds unicode qual =
keyword "class"
<+> (if not (null $ fromMaybeContext lctxt) then ppLContext lctxt unicode qual HideEmptyContexts else noHtml)
- <+> ppAppDocNameTyVarBndrs summ unicode qual n (hsQTvExplicit tvs)
+ <+> ppAppDocNameTyVarBndrs summ unicode qual n (hsQTvExplicitBinders tvs)
<+> ppFds fds unicode qual
ppFds :: [LHsFunDep DocNameI] -> Unicode -> Qualification -> Html
@@ -1656,7 +1656,7 @@ ppDataHeader
ppLContext ctxt unicode qual HideEmptyContexts
<+>
-- T a b c ..., or a :+: b
- ppAppDocNameTyVarBndrs summary unicode qual name (hsQTvExplicit tvs)
+ ppAppDocNameTyVarBndrs summary unicode qual name (hsQTvExplicitBinders tvs)
<+> case ks of
Nothing -> mempty
Just (L _ x) -> dcolon unicode <+> ppKind unicode qual x
=====================================
utils/haddock/haddock-api/src/Haddock/GhcUtils.hs
=====================================
@@ -333,9 +333,12 @@ lHsQTyVarsToTypes tvs =
[ HsValArg noExtField $ noLocA (case hsLTyVarName tv of
Nothing -> HsWildCardTy noExtField
Just nm -> HsTyVar noAnn NotPromoted (noLocA $ noUserRdr nm))
- | tv <- hsQTvExplicit tvs
+ | tv <- hsq_explicit tvs
]
+hsQTvExplicitBinders :: LHsQTyVars DocNameI -> [LHsTyVarBndr (HsBndrVis DocNameI) DocNameI]
+hsQTvExplicitBinders = hsq_explicit
+
--------------------------------------------------------------------------------
-- * Making abstract declarations
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/82f7fa00ae0332b56b7c84dab54fc1…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/82f7fa00ae0332b56b7c84dab54fc1…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][master] ci: fix "ci.sh clean" to address frequent out of space error on windows runners
by Marge Bot (@marge-bot) 10 Dec '25
by Marge Bot (@marge-bot) 10 Dec '25
10 Dec '25
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
91cc8be6 by Cheng Shao at 2025-12-10T00:00:43-05:00
ci: fix "ci.sh clean" to address frequent out of space error on windows runners
This patch fixes the `ci.sh clean` logic to address frequent out of
space error on windows runners; previously it didn't clean up the
inplace mingw blobs, which is the largest source of space leak on
windows runners. See added comment for detailed explanation.
- - - - -
2 changed files:
- .gitlab/ci.sh
- .gitlab/generate-ci/gen_ci.hs
Changes:
=====================================
.gitlab/ci.sh
=====================================
@@ -275,7 +275,7 @@ function setup() {
function fetch_ghc() {
local should_fetch=false
-
+
if [ ! -e "$GHC" ]; then
if [ -z "${FETCH_GHC_VERSION:-}" ]; then
fail "GHC not found at '$GHC' and FETCH_GHC_VERSION is not set"
@@ -292,7 +292,7 @@ function fetch_ghc() {
fi
fi
fi
-
+
if [ "$should_fetch" = true ]; then
local v="$FETCH_GHC_VERSION"
@@ -887,8 +887,28 @@ function save_cache () {
}
function clean() {
- rm -R tmp
- run rm -Rf _build
+ # When CI_DISPOSABLE_ENVIRONMENT is not true (e.g. using shell
+ # executor on windows/macos), the project directory is not removed
+ # by gitlab runner automatically after each job. To mitigate the
+ # space leak, other than periodic cleaning on the runner host, we
+ # also must aggressively cleanup build products, otherwise we run
+ # into out of space errors too frequently.
+ #
+ # When CI_DISPOSABLE_ENVIRONMENT is true (using docker executor on
+ # linux), the runner will do proper cleanup, so no need to do
+ # anything here.
+ #
+ # The exclude list are the artifacts that we do expect to be
+ # uploaded. Keep in sync with `jobArtifacts` in
+ # `.gitlab/generate-ci/gen_ci.hs`!
+ if [[ "${CI_DISPOSABLE_ENVIRONMENT:-}" != true ]]; then
+ git submodule foreach --recursive git clean -xdf
+ git clean -xdf \
+ --exclude=ci_timings.txt \
+ --exclude=ghc-*.tar.xz \
+ --exclude=junit.xml \
+ --exclude=unexpected-test-output.tar.gz
+ fi
}
function run_hadrian() {
=====================================
.gitlab/generate-ci/gen_ci.hs
=====================================
@@ -889,6 +889,8 @@ job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} }
, if testsuiteUsePerf buildConfig then "RUNTEST_ARGS" =: "--config perf_path=perf" else mempty
]
+ -- Keep in sync with the exclude list in `function clean()` in
+ -- `.gitlab/ci.sh`!
jobArtifacts = Artifacts
{ junitReport = "junit.xml"
, expireIn = "2 weeks"
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/91cc8be6ec1e1b608779a90bc14a44b…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/91cc8be6ec1e1b608779a90bc14a44b…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
10 Dec '25
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
d4b1e353 by Simon Hengel at 2025-12-10T00:00:02-05:00
Fix syntax error in gadt_syntax.rst
- - - - -
1 changed file:
- docs/users_guide/exts/gadt_syntax.rst
Changes:
=====================================
docs/users_guide/exts/gadt_syntax.rst
=====================================
@@ -387,6 +387,6 @@ type declarations.
::
- infix 6 (:--:)
+ infix 6 :--:
data T a where
(:--:) :: Int -> Bool -> T Int
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d4b1e35392f6afdfc18477225204a2b…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d4b1e35392f6afdfc18477225204a2b…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
09 Dec '25
Duncan Coutts pushed new branch wip/dcoutts/windows-rts-dll at Glasgow Haskell Compiler / GHC
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/dcoutts/windows-rts-dll
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/9.12.3-backports] 23 commits: rts: fix top handler closure type signatures
by Zubin (@wz1000) 09 Dec '25
by Zubin (@wz1000) 09 Dec '25
09 Dec '25
Zubin pushed to branch wip/9.12.3-backports at Glasgow Haskell Compiler / GHC
Commits:
d4489170 by Cheng Shao at 2025-11-21T15:50:36+01:00
rts: fix top handler closure type signatures
This commit fixes the runIO/runNonIO closure type signatures in the
RTS which should be extern StgClosure. This allows us to remove an
unnecessary type cast in the C foreign desugaring logic, as well as
unneeded complications of JSFFI desugaring logic that also needs to
generate C stubs that may refer to those top handler closures.
Otherwise, we'll have to take special care to avoid generating "extern
StgClosure" declarations for them as we would for other closures, just
to avoid conflicting type signature error at stub compile time.
(cherry picked from commit c78d8f55afacfd559b1602bc2fbc35b1f326f1c1)
- - - - -
18d6cf11 by Cheng Shao at 2025-11-21T15:50:36+01:00
compiler: allow arbitrary label string for JSFFI exports
This commit allows arbitrary label string to appear in a foreign
export declaration, as long as the calling convention is javascript.
Well, doesn't make sense to enforce it's a C function symbol for a
JSFFI declaration anyway, and it gets in the way of implementing the
"sync" flavour of exports.
(cherry picked from commit a204df3aa5a7be00c67aa7c92c5091ab32522226)
- - - - -
3ecb5e0b by Cheng Shao at 2025-11-21T15:50:36+01:00
compiler: wasm backend JSFFI sync exports
This commit implements the synchronous flavour of the wasm backend
JSFFI exports:
- `foreign export javascript "foo sync"` exports a top-level Haskell
binding as a synchronous JS function
- `foreign import javascript "wrapper sync"` dynamically exports a
Haskell function closure as a synchronous JS function
- `foreign import javascript unsafe` is now re-entrant by lowering to
a safe ccall
- Also fix the issue that JSFFI dynamic exports didn't really work in
TH & ghci (#25473)
(cherry picked from commit 03ebab52bd00d4726735829cf6a24e5c9d3ac0c1)
- - - - -
5afe9c33 by Cheng Shao at 2025-11-21T15:50:36+01:00
testsuite: test wasm backend JSFFI sync exports
This commit repurposes some existing JSFFI test cases to make them
cover JSFFI sync exports as well.
(cherry picked from commit b6ae908bd3ae7b75b79925e56c3e11ba5c40b5ec)
- - - - -
9efbf3f4 by Cheng Shao at 2025-11-21T15:50:37+01:00
docs: document wasm backend JSFFI sync exports
This commit updates wasm backend documentation to reflect the new
JSFFI sync exports feature.
(cherry picked from commit edae287402792c09fa92b655e0cbd01100db9856)
- - - - -
61754416 by Cheng Shao at 2025-11-21T15:50:37+01:00
wasm: add error message to WouldBlockException
This commit attaches an error message to WouldBlockException, for now
the error message consists of the JS async import code snippet that
thunk is trying to block for. This is useful for debugging synchronous
callbacks that accidentally call an async JS function.
(cherry picked from commit 9b54eecbee7329543e5016cec1574831bfb788c2)
- - - - -
3b26d306 by Cheng Shao at 2025-11-21T15:50:37+01:00
ghc-experimental: make JSVal abstract in GHC.Wasm.Prim
This commit makes JSVal an abstract type in the export list of
GHC.Wasm.Prim. JSVal's internal representation is supposed to be a non
user facing implementation detail subject to change at any time. We
should only expose things that are newtypes of JSVal, not JSVal
itself.
(cherry picked from commit 8037f487ff1721973737b01e29136c671fd25157)
- - - - -
03600749 by Cheng Shao at 2025-11-21T15:50:37+01:00
wasm: make JSVal internal Weak# point to lifted JSVal
JSVal has an internal Weak# with the unlifted JSVal# object as key to
arrange its builtin finalization logic. The Weak# used to designate
Unit_closure as a dummy value; now this commit designates the lifted
JSVal closure as the Weak# value. This allows the implementation of
mkWeakJSVal which can be used to observe the liveliness of a JSVal and
attach a user-specified finalizer.
(cherry picked from commit 4f34243101684a0ad15f5986abec00c675b48955)
- - - - -
f66e52c8 by Cheng Shao at 2025-11-21T15:50:37+01:00
ghc-experimental: add mkWeakJSVal
This commit adds a mkWeakJSVal function that can be used to set up a
Weak pointer with a JSVal key to observe the key's lifetime and
optionally attach a finalizer.
(cherry picked from commit 55af20e6ed5c72a46a09b88e8590b6b2309eb41b)
- - - - -
da0ccd0e by Cheng Shao at 2025-11-21T15:50:37+01:00
wasm: don't create a wasm global for dyld poison
There's a much more efficient way to convert an unsigned i32 to a
signed one. Thanks, o3-mini-high.
(cherry picked from commit 75fcc5c9ab900cb80834802c581283681cf8c398)
- - - - -
8003474f by Cheng Shao at 2025-11-21T16:01:18+01:00
wasm: revamp JSFFI internal implementation and documentation
This patch revamps the wasm backend's JSFFI internal implementation
and documentation:
- `JSValManager` logic to allocate a key is simplified to simple
bumping. According to experiments with all major browsers, the
internal `Map` would overflow the heap much earlier before we really
exhaust the 32-bit key space, so there's no point in the extra
complexity.
- `freeJSVal` is now idempotent and safe to call more than once. This
is achieved by attaching the `StablePtr#` to the `JSVal#` closure
and nullifying it when calling `freeJSVal`, so the same stable
pointer cannot be double freed.
- `mkWeakJSVal` no longer exposes the internal `Weak#` pointer and
always creates a new `Weak#` on the fly. Otherwise by finalizing
that `Weak#`, user could accidentally drop the `JSVal`, but
`mkWeakJSVal` is only supposed to create a `Weak` that observes the
`JSVal`'s liveliness without actually interfering it.
- `PromisePendingException` is no longer exported since it's never
meant to be caught by user code; it's a severe bug if it's actually
raised at runtime.
- Everything exported by user-facing `GHC.Wasm.Prim` now has proper
haddock documentation.
- Note [JSVal representation for wasm] has been updated to reflect the
new JSVal# memory layout.
(cherry picked from commit fd40eaa17c6ce8716ec2eacc95beae194a935352)
- - - - -
60acee61 by Cheng Shao at 2025-11-21T16:03:36+01:00
rts: add hs_try_putmvar_with_value to RTS API
This commit adds hs_try_putmvar_with_value to rts. It allows more
flexibility than hs_try_putmvar by taking an additional value argument
as a closure to be put into the MVar. This function is used & tested
by the wasm backend runtime, though it makes sense to expose it as a
public facing RTS API function as well.
(cherry picked from commit f75e823e0a9ac9fbe661fce232324c5b103ee8a8)
- - - - -
cdfb37c3 by Cheng Shao at 2025-11-21T16:03:36+01:00
wasm: use MVar as JSFFI import blocking mechanism
Previously, when blocking on a JSFFI import, we push a custom
stg_jsffi_block stack frame and arrange the `promise.then` callback to
write to that stack frame. It turns out we can simply use the good old
MVar to implement the blocking logic, with a few benefits:
- Less maintenance burden. We can drop the stg_jsffi_block related Cmm
code without loss of functionality.
- It interacts better with existing async exception mechanism. throwTo
would properly block the caller if the target thread is masking
async exceptions.
(cherry picked from commit 9cd9f34787b4d54e1ba3fbbf927a160a0f8eab99)
- - - - -
8dfb64de by Cheng Shao at 2025-11-21T16:03:36+01:00
wasm: properly pin the raiseJSException closure
We used to use keepAlive# to pin the raiseJSException closure when
blocking on a JSFFI import thunk, since it can potentially be used by
RTS. But raiseJSException may be used in other places as well (e.g.
the promise.throwTo logic), and it's better to simply unconditionally
pin it in the JSFFI initialization logic.
(cherry picked from commit da34f0aa2082d1c5a306cc8356abba15f3d59aad)
- - - - -
0166eb5d by Cheng Shao at 2025-11-21T16:03:36+01:00
wasm: implement promise.throwTo() for async JSFFI exports
This commit implements promise.throwTo() for wasm backend JSFFI
exports. This allows the JavaScript side to interrupt Haskell
computation by raising an async exception. See subsequent docs/test
commits for more details.
(cherry picked from commit dc904bfdd17ed1108580367b34bbe7204ed4ea95)
- - - - -
93de375e by Cheng Shao at 2025-11-21T16:03:36+01:00
testsuite: add test for wasm promise.throwTo() logic
This commit adds a test case to test the wasm backend
promise.throwTo() logic.
(cherry picked from commit 7f80455ee45e70d142bbc69478b9a8db43082187)
- - - - -
791ac161 by Cheng Shao at 2025-11-21T16:03:36+01:00
docs: document the wasm backend promise.throwTo() feature
(cherry picked from commit afdd3fe7fff60e046f6a3ee4795c58abe81f03a2)
- - - - -
8d8807f2 by Cheng Shao at 2025-11-21T16:24:59+01:00
rts: fix wasm JSFFI initialization constructor code
This commit fixes wasm JSFFI initialization constructor code so that
the constructor is self-contained and avoids invoking a fake
__main_argc_argv function. The previous approach of reusing
__main_void logic in wasi-libc saves a tiny bit of code, at the
expense of link-time trouble whenever GHC links a wasm module without
-no-hs-main, in which case the driver-generated main function would
clash with the definition here, resulting in a linker error. It's
simply better to avoid messing with the main function, and it would
additionally allow linking wasm32-wasi command modules that does make
use of synchronous JSFFI.
(cherry picked from commit bdc9d130a838017f863f5c7a380cb0858035f859)
- - - - -
6d38b32c by Cheng Shao at 2025-11-21T17:16:11+01:00
wasm: fix remaining regressions in upstream 9.12 branch
This commit fixes remaining regressions in upstream 9.12 branch caused
by broken backporting of !14892. Fixes #26600.
- - - - -
3cd27895 by Cheng Shao at 2025-11-25T14:30:05+01:00
docs: add wasm related items in 9.12.3 notes
- - - - -
bd923b84 by Ben Gamari at 2025-12-09T12:32:43+05:30
Revert "configure: do not set LLC/OPT/LLVMAS fallback values when FIND_LLVM_PROG fails"
While dropping these fallbacks is likely the right thing in the long
run, doing so now makes it needlessly difficult for users to use the
LLVM backend. See #26209. This will change once `ghc-toolchain` becomes
the default path.
This reverts commit 4eb5ad09cf93caa5791a735baa0e7ba86b916f2a.
(cherry picked from commit 9922faa74dcf7975def67ab82d27da05da7d29f2)
- - - - -
85edfeb1 by Zubin Duggal at 2025-12-09T12:35:05+05:30
rts/linker/PEi386: Copy strings before they are inserted into LoadedDllCache. The original strings are temporary and might be freed at an arbitrary point.
Fixes #26613
(cherry picked from commit 5072da477b8ec883aea4b9ea27763fcc1971af1a)
- - - - -
65621219 by Zubin Duggal at 2025-12-09T22:32:33+05:30
haddock: Bump version to 2.32.0
- - - - -
35 changed files:
- compiler/GHC/HsToCore/Foreign/C.hs
- compiler/GHC/HsToCore/Foreign/Wasm.hs
- compiler/GHC/Tc/Gen/Foreign.hs
- docs/users_guide/9.12.3-notes.rst
- docs/users_guide/exts/ffi.rst
- docs/users_guide/wasm.rst
- libraries/ghc-experimental/src/GHC/Wasm/Prim.hs
- libraries/ghc-internal/src/GHC/Internal/Wasm/Prim.hs
- libraries/ghc-internal/src/GHC/Internal/Wasm/Prim/Exports.hs
- libraries/ghc-internal/src/GHC/Internal/Wasm/Prim/Flag.hs
- libraries/ghc-internal/src/GHC/Internal/Wasm/Prim/Imports.hs
- libraries/ghc-internal/src/GHC/Internal/Wasm/Prim/Types.hs
- m4/fp_settings.m4
- rts/RtsAPI.c
- rts/RtsSymbols.c
- rts/include/HsFFI.h
- rts/linker/PEi386.c
- rts/wasm/JSFFI.c
- rts/wasm/blocker.cmm
- rts/wasm/jsval.cmm
- rts/wasm/scheduler.cmm
- testsuite/tests/jsffi/all.T
- + testsuite/tests/jsffi/cancel.hs
- + testsuite/tests/jsffi/cancel.mjs
- + testsuite/tests/jsffi/cancel.stdout
- testsuite/tests/jsffi/jsffigc.hs
- testsuite/tests/jsffi/jsffigc.mjs
- testsuite/tests/jsffi/jsffisleep.hs
- testsuite/tests/jsffi/jsffisleep.stdout
- testsuite/tests/jsffi/textconv.hs
- testsuite/tests/jsffi/textconv.mjs
- utils/haddock/haddock-api/haddock-api.cabal
- utils/haddock/haddock.cabal
- utils/jsffi/dyld.mjs
- utils/jsffi/prelude.mjs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/316e99e8a41ae1aaffde9b1285ff93…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/316e99e8a41ae1aaffde9b1285ff93…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 5 commits: ci: Try using multi repl in ghc-in-ghci test
by Marge Bot (@marge-bot) 09 Dec '25
by Marge Bot (@marge-bot) 09 Dec '25
09 Dec '25
Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC
Commits:
3bfe7aa2 by Matthew Pickering at 2025-12-07T12:18:57-05:00
ci: Try using multi repl in ghc-in-ghci test
This should be quite a bit faster than the ./hadrian/ghci command as it
doesn't properly build all the dependencies.
- - - - -
2ef1601a by Rodrigo Mesquita at 2025-12-07T12:19:38-05:00
Stack.Decode: Don't error on bitmap size 0
A RET_BCO may have a bitmap with no payload.
In that case, the bitmap = 0.
One can observe this by using -ddump-bcos and interpreting
```
main = pure ()
```
Observe, for instance, that the BCO for this main function has size 0:
```
ProtoBCO Main.main#0:
\u []
break<main:Main,0>() GHC.Internal.Base.pure
GHC.Internal.Base.$fApplicativeIO GHC.Internal.Tuple.()
bitmap: 0 []
BRK_FUN <breakarray> main:Main 0 <cc>
PACK () 0
PUSH_G GHC.Internal.Base.$fApplicativeIO
PUSH_APPLY_PP
PUSH_G GHC.Internal.Base.pure
ENTER
```
Perhaps we never tried to decode a stack in which a BCO like this was
present. However, for the debugger, we want to decode stacks of threads
stopped at breakpoints, and these kind of BCOs do get on a stack under
e.g. `stg_apply_interp_info` frames.
See the accompanying test in the next commit for an example to trigger
the bug this commit fixes.
Fixes #26640
- - - - -
747153d2 by Rodrigo Mesquita at 2025-12-07T12:19:38-05:00
Add test for #26640
- - - - -
493cd900 by Simon Hengel at 2025-12-09T11:19:16-05:00
Fix syntax error in gadt_syntax.rst
- - - - -
82f7fa00 by Cheng Shao at 2025-12-09T11:19:16-05:00
ci: fix "ci.sh clean" to address frequent out of space error on windows runners
This patch fixes the `ci.sh clean` logic to address frequent out of
space error on windows runners; previously it didn't clean up the
inplace mingw blobs, which is the largest source of space leak on
windows runners. See added comment for detailed explanation.
- - - - -
9 changed files:
- .gitlab-ci.yml
- .gitlab/ci.sh
- .gitlab/generate-ci/gen_ci.hs
- docs/users_guide/exts/gadt_syntax.rst
- libraries/ghc-internal/src/GHC/Internal/Stack/Decode.hs
- + testsuite/tests/bytecode/T26640.hs
- + testsuite/tests/bytecode/T26640.script
- + testsuite/tests/bytecode/T26640.stdout
- testsuite/tests/bytecode/all.T
Changes:
=====================================
.gitlab-ci.yml
=====================================
@@ -416,7 +416,7 @@ hadrian-ghc-in-ghci:
# workaround for docker permissions
- sudo chown ghc:ghc -R .
variables:
- GHC_FLAGS: -Werror
+ GHC_FLAGS: -Werror -Wwarn=unused-imports
tags:
- x86_64-linux
script:
@@ -428,7 +428,7 @@ hadrian-ghc-in-ghci:
- "echo ' ghc-options: -Werror' >> hadrian/cabal.project.local"
# Load ghc-in-ghci then immediately exit and check the modules loaded
- export CORES="$(mk/detect-cpu-count.sh)"
- - echo ":q" | HADRIAN_ARGS=-j$CORES hadrian/ghci -j$CORES | tail -n2 | grep "Ok,"
+ - echo ":q" | HADRIAN_ARGS=-j$CORES hadrian/ghci-multi -j$CORES | tail -n2 | grep "Ok,"
after_script:
- .gitlab/ci.sh save_cache
- cat ci_timings.txt
=====================================
.gitlab/ci.sh
=====================================
@@ -275,7 +275,7 @@ function setup() {
function fetch_ghc() {
local should_fetch=false
-
+
if [ ! -e "$GHC" ]; then
if [ -z "${FETCH_GHC_VERSION:-}" ]; then
fail "GHC not found at '$GHC' and FETCH_GHC_VERSION is not set"
@@ -292,7 +292,7 @@ function fetch_ghc() {
fi
fi
fi
-
+
if [ "$should_fetch" = true ]; then
local v="$FETCH_GHC_VERSION"
@@ -887,8 +887,28 @@ function save_cache () {
}
function clean() {
- rm -R tmp
- run rm -Rf _build
+ # When CI_DISPOSABLE_ENVIRONMENT is not true (e.g. using shell
+ # executor on windows/macos), the project directory is not removed
+ # by gitlab runner automatically after each job. To mitigate the
+ # space leak, other than periodic cleaning on the runner host, we
+ # also must aggressively cleanup build products, otherwise we run
+ # into out of space errors too frequently.
+ #
+ # When CI_DISPOSABLE_ENVIRONMENT is true (using docker executor on
+ # linux), the runner will do proper cleanup, so no need to do
+ # anything here.
+ #
+ # The exclude list are the artifacts that we do expect to be
+ # uploaded. Keep in sync with `jobArtifacts` in
+ # `.gitlab/generate-ci/gen_ci.hs`!
+ if [[ "${CI_DISPOSABLE_ENVIRONMENT:-}" != true ]]; then
+ git submodule foreach --recursive git clean -xdf
+ git clean -xdf \
+ --exclude=ci_timings.txt \
+ --exclude=ghc-*.tar.xz \
+ --exclude=junit.xml \
+ --exclude=unexpected-test-output.tar.gz
+ fi
}
function run_hadrian() {
=====================================
.gitlab/generate-ci/gen_ci.hs
=====================================
@@ -889,6 +889,8 @@ job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} }
, if testsuiteUsePerf buildConfig then "RUNTEST_ARGS" =: "--config perf_path=perf" else mempty
]
+ -- Keep in sync with the exclude list in `function clean()` in
+ -- `.gitlab/ci.sh`!
jobArtifacts = Artifacts
{ junitReport = "junit.xml"
, expireIn = "2 weeks"
=====================================
docs/users_guide/exts/gadt_syntax.rst
=====================================
@@ -387,6 +387,6 @@ type declarations.
::
- infix 6 (:--:)
+ infix 6 :--:
data T a where
(:--:) :: Int -> Bool -> T Int
=====================================
libraries/ghc-internal/src/GHC/Internal/Stack/Decode.hs
=====================================
@@ -269,7 +269,7 @@ decodeLargeBitmap getterFun# stackSnapshot# index relativePayloadOffset = do
cWordArrayToList ptr size = mapM (peekElemOff ptr) [0 .. (size - 1)]
usedBitmapWords :: Int -> Int
- usedBitmapWords 0 = error "Invalid large bitmap size 0."
+ usedBitmapWords 0 = 0
usedBitmapWords size = (size `div` fromIntegral wORD_SIZE_IN_BITS) + 1
bitmapWordsPointerness :: Word -> [Word] -> [Pointerness]
=====================================
testsuite/tests/bytecode/T26640.hs
=====================================
@@ -0,0 +1,4 @@
+-- Main.hs
+module Main where
+main = pure ()
+
=====================================
testsuite/tests/bytecode/T26640.script
=====================================
@@ -0,0 +1,6 @@
+:l T26640
+:break 3
+main
+import GHC.Conc
+import GHC.Stack.CloneStack
+() <- mapM_ (\ix -> do !_ <- decode =<< cloneThreadStack ix; return ()) =<< listThreads
=====================================
testsuite/tests/bytecode/T26640.stdout
=====================================
@@ -0,0 +1,3 @@
+Breakpoint 0 activated at T26640.hs:3:8-14
+Stopped in Main.main, T26640.hs:3:8-14
+_result :: IO () = _
=====================================
testsuite/tests/bytecode/all.T
=====================================
@@ -8,6 +8,7 @@ test('T25975', extra_ways(ghci_ways), compile_and_run,
test('T26565', extra_files(["T26565.hs"]), ghci_script, ['T26565.script'])
test('T23973', extra_files(["T23973.hs"]), ghci_script, ['T23973.script'])
+test('T26640', extra_files(["T26640.hs"]), ghci_script, ['T26640.script'])
# Nullary data constructors
test('T26216', extra_files(["T26216_aux.hs"]), ghci_script, ['T26216.script'])
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d844061d91ec536b9a9ddbdb396382…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d844061d91ec536b9a9ddbdb396382…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/T26579] 40 commits: Add a fast-path for args=[] to occAnalApp
by Peter Trommler (@trommler) 09 Dec '25
by Peter Trommler (@trommler) 09 Dec '25
09 Dec '25
Peter Trommler pushed to branch wip/T26579 at Glasgow Haskell Compiler / GHC
Commits:
48a3ed57 by Simon Peyton Jones at 2025-11-25T15:33:54+00:00
Add a fast-path for args=[] to occAnalApp
In the common case of having not arguments, occAnalApp
was doing redundant work.
- - - - -
951e5ed9 by Simon Peyton Jones at 2025-11-25T15:33:54+00:00
Fix a performance hole in the occurrence analyser
As #26425 showed, the clever stuff in
Note [Occurrence analysis for join points]
does a lot of duplication of usage details. This patch
improved matters with a little fancy footwork. It is
described in the new (W4) of the same Note.
Compile-time allocations go down slightly. Here are the changes
of +/- 0.5% or more:
T13253(normal) 329,369,244 326,395,544 -0.9%
T13253-spj(normal) 66,410,496 66,095,864 -0.5%
T15630(normal) 129,797,200 128,663,136 -0.9%
T15630a(normal) 129,212,408 128,027,560 -0.9%
T16577(normal) 6,756,706,896 6,723,028,512 -0.5%
T18282(normal) 128,462,070 125,808,584 -2.1% GOOD
T18698a(normal) 208,418,305 202,037,336 -3.1% GOOD
T18730(optasm) 136,981,756 136,208,136 -0.6%
T18923(normal) 58,103,088 57,745,840 -0.6%
T19695(normal) 1,386,306,272 1,365,609,416 -1.5%
T26425(normal) 3,344,402,957 2,457,811,664 -26.5% GOOD
T6048(optasm) 79,763,816 79,212,760 -0.7%
T9020(optasm) 225,278,408 223,682,440 -0.7%
T9961(normal) 303,810,717 300,729,168 -1.0% GOOD
geo. mean -0.5%
minimum -26.5%
maximum +0.4%
Metric Decrease:
T18282
T18698a
T26425
T9961
- - - - -
f1959dfc by Simon Peyton Jones at 2025-11-26T11:58:07+00:00
Remove a quadratic-cost assertion check in mkCoreApp
See the new Note [Assertion checking in mkCoreApp]
- - - - -
98fa0d36 by Simon Hengel at 2025-11-27T17:54:57-05:00
Fix typo in docs/users_guide/exts/type_families.rst
- - - - -
5b97e5ce by Simon Hengel at 2025-11-27T17:55:37-05:00
Fix broken RankNTypes example in user's guide
- - - - -
fa2aaa00 by Simon Peyton Jones at 2025-11-27T17:56:18-05:00
Switch off specialisation in ExactPrint
In !15057 (where we re-introduced -fpolymoprhic-specialisation) we found
that ExactPrint's compile time blew up by a factor of 5. It turned out
to be caused by bazillions of specialisations of `markAnnotated`.
Since ExactPrint isn't perf-critical, it does not seem worth taking
the performance hit, so this patch switches off specialisation in
this one module.
- - - - -
1fd25987 by Simon Peyton Jones at 2025-11-27T17:56:18-05:00
Switch -fpolymorphic-specialisation on by default
This patch addresses #23559.
Now that !10479 has landed and #26329 is fixed, we can switch on
polymorphic specialisation by default, addressing a bunch of other
tickets listed in #23559.
Metric changes:
* CoOpt_Singleton: +4% compiler allocations: we just get more
specialisations
* info_table_map_perf: -20% decrease in compiler allocations.
This is caused by using -fno-specialise in ExactPrint.hs
Without that change we get a 4x blow-up in compile time;
see !15058 for details
Metric Decrease:
info_table_map_perf
Metric Increase:
CoOpt_Singletons
- - - - -
b7fe7445 by Matthew Pickering at 2025-11-27T17:56:59-05:00
rts: Fix a deadlock with eventlog flush interval and RTS shutdown
The ghc_ticker thread attempts to flush at the eventlog tick interval, this requires
waiting to take all capabilities.
At the same time, the main thread is shutting down, the schedule is
stopped and then we wait for the ticker thread to finish.
Therefore we are deadlocked.
The solution is to use `newBoundTask/exitMyTask`, so that flushing can
cooperate with the scheduler shutdown.
Fixes #26573
- - - - -
1d4a1229 by sheaf at 2025-11-27T17:58:02-05:00
SimpleOpt: don't subst in pushCoercionIntoLambda
It was noticed in #26589 that the change in 15b311be was incorrect:
the simple optimiser carries two different substitution-like pieces of
information: 'soe_subst' (from InVar to OutExpr) and 'soe_inl'
(from InId to InExpr). It is thus incorrect to have 'pushCoercionIntoLambda'
apply the substitution from 'soe_subst' while discarding 'soe_inl'
entirely, which is what was done in 15b311be.
Instead, we change back pushCoercionIntoLambda to take an InScopeSet,
and optimise the lambda before calling 'pushCoercionIntoLambda' to avoid
mixing InExpr with OutExpr, or mixing two InExpr with different
environments. We can then call 'soeZapSubst' without problems.
Fixes #26588 #26589
- - - - -
84a087d5 by Sylvain Henry at 2025-11-28T17:35:28-05:00
Fix PIC jump tables on Windows (#24016)
Avoid overflows in jump tables by using a base label closer to the jump
targets. See added Note [Jump tables]
- - - - -
82db7042 by Zubin Duggal at 2025-11-28T17:36:10-05:00
rts/linker/PEi386: Copy strings before they are inserted into LoadedDllCache. The original strings are temporary and might be freed at an arbitrary point.
Fixes #26613
- - - - -
ff3f0d09 by Ben Gamari at 2025-11-29T18:34:28-05:00
gitlab-ci: Run ghcup-metadata jobs on OpenCape runners
This significantly reduces our egress traffic
and makes the jobs significantly faster.
- - - - -
ef0dc33b by Matthew Pickering at 2025-11-29T18:35:10-05:00
Use 'OsPath' in getModificationTimeIfExists
This part of the compiler is quite hot during recompilation checking in
particular since the filepaths will be translated to a string. It is
better to use the 'OsPath' native function, which turns out to be easy
to do.
- - - - -
fa3bd0a6 by Georgios Karachalias at 2025-11-29T18:36:05-05:00
Use OsPath in PkgDbRef and UnitDatabase, not FilePath
- - - - -
0d7c05ec by Ben Gamari at 2025-12-01T03:13:46-05:00
hadrian: Place user options after package arguments
This makes it easier for the user to override the default package
arguments with `UserSettings.hs`.
Fixes #25821.
-------------------------
Metric Decrease:
T14697
-------------------------
- - - - -
3b2c4598 by Vladislav Zavialov at 2025-12-01T03:14:29-05:00
Namespace-specified wildcards in import/export lists (#25901)
This change adds support for top-level namespace-specified wildcards
`type ..` and `data ..` to import and export lists.
Examples:
import M (type ..) -- imports all type and class constructors from M
import M (data ..) -- imports all data constructors and terms from M
module M (type .., f) where
-- exports all type and class constructors defined in M,
-- plus the function 'f'
The primary intended usage of this feature is in combination with module
aliases, allowing namespace disambiguation:
import Data.Proxy as T (type ..) -- T.Proxy is unambiguously the type constructor
import Data.Proxy as D (data ..) -- D.Proxy is unambiguously the data constructor
The patch accounts for the interactions of wildcards with:
* Imports with `hiding` clauses
* Import warnings -Wunused-imports, -Wdodgy-imports
* Export warnings -Wduplicate-exports, -Wdodgy-exports
Summary of the changes:
1. Move the NamespaceSpecifier type from GHC.Hs.Binds to GHC.Hs.Basic,
making it possible to use it in more places in the AST.
2. Extend the AST (type: IE) with a representation of `..`, `type ..`,
and `data ..` (constructor: IEWholeNamespace). Per the proposal, the
plain `..` is always rejected with a dedicated error message.
3. Extend the grammar in Parser.y with productions for `..`, `type ..`,
and `data ..` in both import and export lists.
4. Implement wildcard imports by updating the `filterImports` function
in GHC.Rename.Names; the logic for IEWholeNamespace is roughly
modeled after the Nothing (no explicit import list) case.
5. Implement wildcard exports by updating the `exports_from_avail`
function in GHC.Tc.Gen.Export; the logic for IEWholeNamespace is
closely modeled after the IEModuleContents case.
6. Refactor and extend diagnostics to report the new warnings and
errors. See PsErrPlainWildcardImport, DodgyImportsWildcard,
PsErrPlainWildcardExport, DodgyExportsWildcard,
TcRnDupeWildcardExport.
Note that this patch is specifically about top-level import/export
items. Subordinate import/export items are left unchanged.
- - - - -
c71faa76 by Luite Stegeman at 2025-12-01T03:16:05-05:00
rts: Handle overflow of ELF section header string table
If the section header string table is stored in a section greater
than or equal to SHN_LORESERVE (0xff00), the 16-bit field e_shstrndx
in the ELF header does not contain the section number, but rather
an overflow value SHN_XINDEX (0xffff) indicating that we need to look
elsewhere.
This fixes the linker by not using e_shstrndx directly but calling
elf_shstrndx, which correctly handles the SHN_XINDEX value.
Fixes #26603
- - - - -
ab20eb54 by Mike Pilgrem at 2025-12-01T22:46:55+00:00
Re CLC issue 292 Warn GHC.Internal.List.{init,last} are partial
Also corrects the warning for `tail` to refer to `Data.List.uncons` (like the existing warning for `head`).
In module `Settings.Warnings`, applies `-Wno-x-partial` to the `filepath`, and `parsec` packages (outside GHC's repository).
Also bumps submodules.
- - - - -
fc1d7f79 by Jade Lovelace at 2025-12-02T11:04:09-05:00
docs: fix StandaloneKindSignatures in DataKinds docs
These should be `type` as otherwise GHC reports a duplicate definition
error.
- - - - -
beae879b by Rodrigo Mesquita at 2025-12-03T15:42:37+01:00
task: Substitute some datatypes for newtypes
* Substitutes some data type declarations for newtype declarations
* Adds comment to `LlvmConfigCache`, which must decidedly not be a
newtype.
Fixes #23555
- - - - -
3bd7dd44 by mangoiv at 2025-12-04T04:36:45-05:00
Renamer: reinstate the template haskell level check in notFound
Out-of-scope names might be caused by a staging error, as is explained by
Note [Out of scope might be a staging error] in GHC.Tc.Utils.Env.hs.
This logic was assumed to be dead code after 217caad1 and has thus been
removed. This commit reintroduces it and thus fixes issue #26099.
- - - - -
0318010b by Zubin Duggal at 2025-12-04T04:37:27-05:00
testlib: Optionally include the way name in the expected output file
This allows us to have different outputs for different ways.
- - - - -
6d945fdd by Zubin Duggal at 2025-12-04T04:37:27-05:00
testsuite: Accept output of tests failing in ext-interp way due to differing compilation requirements
Fixes #26552
- - - - -
0ffc5243 by Cheng Shao at 2025-12-04T04:38:09-05:00
devx: minor fixes for compile_flags.txt
This patch includes minor fixes for compile_flags.txt to improve
developer experience when using clangd as language server to hack on
RTS C sources:
- Ensure `-fPIC` is passed and `__PIC__` is defined, to be coherent
with `-DDYNAMIC` and ensure the `__PIC__` guarded code paths are
indexed
- Add the missing `-DRtsWay` definition, otherwise a few source files
like `RtsUtils.c` and `Trace.c` would produce clangd errors
- - - - -
e36a5fcb by Matthew Pickering at 2025-12-05T16:25:57-05:00
Add support for building bytecode libraries
A bytecode library is a collection of bytecode files (.gbc) and a
library which combines together additional object files.
A bytecode library is created by invoking GHC with the `-bytecodelib`
flag.
A library can be created from in-memory `ModuleByteCode` linkables or
by passing `.gbc` files as arguments on the command line.
Fixes #26298
- - - - -
8f9ae339 by Matthew Pickering at 2025-12-05T16:25:57-05:00
Load bytecode libraries to satisfy package dependencies
This commit allows you to use a bytecode library to satisfy a package
dependency when using the interpreter.
If a user enables `-fprefer-byte-code`, then if a package provides a
bytecode library, that will be loaded and used to satisfy the
dependency.
The main change is to separate the relevant parts of the `LoaderState`
into external and home package byte code. Bytecode is loaded into either
the home package or external part (similar to HPT/EPS split), HPT
bytecode can be unloaded. External bytecode is never unloaded.
The unload function has also only been called with an empty list of
"stable linkables" for a long time. It has been modified to directly
implement a complete unloading of the home package bytecode linkables.
At the moment, the bytecode libraries are found in the "library-dirs"
field from the package description. In the future when `Cabal`
implements support for "bytecode-library-dirs" field, we can read the
bytecode libraries from there. No changes to the Cabal submodule are
necessary at the moment.
Four new tests are added in testsuite/tests/cabal, which generate fake
package descriptions and test loading the libraries into GHCi.
Fixes #26298
- - - - -
54458ce4 by mangoiv at 2025-12-05T16:26:50-05:00
ExplicitLevelImports: improve documentation of the code
- more explicit names for variable names like `flg` or `topLevel`
- don't pass the same value twice to functions
- some explanations of interesting but undocumented code paths
- adjust comment to not mention non-existent error message
- - - - -
c7061392 by mangoiv at 2025-12-05T16:27:42-05:00
driver: don't expect nodes to exist when checking paths between them
In `mgQueryZero`, previously node lookups were expected to never fail,
i.e. it was expected that when calculating the path between two nodes in
a zero level import graph, both nodes would always exist. This is not
the case, e.g. in some situations involving exact names (see the
test-case). The fix is to first check whether the node is present in the
graph at all, instead of panicking, just to report that there is no
path.
Closes #26568
- - - - -
d6cf8463 by Peng Fan at 2025-12-06T11:06:28-05:00
NCG/LA64: Simplify genCCall into two parts
genCCall is too long, so it's been simplified into two parts:
genPrim and genLibCCall.
Suggested by Andreas Klebinger
- - - - -
9d371d23 by Matthew Pickering at 2025-12-06T11:07:09-05:00
hadrian: Use a response file to invoke GHC for dep gathering.
In some cases we construct an argument list too long for GHC to
handle directly on windows. This happens when we generate
the dependency file because the command line will contain
references to a large number of .hs files.
To avoid this we now invoke GHC using a response file when
generating dependencies to sidestep length limitations.
Note that we only pass the actual file names in the dependency
file. Why? Because this side-steps #26560
- - - - -
0043bfb0 by Marc Scholten at 2025-12-06T11:08:03-05:00
update xhtml to 3000.4.0.0
haddock-api: bump xhtml bounds
haddock-api: use lazy text instead of string to support xhtml 3000.4.0.0
Bumping submodule xhtml to 3000.4.0.0
add xhtml to stage0Packages
remove unused import of writeUtf8File
Remove redundant import
Update haddock golden files for xhtml 3000.4.0.0
Metric Decrease:
haddock.Cabal
haddock.base
- - - - -
fc958fc9 by Julian Ospald at 2025-12-06T11:08:53-05:00
rts: Fix object file format detection in loadArchive
Commit 76d1041dfa4b96108cfdd22b07f2b3feb424dcbe seems to
have introduced this bug, ultimately leading to failure of
test T11788. I can only theorize that this test isn't run
in upstream's CI, because they don't build a static GHC.
The culprit is that we go through the thin archive, trying
to follow the members on the filesystem, but don't
re-identify the new object format of the member. This pins
`object_fmt` to `NotObject` from the thin archive.
Thanks to @angerman for spotting this.
- - - - -
0f297f6e by mangoiv at 2025-12-06T11:09:44-05:00
users' guide: don't use f strings in the python script to ensure compatibility with python 3.5
- - - - -
3bfe7aa2 by Matthew Pickering at 2025-12-07T12:18:57-05:00
ci: Try using multi repl in ghc-in-ghci test
This should be quite a bit faster than the ./hadrian/ghci command as it
doesn't properly build all the dependencies.
- - - - -
2ef1601a by Rodrigo Mesquita at 2025-12-07T12:19:38-05:00
Stack.Decode: Don't error on bitmap size 0
A RET_BCO may have a bitmap with no payload.
In that case, the bitmap = 0.
One can observe this by using -ddump-bcos and interpreting
```
main = pure ()
```
Observe, for instance, that the BCO for this main function has size 0:
```
ProtoBCO Main.main#0:
\u []
break<main:Main,0>() GHC.Internal.Base.pure
GHC.Internal.Base.$fApplicativeIO GHC.Internal.Tuple.()
bitmap: 0 []
BRK_FUN <breakarray> main:Main 0 <cc>
PACK () 0
PUSH_G GHC.Internal.Base.$fApplicativeIO
PUSH_APPLY_PP
PUSH_G GHC.Internal.Base.pure
ENTER
```
Perhaps we never tried to decode a stack in which a BCO like this was
present. However, for the debugger, we want to decode stacks of threads
stopped at breakpoints, and these kind of BCOs do get on a stack under
e.g. `stg_apply_interp_info` frames.
See the accompanying test in the next commit for an example to trigger
the bug this commit fixes.
Fixes #26640
- - - - -
747153d2 by Rodrigo Mesquita at 2025-12-07T12:19:38-05:00
Add test for #26640
- - - - -
10201a1c by Peter Trommler at 2025-12-09T17:08:28+01:00
Use half-word literals in info tables
- - - - -
8c47386b by Peter Trommler at 2025-12-09T17:08:28+01:00
Fix fun_type, arity when tables next to code
With tables next to code extra_bits are reversed but
fun_type and arity were packed into one Word and are now
two separate HalfWords.
- - - - -
9eb60442 by Peter Trommler at 2025-12-09T17:08:28+01:00
Remove dead code
- - - - -
4e30456d by Peter Trommler at 2025-12-09T17:08:29+01:00
Clean uo.
- - - - -
259 changed files:
- .gitlab-ci.yml
- compile_flags.txt
- compiler/GHC/ByteCode/Linker.hs
- compiler/GHC/ByteCode/Serialize.hs
- compiler/GHC/Cmm/Info.hs
- compiler/GHC/Cmm/Utils.hs
- compiler/GHC/CmmToAsm/AArch64/RegInfo.hs
- compiler/GHC/CmmToAsm/LA64/CodeGen.hs
- compiler/GHC/CmmToAsm/PPC/RegInfo.hs
- compiler/GHC/CmmToAsm/X86/CodeGen.hs
- compiler/GHC/CmmToAsm/X86/Instr.hs
- compiler/GHC/CmmToAsm/X86/Ppr.hs
- compiler/GHC/Core/Make.hs
- compiler/GHC/Core/Map/Type.hs
- compiler/GHC/Core/Opt/Arity.hs
- compiler/GHC/Core/Opt/OccurAnal.hs
- compiler/GHC/Core/SimpleOpt.hs
- compiler/GHC/Core/Utils.hs
- compiler/GHC/Data/OsPath.hs
- compiler/GHC/Driver/Backpack.hs
- compiler/GHC/Driver/CodeOutput.hs
- compiler/GHC/Driver/Downsweep.hs
- compiler/GHC/Driver/DynFlags.hs
- compiler/GHC/Driver/Errors/Ppr.hs
- compiler/GHC/Driver/Errors/Types.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/LlvmConfigCache.hs
- compiler/GHC/Driver/Main.hs
- compiler/GHC/Driver/Make.hs
- compiler/GHC/Driver/Phases.hs
- compiler/GHC/Driver/Pipeline.hs
- compiler/GHC/Driver/Pipeline/Execute.hs
- compiler/GHC/Driver/Pipeline/Phases.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Driver/Session/Units.hs
- compiler/GHC/Hs/Basic.hs
- compiler/GHC/Hs/Binds.hs
- compiler/GHC/Hs/ImpExp.hs
- compiler/GHC/Hs/Instances.hs
- compiler/GHC/HsToCore/Binds.hs
- compiler/GHC/HsToCore/Docs.hs
- compiler/GHC/HsToCore/Expr.hs
- compiler/GHC/HsToCore/Match.hs
- compiler/GHC/Iface/Ext/Ast.hs
- + compiler/GHC/Linker/ByteCode.hs
- compiler/GHC/Linker/Loader.hs
- compiler/GHC/Linker/Types.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Errors/Ppr.hs
- compiler/GHC/Parser/Errors/Types.hs
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Prelude/Basic.hs
- compiler/GHC/Rename/Names.hs
- compiler/GHC/Rename/Splice.hs
- compiler/GHC/Runtime/Debugger.hs
- compiler/GHC/Runtime/Eval.hs
- compiler/GHC/Settings.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/App.hs
- compiler/GHC/Tc/Gen/Export.hs
- compiler/GHC/Tc/Solver/Monad.hs
- compiler/GHC/Tc/Utils/Env.hs
- compiler/GHC/Types/Basic.hs
- compiler/GHC/Types/Error/Codes.hs
- compiler/GHC/Types/Hint.hs
- compiler/GHC/Types/Hint/Ppr.hs
- compiler/GHC/Types/Unique/FM.hs
- compiler/GHC/Types/Unique/Set.hs
- compiler/GHC/Types/Var/Env.hs
- compiler/GHC/Unit/Finder.hs
- compiler/GHC/Unit/Home/PackageTable.hs
- compiler/GHC/Unit/Info.hs
- compiler/GHC/Unit/Module/Graph.hs
- compiler/GHC/Unit/State.hs
- compiler/GHC/Utils/Misc.hs
- compiler/GHC/Utils/Outputable.hs
- compiler/Language/Haskell/Syntax/Extension.hs
- compiler/Language/Haskell/Syntax/ImpExp.hs
- compiler/ghc.cabal.in
- docs/users_guide/9.16.1-notes.rst
- docs/users_guide/conf.py
- docs/users_guide/exts/data_kinds.rst
- docs/users_guide/exts/explicit_namespaces.rst
- docs/users_guide/exts/rank_polymorphism.rst
- docs/users_guide/exts/type_families.rst
- docs/users_guide/phases.rst
- docs/users_guide/using-optimisation.rst
- ghc/GHCi/UI.hs
- ghc/Main.hs
- hadrian/src/Builder.hs
- hadrian/src/Rules/ToolArgs.hs
- hadrian/src/Settings.hs
- hadrian/src/Settings/Builders/Ghc.hs
- hadrian/src/Settings/Default.hs
- hadrian/src/Settings/Warnings.hs
- libraries/base/changelog.md
- libraries/ghc-boot-th/GHC/Boot/TH/Ppr.hs
- libraries/ghc-boot/GHC/Unit/Database.hs
- libraries/ghc-internal/src/GHC/Internal/Float.hs
- libraries/ghc-internal/src/GHC/Internal/List.hs
- libraries/ghc-internal/src/GHC/Internal/Stack/Decode.hs
- libraries/ghc-internal/src/GHC/Internal/System/IO.hs
- libraries/ghc-internal/src/GHC/Internal/TH/Syntax.hs
- libraries/template-haskell/vendored-filepath/System/FilePath/Posix.hs
- libraries/template-haskell/vendored-filepath/System/FilePath/Windows.hs
- libraries/xhtml
- rts/eventlog/EventLog.c
- rts/linker/Elf.c
- rts/linker/LoadArchive.c
- rts/linker/PEi386.c
- testsuite/config/ghc
- testsuite/driver/testlib.py
- testsuite/mk/boilerplate.mk
- + testsuite/tests/bytecode/T26640.hs
- + testsuite/tests/bytecode/T26640.script
- + testsuite/tests/bytecode/T26640.stdout
- testsuite/tests/bytecode/all.T
- + testsuite/tests/cabal/Bytecode.hs
- + testsuite/tests/cabal/BytecodeForeign.c
- + testsuite/tests/cabal/BytecodeForeign.hs
- testsuite/tests/cabal/Makefile
- testsuite/tests/cabal/all.T
- + testsuite/tests/cabal/bytecode.pkg
- + testsuite/tests/cabal/bytecode.script
- + testsuite/tests/cabal/bytecode_foreign.pkg
- + testsuite/tests/cabal/bytecode_foreign.script
- testsuite/tests/cabal/ghcpkg03.stderr
- testsuite/tests/cabal/ghcpkg03.stderr-mingw32
- testsuite/tests/cabal/ghcpkg05.stderr
- testsuite/tests/cabal/ghcpkg05.stderr-mingw32
- + testsuite/tests/cabal/pkg_bytecode.stderr
- + testsuite/tests/cabal/pkg_bytecode.stdout
- + testsuite/tests/cabal/pkg_bytecode_foreign.stderr
- + testsuite/tests/cabal/pkg_bytecode_foreign.stdout
- + testsuite/tests/cabal/pkg_bytecode_with_gbc.stderr
- + testsuite/tests/cabal/pkg_bytecode_with_gbc.stdout
- + testsuite/tests/cabal/pkg_bytecode_with_o.stderr
- + testsuite/tests/cabal/pkg_bytecode_with_o.stdout
- + testsuite/tests/codeGen/should_run/T24016.hs
- + testsuite/tests/codeGen/should_run/T24016.stdout
- testsuite/tests/codeGen/should_run/all.T
- + testsuite/tests/driver/T20696/T20696.stderr-ext-interp
- testsuite/tests/driver/T20696/all.T
- testsuite/tests/driver/bytecode-object/Makefile
- testsuite/tests/driver/bytecode-object/all.T
- testsuite/tests/driver/bytecode-object/bytecode_object19.stdout
- + testsuite/tests/driver/bytecode-object/bytecode_object20.stdout
- + testsuite/tests/driver/bytecode-object/bytecode_object21.stderr
- + testsuite/tests/driver/bytecode-object/bytecode_object21.stdout
- + testsuite/tests/driver/bytecode-object/bytecode_object23.stdout
- + testsuite/tests/driver/bytecode-object/bytecode_object24.stdout
- testsuite/tests/driver/fat-iface/all.T
- + testsuite/tests/driver/fat-iface/fat012.stderr-ext-interp
- + testsuite/tests/driver/fat-iface/fat015.stderr-ext-interp
- testsuite/tests/driver/j-space/jspace.hs
- + testsuite/tests/module/T25901_exp_plain_wc.hs
- + testsuite/tests/module/T25901_exp_plain_wc.stderr
- + testsuite/tests/module/T25901_imp_plain_wc.hs
- + testsuite/tests/module/T25901_imp_plain_wc.stderr
- testsuite/tests/module/all.T
- + testsuite/tests/rename/should_compile/T25901_exp_1.hs
- + testsuite/tests/rename/should_compile/T25901_exp_1_helper.hs
- + testsuite/tests/rename/should_compile/T25901_exp_2.hs
- + testsuite/tests/rename/should_compile/T25901_exp_2_helper.hs
- + testsuite/tests/rename/should_compile/T25901_imp_hq.hs
- + testsuite/tests/rename/should_compile/T25901_imp_hu.hs
- + testsuite/tests/rename/should_compile/T25901_imp_sq.hs
- + testsuite/tests/rename/should_compile/T25901_imp_su.hs
- testsuite/tests/rename/should_compile/all.T
- + testsuite/tests/rename/should_fail/T25901_exp_fail_1.hs
- + testsuite/tests/rename/should_fail/T25901_exp_fail_1.stderr
- + testsuite/tests/rename/should_fail/T25901_exp_fail_1_helper.hs
- + testsuite/tests/rename/should_fail/T25901_exp_fail_2.hs
- + testsuite/tests/rename/should_fail/T25901_exp_fail_2.stderr
- + testsuite/tests/rename/should_fail/T25901_exp_fail_2_helper.hs
- + testsuite/tests/rename/should_fail/T25901_imp_hq_fail_5.hs
- + testsuite/tests/rename/should_fail/T25901_imp_hq_fail_5.stderr
- + testsuite/tests/rename/should_fail/T25901_imp_hq_fail_6.hs
- + testsuite/tests/rename/should_fail/T25901_imp_hq_fail_6.stderr
- + testsuite/tests/rename/should_fail/T25901_imp_hu_fail_4.hs
- + testsuite/tests/rename/should_fail/T25901_imp_hu_fail_4.stderr
- + testsuite/tests/rename/should_fail/T25901_imp_sq_fail_2.hs
- + testsuite/tests/rename/should_fail/T25901_imp_sq_fail_2.stderr
- + testsuite/tests/rename/should_fail/T25901_imp_sq_fail_3.hs
- + testsuite/tests/rename/should_fail/T25901_imp_sq_fail_3.stderr
- + testsuite/tests/rename/should_fail/T25901_imp_su_fail_1.hs
- + testsuite/tests/rename/should_fail/T25901_imp_su_fail_1.stderr
- testsuite/tests/rename/should_fail/all.T
- testsuite/tests/rts/KeepCafsBase.hs
- testsuite/tests/rts/all.T
- + testsuite/tests/simplCore/should_compile/T26588.hs
- + testsuite/tests/simplCore/should_compile/T26589.hs
- testsuite/tests/simplCore/should_compile/T8331.stderr
- testsuite/tests/simplCore/should_compile/all.T
- + testsuite/tests/splice-imports/SI07.stderr-ext-interp
- testsuite/tests/splice-imports/all.T
- + testsuite/tests/th/T26099.hs
- + testsuite/tests/th/T26099.stderr
- + testsuite/tests/th/T26568.hs
- + testsuite/tests/th/T26568.stderr
- testsuite/tests/th/all.T
- testsuite/tests/unboxedsums/UbxSumUnpackedSize.hs
- + testsuite/tests/warnings/should_compile/T25901_exp_dodgy.hs
- + testsuite/tests/warnings/should_compile/T25901_exp_dodgy.stderr
- + testsuite/tests/warnings/should_compile/T25901_exp_dup_wc_1.hs
- + testsuite/tests/warnings/should_compile/T25901_exp_dup_wc_1.stderr
- + testsuite/tests/warnings/should_compile/T25901_exp_dup_wc_2.hs
- + testsuite/tests/warnings/should_compile/T25901_exp_dup_wc_2.stderr
- + testsuite/tests/warnings/should_compile/T25901_exp_dup_wc_3.hs
- + testsuite/tests/warnings/should_compile/T25901_exp_dup_wc_3.stderr
- + testsuite/tests/warnings/should_compile/T25901_exp_dup_wc_4.hs
- + testsuite/tests/warnings/should_compile/T25901_exp_dup_wc_4.stderr
- + testsuite/tests/warnings/should_compile/T25901_helper_1.hs
- + testsuite/tests/warnings/should_compile/T25901_helper_2.hs
- + testsuite/tests/warnings/should_compile/T25901_helper_3.hs
- + testsuite/tests/warnings/should_compile/T25901_imp_dodgy_1.hs
- + testsuite/tests/warnings/should_compile/T25901_imp_dodgy_1.stderr
- + testsuite/tests/warnings/should_compile/T25901_imp_dodgy_2.hs
- + testsuite/tests/warnings/should_compile/T25901_imp_dodgy_2.stderr
- + testsuite/tests/warnings/should_compile/T25901_imp_unused_1.hs
- + testsuite/tests/warnings/should_compile/T25901_imp_unused_1.stderr
- + testsuite/tests/warnings/should_compile/T25901_imp_unused_2.hs
- + testsuite/tests/warnings/should_compile/T25901_imp_unused_2.stderr
- + testsuite/tests/warnings/should_compile/T25901_imp_unused_3.hs
- + testsuite/tests/warnings/should_compile/T25901_imp_unused_3.stderr
- + testsuite/tests/warnings/should_compile/T25901_imp_unused_4.hs
- + testsuite/tests/warnings/should_compile/T25901_imp_unused_4.stderr
- testsuite/tests/warnings/should_compile/all.T
- utils/check-exact/ExactPrint.hs
- utils/check-exact/Main.hs
- utils/check-exact/Transform.hs
- utils/check-exact/Utils.hs
- utils/ghc-pkg/Main.hs
- utils/ghc-toolchain/src/GHC/Toolchain/Utils.hs
- utils/haddock/cabal.project
- utils/haddock/haddock-api/haddock-api.cabal
- utils/haddock/haddock-api/src/Haddock/Backends/Hoogle.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Names.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Themes.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Utils.hs
- utils/haddock/haddock-api/src/Haddock/Doc.hs
- utils/haddock/haddock-api/src/Haddock/Utils.hs
- utils/haddock/haddock-library/src/Documentation/Haddock/Parser.hs
- utils/haddock/html-test/ref/Bug26.html
- utils/haddock/html-test/ref/Bug298.html
- utils/haddock/html-test/ref/Bug458.html
- utils/haddock/html-test/ref/Nesting.html
- utils/haddock/html-test/ref/TitledPicture.html
- utils/haddock/html-test/ref/Unicode.html
- utils/haddock/html-test/ref/Unicode2.html
- utils/hpc
- utils/hsc2hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/436ea6ac9052b9ada9027227e004ad…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/436ea6ac9052b9ada9027227e004ad…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/26626] 13 commits: Add support for building bytecode libraries
by recursion-ninja (@recursion-ninja) 09 Dec '25
by recursion-ninja (@recursion-ninja) 09 Dec '25
09 Dec '25
recursion-ninja pushed to branch wip/26626 at Glasgow Haskell Compiler / GHC
Commits:
e36a5fcb by Matthew Pickering at 2025-12-05T16:25:57-05:00
Add support for building bytecode libraries
A bytecode library is a collection of bytecode files (.gbc) and a
library which combines together additional object files.
A bytecode library is created by invoking GHC with the `-bytecodelib`
flag.
A library can be created from in-memory `ModuleByteCode` linkables or
by passing `.gbc` files as arguments on the command line.
Fixes #26298
- - - - -
8f9ae339 by Matthew Pickering at 2025-12-05T16:25:57-05:00
Load bytecode libraries to satisfy package dependencies
This commit allows you to use a bytecode library to satisfy a package
dependency when using the interpreter.
If a user enables `-fprefer-byte-code`, then if a package provides a
bytecode library, that will be loaded and used to satisfy the
dependency.
The main change is to separate the relevant parts of the `LoaderState`
into external and home package byte code. Bytecode is loaded into either
the home package or external part (similar to HPT/EPS split), HPT
bytecode can be unloaded. External bytecode is never unloaded.
The unload function has also only been called with an empty list of
"stable linkables" for a long time. It has been modified to directly
implement a complete unloading of the home package bytecode linkables.
At the moment, the bytecode libraries are found in the "library-dirs"
field from the package description. In the future when `Cabal`
implements support for "bytecode-library-dirs" field, we can read the
bytecode libraries from there. No changes to the Cabal submodule are
necessary at the moment.
Four new tests are added in testsuite/tests/cabal, which generate fake
package descriptions and test loading the libraries into GHCi.
Fixes #26298
- - - - -
54458ce4 by mangoiv at 2025-12-05T16:26:50-05:00
ExplicitLevelImports: improve documentation of the code
- more explicit names for variable names like `flg` or `topLevel`
- don't pass the same value twice to functions
- some explanations of interesting but undocumented code paths
- adjust comment to not mention non-existent error message
- - - - -
c7061392 by mangoiv at 2025-12-05T16:27:42-05:00
driver: don't expect nodes to exist when checking paths between them
In `mgQueryZero`, previously node lookups were expected to never fail,
i.e. it was expected that when calculating the path between two nodes in
a zero level import graph, both nodes would always exist. This is not
the case, e.g. in some situations involving exact names (see the
test-case). The fix is to first check whether the node is present in the
graph at all, instead of panicking, just to report that there is no
path.
Closes #26568
- - - - -
d6cf8463 by Peng Fan at 2025-12-06T11:06:28-05:00
NCG/LA64: Simplify genCCall into two parts
genCCall is too long, so it's been simplified into two parts:
genPrim and genLibCCall.
Suggested by Andreas Klebinger
- - - - -
9d371d23 by Matthew Pickering at 2025-12-06T11:07:09-05:00
hadrian: Use a response file to invoke GHC for dep gathering.
In some cases we construct an argument list too long for GHC to
handle directly on windows. This happens when we generate
the dependency file because the command line will contain
references to a large number of .hs files.
To avoid this we now invoke GHC using a response file when
generating dependencies to sidestep length limitations.
Note that we only pass the actual file names in the dependency
file. Why? Because this side-steps #26560
- - - - -
0043bfb0 by Marc Scholten at 2025-12-06T11:08:03-05:00
update xhtml to 3000.4.0.0
haddock-api: bump xhtml bounds
haddock-api: use lazy text instead of string to support xhtml 3000.4.0.0
Bumping submodule xhtml to 3000.4.0.0
add xhtml to stage0Packages
remove unused import of writeUtf8File
Remove redundant import
Update haddock golden files for xhtml 3000.4.0.0
Metric Decrease:
haddock.Cabal
haddock.base
- - - - -
fc958fc9 by Julian Ospald at 2025-12-06T11:08:53-05:00
rts: Fix object file format detection in loadArchive
Commit 76d1041dfa4b96108cfdd22b07f2b3feb424dcbe seems to
have introduced this bug, ultimately leading to failure of
test T11788. I can only theorize that this test isn't run
in upstream's CI, because they don't build a static GHC.
The culprit is that we go through the thin archive, trying
to follow the members on the filesystem, but don't
re-identify the new object format of the member. This pins
`object_fmt` to `NotObject` from the thin archive.
Thanks to @angerman for spotting this.
- - - - -
0f297f6e by mangoiv at 2025-12-06T11:09:44-05:00
users' guide: don't use f strings in the python script to ensure compatibility with python 3.5
- - - - -
3bfe7aa2 by Matthew Pickering at 2025-12-07T12:18:57-05:00
ci: Try using multi repl in ghc-in-ghci test
This should be quite a bit faster than the ./hadrian/ghci command as it
doesn't properly build all the dependencies.
- - - - -
2ef1601a by Rodrigo Mesquita at 2025-12-07T12:19:38-05:00
Stack.Decode: Don't error on bitmap size 0
A RET_BCO may have a bitmap with no payload.
In that case, the bitmap = 0.
One can observe this by using -ddump-bcos and interpreting
```
main = pure ()
```
Observe, for instance, that the BCO for this main function has size 0:
```
ProtoBCO Main.main#0:
\u []
break<main:Main,0>() GHC.Internal.Base.pure
GHC.Internal.Base.$fApplicativeIO GHC.Internal.Tuple.()
bitmap: 0 []
BRK_FUN <breakarray> main:Main 0 <cc>
PACK () 0
PUSH_G GHC.Internal.Base.$fApplicativeIO
PUSH_APPLY_PP
PUSH_G GHC.Internal.Base.pure
ENTER
```
Perhaps we never tried to decode a stack in which a BCO like this was
present. However, for the debugger, we want to decode stacks of threads
stopped at breakpoints, and these kind of BCOs do get on a stack under
e.g. `stg_apply_interp_info` frames.
See the accompanying test in the next commit for an example to trigger
the bug this commit fixes.
Fixes #26640
- - - - -
747153d2 by Rodrigo Mesquita at 2025-12-07T12:19:38-05:00
Add test for #26640
- - - - -
48923c66 by Recursion Ninja at 2025-12-09T10:34:56-05:00
Decouple 'Language.Haskell.Syntax.Type' from 'GHC.Utils.Panic'
- Remove the *original* defintion of 'hsQTvExplicit' defined within 'Language.Haskell.Syntax.Type'
- Redefine 'hsQTvExplicit' as 'hsq_explicit' specialized to 'GhcPass' exported by 'GHC.Utils.Panic'
- Define 'hsQTvExplicitBinders' as 'hsq_explicit' specialized to 'DocNameI' exported by 'Haddock.GhcUtils'.
- Replace all call sites of the original 'hsQTvExplicit' definition with either:
1. 'hsQTvExplicit' updated definition
2. 'hsQTvExplicitBinders'
All call sites never entered the 'XLHsQTyVars' constructor branch, but a call to 'panic' existed on this code path because the type system was not strong enought to guarantee that the 'XLHsQTyVars' construction was impossible.
These two specialized functions provide the type system with enough information to make that guarantee, and hence the dependancy on 'panic' can be removed.
- - - - -
101 changed files:
- .gitlab-ci.yml
- compiler/GHC/ByteCode/Linker.hs
- compiler/GHC/ByteCode/Serialize.hs
- compiler/GHC/CmmToAsm/LA64/CodeGen.hs
- compiler/GHC/Driver/Backpack.hs
- compiler/GHC/Driver/Downsweep.hs
- compiler/GHC/Driver/DynFlags.hs
- compiler/GHC/Driver/Errors/Ppr.hs
- compiler/GHC/Driver/Errors/Types.hs
- compiler/GHC/Driver/Make.hs
- compiler/GHC/Driver/Phases.hs
- compiler/GHC/Driver/Pipeline.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Hs/Type.hs
- + compiler/GHC/Linker/ByteCode.hs
- compiler/GHC/Linker/Loader.hs
- compiler/GHC/Linker/Types.hs
- compiler/GHC/Rename/Splice.hs
- compiler/GHC/Runtime/Debugger.hs
- compiler/GHC/Runtime/Eval.hs
- compiler/GHC/Settings.hs
- compiler/GHC/Tc/Solver/Monad.hs
- compiler/GHC/Types/Error/Codes.hs
- compiler/GHC/Unit/Home/PackageTable.hs
- compiler/GHC/Unit/Info.hs
- compiler/GHC/Unit/Module/Graph.hs
- compiler/GHC/Unit/State.hs
- compiler/Language/Haskell/Syntax/Type.hs
- compiler/ghc.cabal.in
- docs/users_guide/conf.py
- docs/users_guide/phases.rst
- hadrian/src/Builder.hs
- hadrian/src/Rules/ToolArgs.hs
- hadrian/src/Settings/Builders/Ghc.hs
- hadrian/src/Settings/Default.hs
- libraries/ghc-boot/GHC/Unit/Database.hs
- libraries/ghc-internal/src/GHC/Internal/Stack/Decode.hs
- libraries/xhtml
- rts/linker/LoadArchive.c
- testsuite/config/ghc
- testsuite/mk/boilerplate.mk
- + testsuite/tests/bytecode/T26640.hs
- + testsuite/tests/bytecode/T26640.script
- + testsuite/tests/bytecode/T26640.stdout
- testsuite/tests/bytecode/all.T
- + testsuite/tests/cabal/Bytecode.hs
- + testsuite/tests/cabal/BytecodeForeign.c
- + testsuite/tests/cabal/BytecodeForeign.hs
- testsuite/tests/cabal/Makefile
- testsuite/tests/cabal/all.T
- + testsuite/tests/cabal/bytecode.pkg
- + testsuite/tests/cabal/bytecode.script
- + testsuite/tests/cabal/bytecode_foreign.pkg
- + testsuite/tests/cabal/bytecode_foreign.script
- testsuite/tests/cabal/ghcpkg03.stderr
- testsuite/tests/cabal/ghcpkg03.stderr-mingw32
- testsuite/tests/cabal/ghcpkg05.stderr
- testsuite/tests/cabal/ghcpkg05.stderr-mingw32
- + testsuite/tests/cabal/pkg_bytecode.stderr
- + testsuite/tests/cabal/pkg_bytecode.stdout
- + testsuite/tests/cabal/pkg_bytecode_foreign.stderr
- + testsuite/tests/cabal/pkg_bytecode_foreign.stdout
- + testsuite/tests/cabal/pkg_bytecode_with_gbc.stderr
- + testsuite/tests/cabal/pkg_bytecode_with_gbc.stdout
- + testsuite/tests/cabal/pkg_bytecode_with_o.stderr
- + testsuite/tests/cabal/pkg_bytecode_with_o.stdout
- testsuite/tests/driver/bytecode-object/Makefile
- testsuite/tests/driver/bytecode-object/all.T
- testsuite/tests/driver/bytecode-object/bytecode_object19.stdout
- + testsuite/tests/driver/bytecode-object/bytecode_object20.stdout
- + testsuite/tests/driver/bytecode-object/bytecode_object21.stderr
- + testsuite/tests/driver/bytecode-object/bytecode_object21.stdout
- + testsuite/tests/driver/bytecode-object/bytecode_object23.stdout
- + testsuite/tests/driver/bytecode-object/bytecode_object24.stdout
- + testsuite/tests/th/T26568.hs
- + testsuite/tests/th/T26568.stderr
- testsuite/tests/th/all.T
- utils/ghc-pkg/Main.hs
- utils/haddock/cabal.project
- utils/haddock/haddock-api/haddock-api.cabal
- utils/haddock/haddock-api/src/Haddock/Backends/Hoogle.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs
- utils/haddock/haddock-api/src/Haddock/Backends/LaTeX.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Names.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Themes.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Utils.hs
- utils/haddock/haddock-api/src/Haddock/Doc.hs
- utils/haddock/haddock-api/src/Haddock/GhcUtils.hs
- utils/haddock/haddock-api/src/Haddock/Utils.hs
- utils/haddock/html-test/ref/Bug26.html
- utils/haddock/html-test/ref/Bug298.html
- utils/haddock/html-test/ref/Bug458.html
- utils/haddock/html-test/ref/Nesting.html
- utils/haddock/html-test/ref/TitledPicture.html
- utils/haddock/html-test/ref/Unicode.html
- utils/haddock/html-test/ref/Unicode2.html
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7434d76a8558ef928eb6dbab73f80b…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7434d76a8558ef928eb6dbab73f80b…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/fix-26636] Reorganizing 'Warning' record extensibility
by recursion-ninja (@recursion-ninja) 09 Dec '25
by recursion-ninja (@recursion-ninja) 09 Dec '25
09 Dec '25
recursion-ninja pushed to branch wip/fix-26636 at Glasgow Haskell Compiler / GHC
Commits:
e8d13551 by Recursion Ninja at 2025-12-09T10:28:09-05:00
Reorganizing 'Warning' record extensibility
- - - - -
5 changed files:
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Types/Error/Codes.hs
- compiler/GHC/Unit/Module/Warnings.hs
- compiler/Language/Haskell/Syntax/Decls.hs
- compiler/Language/Haskell/Syntax/Extension.hs
Changes:
=====================================
compiler/GHC/Rename/Module.hs
=====================================
@@ -321,11 +321,13 @@ rnSrcWarnDecls bndr_set decls'
rnWarningTxt :: WarningTxt GhcPs -> RnM (WarningTxt GhcRn)
rnWarningTxt (WarningTxt mb_cat st wst) = do
- forM_ mb_cat $ \(L _ (InWarningCategory _ _ (L loc cat))) ->
- unless (validWarningCategory cat) $
- addErrAt (locA loc) (TcRnInvalidWarningCategory cat)
+ mb_cat' <- forM mb_cat $ \(L x (InWarningCategory y z wCat@(L loc cat))) -> do
+ unless (validWarningCategory cat) $
+ addErrAt (locA loc) (TcRnInvalidWarningCategory cat)
+ wCat' <- traverse rnHsDoc wCat
+ pure (L x (InWarningCategory y z wCat'))
wst' <- traverse (traverse rnHsDoc) wst
- pure (WarningTxt (mb_cat :: _) st wst')
+ pure (WarningTxt mb_cat' st wst')
-- pure (WarningTxt mb_cat st wst')
rnWarningTxt (DeprecatedTxt st wst) = do
wst' <- traverse (traverse rnHsDoc) wst
=====================================
compiler/GHC/Types/Error/Codes.hs
=====================================
@@ -767,6 +767,7 @@ type family GhcDiagnosticCode c = n | n -> c where
-- TcRnPragmaWarning
GhcDiagnosticCode "WarningTxt" = 63394
GhcDiagnosticCode "DeprecatedTxt" = 68441
+ GhcDiagnosticCode "XWarningTxt" = 68077
-- TcRnRunSliceFailure/ConversionFail
GhcDiagnosticCode "IllegalOccName" = 55017
=====================================
compiler/GHC/Unit/Module/Warnings.hs
=====================================
@@ -130,7 +130,7 @@ data InWarningCategory
fromWarningCategory ::
(HasAnnotation (Anno (WarningCategory (GhcPass p))))
=> WarningCategory (GhcPass p) -> InWarningCategory (GhcPass p)
-fromWarningCategory wc = InWarningCategory noAnn NoSourceText (noLocA wc)
+fromWarningCategory wc = InWarningCategory (noAnn, NoSourceText) (noLocA wc)
{-
-- See Note [Warning categories]
@@ -142,10 +142,10 @@ mkWarningCategory :: FastString -> WarningCategory
mkWarningCategory = WarningCategory
-}
-type instance XWarningTxt (GhcPass _) = SourceText
type instance XDeprecatedTxt (GhcPass _) = SourceText
-type instance XInWarningCategory (GhcPass _) = SourceText
-type instance XInWarningCategoryIn (GhcPass _) = (EpToken "in")
+type instance XWarningTxt (GhcPass _) = SourceText
+type instance XXWarningTxt (GhcPass _) = DataConCantHappen
+type instance XInWarningCategory (GhcPass _) = (EpToken "in", SourceText)
type instance XWarningCategory (GhcPass _) = FastString
type instance Anno (WithHsDocIdentifiers StringLiteral pass) = EpaLocation
@@ -232,7 +232,7 @@ data WarningTxt pass
-- | To which warning category does this WARNING or DEPRECATED pragma belong?
-- See Note [Warning categories].
warningTxtCategory :: WarningTxt (GhcPass p) -> WarningCategory (GhcPass p)
-warningTxtCategory (WarningTxt (Just (L _ (InWarningCategory _ _ (L _ cat)))) _ _) = cat
+warningTxtCategory (WarningTxt (Just (L _ (InWarningCategory _ (L _ cat)))) _ _) = cat
warningTxtCategory _ = defaultWarningCategory
@@ -255,7 +255,7 @@ warningTxtSame w1 w2
| otherwise = False
instance Outputable (XRec p (WarningCategory p)) => Outputable (InWarningCategory p) where
- ppr (InWarningCategory _ _ wt) = text "in" <+> doubleQuotes (ppr wt)
+ ppr (InWarningCategory _ wt) = text "in" <+> doubleQuotes (ppr wt)
deriving instance (
Binary (XWarningCategory p)
=====================================
compiler/Language/Haskell/Syntax/Decls.hs
=====================================
@@ -93,10 +93,10 @@ module Language.Haskell.Syntax.Decls (
mkWarningCategory,
InWarningCategory(..),
-- ** Extension
- XWarningTxt,
XDeprecatedTxt,
+ XWarningTxt,
+ XXWarningTxt,
XInWarningCategory,
- XInWarningCategoryIn,
XWarningCategory
) where
@@ -115,6 +115,7 @@ import GHC.Types.Basic (TopLevelFlag, OverlapMode, RuleName, Activation
,TyConFlavour(..), TypeOrData(..), NewOrData(..))
import GHC.Types.ForeignCall (CType, CCallConv, Safety, Header, CLabelString, CCallTarget, CExportSpec)
+import GHC.Data.FastString (FastString)
import GHC.Hs.Doc (LHsDoc) -- ROMES:TODO Discuss in #21592 whether this is parsed AST or base AST
import GHC.Hs.Doc (WithHsDocIdentifiers)
import GHC.Types.SourceText (StringLiteral)
@@ -1608,6 +1609,13 @@ data RoleAnnotDecl pass
[XRec pass (Maybe Role)] -- optional annotations
| XRoleAnnotDecl !(XXRoleAnnotDecl pass)
+{-
+************************************************************************
+* *
+\subsection[WarnAnnot]{Warning annotations}
+* *
+************************************************************************
+-}
-- | Warning Text
--
@@ -1626,54 +1634,35 @@ data WarningTxt pass
deriving Generic
-}
-type family XWarningTxt p
-type family XDeprecatedTxt p
-
data WarningTxt pass
- = WarningTxt
+ = DeprecatedTxt
+ (XDeprecatedTxt pass)
+ [XRec pass (WithHsDocIdentifiers StringLiteral pass)]
+ | WarningTxt
(Maybe (XRec pass (InWarningCategory pass)))
-- ^ Warning category attached to this WARNING pragma, if any;
-- see Note [Warning categories]
(XWarningTxt pass)
[XRec pass (WithHsDocIdentifiers StringLiteral pass)]
- | DeprecatedTxt
- (XDeprecatedTxt pass)
- [XRec pass (WithHsDocIdentifiers StringLiteral pass)]
+ | XWarningTxt !(XXWarningTxt pass)
deriving Generic
-deriving stock instance (
- Eq (XWarningTxt pass),
- Eq (XDeprecatedTxt pass),
- Eq (XRec pass (InWarningCategory pass)),
- Eq (XRec pass (WithHsDocIdentifiers StringLiteral pass))
- ) => Eq (WarningTxt pass)
deriving stock instance (
Data pass,
- Data (XWarningTxt pass),
Data (XDeprecatedTxt pass),
+ Data (XWarningTxt pass),
+ Data (XXWarningTxt pass),
Data (XRec pass (InWarningCategory pass)),
Data (XRec pass (WithHsDocIdentifiers StringLiteral pass))
) => Data (WarningTxt pass)
-{-
--- | The message that the WarningTxt was specified to output
-warningTxtMessage :: WarningTxt p -> [LocatedE (WithHsDocIdentifiers StringLiteral p)]
-warningTxtMessage (WarningTxt _ _ m) = m
-warningTxtMessage (DeprecatedTxt _ m) = m
-
--- | True if the 2 WarningTxts have the same category and messages
-warningTxtSame :: WarningTxt p1 -> WarningTxt p2 -> Bool
-warningTxtSame w1 w2
- = warningTxtCategory w1 == warningTxtCategory w2
- && literal_message w1 == literal_message w2
- && same_type
- where
- literal_message :: WarningTxt p -> [StringLiteral]
- literal_message = map (hsDocString . unLoc) . warningTxtMessage
- same_type | DeprecatedTxt {} <- w1, DeprecatedTxt {} <- w2 = True
- | WarningTxt {} <- w1, WarningTxt {} <- w2 = True
- | otherwise = False
--}
+deriving stock instance (
+ Eq (XDeprecatedTxt pass),
+ Eq (XWarningTxt pass),
+ Eq (XXWarningTxt pass),
+ Eq (XRec pass (InWarningCategory pass)),
+ Eq (XRec pass (WithHsDocIdentifiers StringLiteral pass))
+ ) => Eq (WarningTxt pass)
{-
Note [Warning categories]
@@ -1728,40 +1717,29 @@ data InWarningCategory
iwc_wc :: (LocatedE WarningCategory)
} deriving Data
-}
-type family XInWarningCategory p
-type family XInWarningCategoryIn p
data InWarningCategory pass
= InWarningCategory
- { iwc_in :: !(XInWarningCategoryIn pass),
--- iwc_in :: !(EpToken "in"),
- iwc_st :: (XInWarningCategory pass),
- iwc_wc :: (XRec pass (WarningCategory pass))
+ { iwc_st :: (XInWarningCategory pass),
+ iwc_wc :: (XRec pass WarningCategory)
}
+ | XInWarningCategory pass
deriving stock instance (
Data pass,
Data (XInWarningCategory pass),
- Data (XInWarningCategoryIn pass),
- Data (XRec pass (WarningCategory pass))
+ Data (XRec pass WarningCategory)
) => Data (InWarningCategory pass)
-deriving instance (
+deriving stock instance (
+-- Eq p, -- Add this and then all the type family values complain about Eq instances.
Eq (XInWarningCategory p),
- Eq (XInWarningCategoryIn p),
- Eq (XRec p (WarningCategory p))
+ Eq (XRec p WarningCategory)
) => Eq (InWarningCategory p)
-type family XWarningCategory p
-
--- See Note [Warning categories]
-newtype WarningCategory pass = WarningCategory (XWarningCategory pass)
- -- Must add back Binary, Outputable, Uniquable
-
-deriving stock instance (Data pass, Data (XWarningCategory pass)) => Data (WarningCategory pass)
-deriving newtype instance Eq (XWarningCategory pass) => Eq (WarningCategory pass)
-deriving newtype instance Show (XWarningCategory pass) => Show (WarningCategory pass)
-deriving newtype instance NFData (XWarningCategory pass) => NFData (WarningCategory pass)
+newtype WarningCategory = WarningCategory FastString
+ deriving stock (Data)
+ deriving newtype (Eq, Show, NFData)
-mkWarningCategory :: XWarningCategory pass -> WarningCategory pass
+mkWarningCategory :: FastString -> WarningCategory
mkWarningCategory = WarningCategory
=====================================
compiler/Language/Haskell/Syntax/Extension.hs
=====================================
@@ -421,6 +421,21 @@ type family XXWarnDecls x
type family XWarning x
type family XXWarnDecl x
+-- -------------------------------------
+-- WarningTxt type families
+type family XDeprecatedTxt x
+type family XWarningTxt x
+type family XXWarningTxt x
+
+-- -------------------------------------
+-- InWarningCategory type families
+type family XInWarningCategory x
+type family XXInWarningCategory x
+
+-- -------------------------------------
+-- WarningCategory type family
+type family XWarningCategory x
+
-- -------------------------------------
-- AnnDecl type families
type family XHsAnnotation x
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e8d1355174a1bac067b333365a338e9…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e8d1355174a1bac067b333365a338e9…
You're receiving this email because of your account on gitlab.haskell.org.
1
0