[Git][ghc/ghc][wip/romes/hardwire-ghc-unit-id] 11 commits: ghc-heap: remove wrong Addr# coercion (#23181)

Rodrigo Mesquita (@alt-romes) gitlab at gitlab.haskell.org
Mon Apr 3 17:18:14 UTC 2023



Rodrigo Mesquita pushed to branch wip/romes/hardwire-ghc-unit-id at Glasgow Haskell Compiler / GHC


Commits:
ab9cd52d by Sylvain Henry at 2023-04-03T08:15:21-04:00
ghc-heap: remove wrong Addr# coercion (#23181)

Conversion from Addr# to I# isn't correct with the JS backend.

- - - - -
2b2afff3 by Matthew Pickering at 2023-04-03T08:15:58-04:00
hadrian: Update bootstrap plans for 9.2.6, 9.2.7, 9.4.4, 9.4.5, 9.6.1

Also fixes the ./generate_bootstrap_plans script which was recently
broken

We can hopefully drop the 9.2 plans soon but they still work so kept
them around for now.

- - - - -
c2605e25 by Matthew Pickering at 2023-04-03T08:15:58-04:00
ci: Add job to test 9.6 bootstrapping

- - - - -
53e4d513 by Krzysztof Gogolewski at 2023-04-03T08:16:35-04:00
hadrian: Improve option parsing

Several options in Hadrian had their argument marked as optional
(`OptArg`), but if the argument wasn't there they were just giving an
error. It's more idiomatic to mark the argument as required instead;
the code uses less Maybes, the parser can enforce that the argument
is present, --help gives better output.

- - - - -
a8e36892 by Sylvain Henry at 2023-04-03T08:17:16-04:00
JS: fix issues with FD api support

- Add missing implementations for fcntl_read/write/lock
- Fix fdGetMode

These were found while implementing TH in !9779. These functions must be
used somehow by the external interpreter code.

- - - - -
ae655c5c by romes at 2023-04-03T18:09:48+01:00
Hardwire a better unit-id for ghc

Previously, the unit-id of ghc-the-library was fixed as `ghc`.
This was done primarily because the compiler must know the unit-id of
some packages (including ghc) a-priori to define wired-in names.

However, as seen in #20742, a reinstallable `ghc` whose unit-id is fixed
to `ghc` might result in subtle bugs when different ghc's interact.

A good example of this is having GHC_A load a plugin compiled by GHC_B,
where GHC_A and GHC_B are linked to ghc-libraries that are ABI
incompatible. Without a distinction between the unit-id of the ghc library
GHC_A is linked against and the ghc library the plugin it is loading was
compiled against, we can't check compatibility.

This patch gives a slightly better unit-id to ghc (ghc-version) by
(1) Not setting -this-unit-id to ghc, but rather to the new unit-id (modulo stage0)
(2) Adding a definition to `GHC.Settings.Config` whose value is the new unit-id.
    (2.1) `GHC.Settings.Config` is generated by Hadrian
    (2.2) and also by cabal through `compiler/Setup.hs`
This unit-id definition is imported by `GHC.Unit.Types` and used to
set the wired-in unit-id of "ghc", which was previously fixed to "ghc"

The commits following this one will improve the unit-id with a
cabal-style package hash and check compatibility when loading plugins.

Note that we also ensure that ghc's unit key matches unit id both when
hadrian or cabal builds ghc, and in this way we no longer need to add
`ghc` to the WiringMap.

- - - - -
7313e490 by romes at 2023-04-03T18:09:48+01:00
Validate compatibility of ghcs when loading plugins

- - - - -
6ea7335c by romes at 2023-04-03T18:09:48+01:00
Add hashes to unit-ids created by hadrian

(Fix sed command in install makefile)

Co-author: @mpickering

- - - - -
1db3b607 by Matthew Pickering at 2023-04-03T18:09:48+01:00
fixes

- - - - -
d62cbaf7 by Matthew Pickering at 2023-04-03T18:10:52+01:00
add flag

- - - - -
4ab30288 by Matthew Pickering at 2023-04-03T18:10:54+01:00
Use hash-unit-ids in release jobs

- - - - -


13 changed files:

- .gitlab-ci.yml
- .gitlab/gen_ci.hs
- .gitlab/jobs.yaml
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Runtime/Loader.hs
- compiler/GHC/Unit/Types.hs
- compiler/Setup.hs
- compiler/ghc.cabal.in
- hadrian/bindist/Makefile
- hadrian/bootstrap/generate_bootstrap_plans
- hadrian/bootstrap/plan-9_2_1.json
- hadrian/bootstrap/plan-9_2_2.json
- hadrian/bootstrap/plan-9_2_3.json


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/cd7de7c22aad12d1b945142f800ae4bc95302098...4ab30288e9fc996c8ef4add845e77aaa14fbe4ed

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/cd7de7c22aad12d1b945142f800ae4bc95302098...4ab30288e9fc996c8ef4add845e77aaa14fbe4ed
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230403/9848ba4d/attachment-0001.html>


More information about the ghc-commits mailing list