[Git][ghc/ghc][wip/T28123] 14 commits: hadrian: Add Stage3 cross-compiled target bindist (#26924)
Simon Peyton Jones pushed to branch wip/T28123 at Glasgow Haskell Compiler / GHC Commits: 9ad25cb2 by Sven Tennie at 2026-11-14T06:20:13-05:00 hadrian: Add Stage3 cross-compiled target bindist (#26924) Add a `binary-dist-stage3` Hadrian target that packages target executables (produced by the stage2 compiler) into a separate '_build/bindist-stage3/' folder, distinct from the stage2 regular or cross-compiler bindist in '_build/bindist/'. This allows a single CI pipeline job to produce both a cross-compiler bindist (e.g. x86_64 -> RISC-V) and a target-architecture bindist (e.g. RISC-V -> RISC-V) that can be installed and run natively on the target. To avoid issues with stale files or race-conditions on them, generate the `configure` script per stage in `_build/<stage>/distrib` directories. - - - - - ca91017d by Sven Tennie at 2026-11-14T06:20:13-05:00 ci: Build Stage3 and Stage2 bindists for cross targets in one job (#26924) Building the stage3 target bindist already produces most of the stage2 cross-compiler bindist as a byproduct, so building them in separate jobs duplicates the build efforts for no benefit. Instead of a separate CROSS_STAGE=3 job, the stage3 job now also builds and publishes the stage2 bindist. The stage3 tarball is named and versioned as if it were built natively on the target (target triple prefix, non-cross opsys), so its artifact name stays what downstream consumers already expect and no changes are needed on their side. For now, this is only enabled for the RISC-V job. Others can easily follow. - - - - - 71b41e09 by Sven Tennie at 2026-11-14T06:20:14-05:00 ci: model cross targets as structured TargetPlatform triples (#26924) Storing the cross target as a raw triple forced ad-hoc parsing at every use, and broke the single responsibility rule. Modelling it as a structured `TargetPlatform`` instead, avoids parsing and provides a clear separation of concerns. - - - - - 8067c2f9 by Sven Tennie at 2026-11-14T06:20:14-05:00 ci: extract the cross smoke tests into a separate smoke_test command (#26924) This reduces if-nesting and complexity of the main `test_hadrian` command. The decision how to test is now made by the caller. This is a fair choice, because most test cases can run under emulation - they are just very slow then. The Stage3 smoke test also checks that the target compiler does not report itself as cross-compiling and, when supported, runs a small GHCi expression. - - - - - 7ece99a7 by fendor at 2026-11-14T06:20:57-05:00 Add `-dep-json` flag to `ghc -M` Add an optional flag to `ghc -M` that allows to write the dependency information in JSON Lines format. The JSON Lines format enables us to stream the output of the dependency generation to a consumer. The output of `-dep-json` is streamed to a temporary file and then copied to the final destination to avoid partial writes. Each line contains one of two possible json objects: 1. A Home Unit Dependency * Contains the name of the home module, its unit, where it is located, whether a preprocessor is used, and all of its imports. Importantly, the imports include `-XExplicitLevelImports` information. * If requested via `-include-pkg-deps`, includes imports of external units, e.g. modules from `base`. * If requested via `-include-cpp-deps`, files included via CPP. 2. External Unit Dependency * Only if `-include-pkg-deps` is given * Contains unit-id, its package name and package id. --- This PR refactors the Makefile generation to use phases appropriately. We introduce an intermediate data structure that is generated based on the module graph nodes, and only then generate the Makefile rules. This allows the dep-json and dep-makefile generation to use the same dependency processing. - - - - - 0f6e0146 by fendor at 2026-11-14T06:20:57-05:00 Add multiple home unit support to `ghc -M` Allows to process the module graph of multiple home units at once using the same syntax as `--make` and `--interactive`: ghc -M -unit @unitA -unit @unitB The semantics are identical to `--make` and `--interactive`. Each home unit can declare individually to use `-include-cpp-deps` and `-include-pkg-deps`. However, there can only be one output file, and `-dep-json` and `-dep-makefile` can only be provided at the top of the cli invocation. We introduce a new GHC API `doMkDepend` that allows to use multiple home units conveniently. The output of `-dep-json` and `-dep-makefile` does not change, since we were careful to choose a format that supports multiple home units from the start. Single home units are still accepted like before with no changes. - - - - - 5598e6a0 by fendor at 2026-11-14T06:20:57-05:00 Deprecate `doMkDependHS` in favour of `doMkDepend` - - - - - 39f2943e by David Eichmann at 2026-11-14T06:21:41-05:00 rts: Expose getRtsSymbols() and store redirect labels and external symbols tag - - - - - aa159605 by David Eichmann at 2026-11-14T06:21:41-05:00 hadrian: when running tests, properly set have_gdb and have_readelf - - - - - ff826da4 by David Eichmann at 2026-11-14T06:21:41-05:00 testsuite: add have_ldd() test modifier - - - - - b9f0b7e2 by David Eichmann at 2026-11-14T06:21:41-05:00 testsuite driver: on windows, ensure PATH correctly contains mingw and ghc-pkg libraries - - - - - 543c108e by David Eichmann at 2026-11-14T06:21:41-05:00 testsuite: driver now sets WAY_FLAGS variable for makefile tests - - - - - 13408a2b by David Eichmann at 2026-11-14T06:21:41-05:00 Add golden test for rts/RtsSymbols.c This test compares declared symbols against symbols observed in the rts DSO (.so file). - - - - - 3a526204 by Simon Peyton Jones at 2026-11-15T22:21:03+00:00 Swap visibilities in mkSymCo As #28123 showed, `mkSymCo` was failing to swap visibility flags in `ForAllCo`. Fixing that in turn showed that the change to `mkEtaForAllMCo` that allegedly fixed #27557 was utterly wrong, and should simply be un-done. I have added some comments to document the invariants. - - - - - 97 changed files: - .gitignore - .gitlab/ci.sh - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - + changelog.d/T28123 - + changelog.d/make-depends-deprecate-doMkDependHS - + changelog.d/make-depends-json - + changelog.d/make-depends-multiple-home-units - + changelog.d/stage3-cross-bindists - compiler/GHC/Core/Opt/Arity.hs - compiler/GHC/Core/TyCo/Make.hs - compiler/GHC/Driver/DynFlags.hs - compiler/GHC/Driver/MakeFile.hs - compiler/GHC/Driver/Session.hs - compiler/GHC/Driver/Session/Units.hs - compiler/GHC/Utils/Json.hs - + docs/users_guide/make-depends-json-schema-1_0.json - docs/users_guide/separate_compilation.rst - ghc/Main.hs - hadrian/src/BindistConfig.hs - hadrian/src/Oracles/Setting.hs - hadrian/src/Rules/BinaryDist.hs - hadrian/src/Rules/Generate.hs - hadrian/src/Settings/Builders/RunTest.hs - hadrian/src/Settings/Packages.hs - rts/Linker.c - rts/LinkerInternals.h - rts/RtsSymbols.c - rts/RtsSymbols.h - rts/include/Rts.h - + rts/include/rts/RtsSymbols.h - rts/linker/PEi386.c - rts/rts.cabal - testsuite/driver/runtests.py - testsuite/driver/testglobals.py - testsuite/driver/testlib.py - testsuite/mk/test.mk - + testsuite/tests/driver/mkdepend/Makefile - + testsuite/tests/driver/mkdepend/README.md - + testsuite/tests/driver/mkdepend/T24384/A.hs - + testsuite/tests/driver/mkdepend/T24384/C.hs - + testsuite/tests/driver/mkdepend/T24384/C.hs-boot - + testsuite/tests/driver/mkdepend/T24384/D.hs - + testsuite/tests/driver/mkdepend/T24384/E.hs - + testsuite/tests/driver/mkdepend/T24384/dep-internal/DepInternal.hs - + testsuite/tests/driver/mkdepend/T24384/dep-internal/dep-internal.pkg - + testsuite/tests/driver/mkdepend/T24384/dep-public/DepPublic.hs - + testsuite/tests/driver/mkdepend/T24384/dep-public/dep-public.pkg - + testsuite/tests/driver/mkdepend/T24384/dep/Dep.hs - + testsuite/tests/driver/mkdepend/T24384/dep/dep.pkg - + testsuite/tests/driver/mkdepend/T24384/foo.h - + testsuite/tests/driver/mkdepend/T24384/lib/B.hs - + testsuite/tests/driver/mkdepend/T24384/lib/B.hs-boot - + testsuite/tests/driver/mkdepend/T24384/preproc.sh - + testsuite/tests/driver/mkdepend/T24384a.stdout - + testsuite/tests/driver/mkdepend/T24384b.stdout - + testsuite/tests/driver/mkdepend/T24384c.stdout - + testsuite/tests/driver/mkdepend/all.T - + testsuite/tests/driver/mkdepend/format_json.sh - + testsuite/tests/driver/mkdepend/format_makefile.sh - + testsuite/tests/driver/mkdepend/mhu01/a/A/Base.hs - + testsuite/tests/driver/mkdepend/mhu01/a/A/Base.hs-boot - + testsuite/tests/driver/mkdepend/mhu01/a/A/TH.hs - + testsuite/tests/driver/mkdepend/mhu01/a/Util.hs - + testsuite/tests/driver/mkdepend/mhu01/b/B/Normal.hs - + testsuite/tests/driver/mkdepend/mhu01/b/B/Splice.hs - + testsuite/tests/driver/mkdepend/mhu01/b/Util.hs - + testsuite/tests/driver/mkdepend/mhu01/c/C.hs - + testsuite/tests/driver/mkdepend/mhu01/unitA - + testsuite/tests/driver/mkdepend/mhu01/unitB - + testsuite/tests/driver/mkdepend/mhu01/unitC - + testsuite/tests/driver/mkdepend/mhu02/A.hs - + testsuite/tests/driver/mkdepend/mhu02/B.hs - + testsuite/tests/driver/mkdepend/mhu02/pp.sh - + testsuite/tests/driver/mkdepend/mhu02/unitA - + testsuite/tests/driver/mkdepend/mhu02/unitB - + testsuite/tests/driver/mkdepend/mhu03/pkg/A.hs - + testsuite/tests/driver/mkdepend/mhu03/pkg/pp.sh - + testsuite/tests/driver/mkdepend/mhu03/unitA - + testsuite/tests/driver/mkdepend/mkdepend01.dep-json - + testsuite/tests/driver/mkdepend/mkdepend01.dep-makefile - + testsuite/tests/driver/mkdepend/mkdepend01/A.hs - + testsuite/tests/driver/mkdepend/mkdepend_mhu01.dep-json - + testsuite/tests/driver/mkdepend/mkdepend_mhu01.dep-makefile - + testsuite/tests/driver/mkdepend/mkdepend_mhu02.dep-json - + testsuite/tests/driver/mkdepend/mkdepend_mhu03.dep-json - testsuite/tests/ghci/linking/T25155_iserv_main.c - testsuite/tests/perf/compiler/large-project/all.T - + testsuite/tests/perf/compiler/large-project/large-project-mhu.sh - + testsuite/tests/rts/symbols/Main.hs - + testsuite/tests/rts/symbols/Makefile - + testsuite/tests/rts/symbols/all.T - + testsuite/tests/rts/symbols/dumpDeclaredSymbols.c - + testsuite/tests/rts/symbols/rts-check-symbols.sh - + testsuite/tests/rts/symbols/rts-check-symbols.stdout - + testsuite/tests/vdq-rta/should_compile/T28123.hs - testsuite/tests/vdq-rta/should_compile/all.T The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3b804114de735b0616ba4f64bd721e8... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3b804114de735b0616ba4f64bd721e8... You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
participants (1)
-
Simon Peyton Jones (@simonpj)