[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 14 commits: hadrian: Flavour: Change args -> extraArgs

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Fri May 5 12:10:33 UTC 2023



Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC


Commits:
8cc9a534 by Matthew Pickering at 2023-05-04T14:58:14-04:00
hadrian: Flavour: Change args -> extraArgs

Previously in a flavour definition you could override all the flags
which were passed to GHC. This causes issues when needed to compute a
package hash because we need to know what these extra arguments are
going to be before computing the hash. The solution is to modify flavour
so that the arguments you pass here are just extra ones rather than all
the arguments that you need to compile something.

This makes things work more like how cabal.project files work when you
give extra arguments to a package and also means that flavour
transformers correctly affect the hash.

- - - - -
3fdb18f8 by romes at 2023-05-04T14:58:14-04: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.

- - - - -
6689c9c6 by romes at 2023-05-04T14:58:14-04:00
Validate compatibility of ghcs when loading plugins

Ensure, when loading plugins, that the ghc the plugin depends on is the
ghc loading the plugin -- otherwise fail to load the plugin.

Progress towards #20742.

- - - - -
db4be339 by romes at 2023-05-04T14:58:14-04:00
Add hashes to unit-ids created by hadrian

This commit adds support for computing an inputs hash for packages
compiled by hadrian. The result is that ABI incompatible packages should
be given different hashes and therefore be distinct in a cabal store.

Hashing is enabled by the `--flag`, and is off by default as the hash
contains a hash of the source files. We enable it when we produce
release builds so that the artifacts we distribute have the right unit
ids.

- - - - -
944a9b94 by Matthew Pickering at 2023-05-04T14:58:14-04:00
Use hash-unit-ids in release jobs

Includes fix upload_ghc_libs glob

- - - - -
116d7312 by Josh Meredith at 2023-05-04T14:58:51-04:00
JS: fix bounds checking (Issue 23123)

* For ByteArray-based bounds-checking, the JavaScript backend must use the
`len` field, instead of the inbuild JavaScript `length` field.

* Range-based operations must also check both the start and end of the range
for bounds

* All indicies are valid for ranges of size zero, since they are essentially no-ops

* For cases of ByteArray accesses (e.g. read as Int), the end index is
(i * sizeof(type) + sizeof(type) - 1), while the previous implementation
uses (i + sizeof(type) - 1). In the Int32 example, this is (i * 4 + 3)

* IndexByteArrayOp_Word8As* primitives use byte array indicies (unlike
the previous point), but now check both start and end indicies

* Byte array copies now check if the arrays are the same by identity and
then if the ranges overlap.

- - - - -
2d5c1dde by Sylvain Henry at 2023-05-04T14:58:51-04:00
Fix remaining issues with bound checking (#23123)

While fixing these I've also changed the way we store addresses into
ByteArray#. Addr# are composed of two parts: a JavaScript array and an
offset (32-bit number).

Suppose we want to store an Addr# in a ByteArray# foo at offset i.
Before this patch, we were storing both fields as a tuple in the "arr"
array field:

  foo.arr[i] = [addr_arr, addr_offset];

Now we only store the array part in the "arr" field and the offset
directly in the array:

  foo.dv.setInt32(i, addr_offset):
  foo.arr[i] = addr_arr;

It avoids wasting space for the tuple.

- - - - -
98c5ee45 by Luite Stegeman at 2023-05-04T14:59:31-04:00
JavaScript: Correct arguments to h$appendToHsStringA

fixes #23278

- - - - -
ca611447 by Josh Meredith at 2023-05-04T15:00:07-04:00
base/encoding: add an allocations performance test (#22946)

- - - - -
e3ddf58d by Krzysztof Gogolewski at 2023-05-04T15:00:44-04:00
linear types: Don't add external names to the usage env

This has no observable effect, but avoids storing useless data.

- - - - -
b3226616 by Andrei Borzenkov at 2023-05-04T15:01:25-04:00
Improved documentation for the Data.OldList.nub function

There was recomentation to use map head . group . sort instead of nub
function, but containers library has more suitable and efficient
analogue

- - - - -
e8b72ff6 by Ryan Scott at 2023-05-04T15:02:02-04:00
Fix type variable substitution in gen_Newtype_fam_insts

Previously, `gen_Newtype_fam_insts` was substituting the type variable binders
of a type family instance using `substTyVars`, which failed to take type
variable dependencies into account. There is similar code in
`GHC.Tc.TyCl.Class.tcATDefault` that _does_ perform this substitution properly,
so this patch:

1. Factors out this code into a top-level `substATBndrs` function, and
2. Uses `substATBndrs` in `gen_Newtype_fam_insts`.

Fixes #23329.

- - - - -
275836d2 by Torsten Schmits at 2023-05-05T08:43:02+00:00
Add structured error messages for GHC.Rename.Utils

Tracking ticket: #20115

MR: !10350

This converts uses of `mkTcRnUnknownMessage` to newly added constructors
of `TcRnMessage`.

- - - - -
53c2d50d by Oleg Grenrus at 2023-05-05T08:10:28-04:00
Use TemplateHaskellQuotes in TH.Syntax to construct Names

- - - - -


28 changed files:

- .gitlab/gen_ci.hs
- .gitlab/jobs.yaml
- .gitlab/rel_eng/upload_ghc_libs.py
- compiler/GHC/Core/Lint.hs
- compiler/GHC/Core/UsageEnv.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Rename/Bind.hs
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Rename/HsType.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Rename/Utils.hs
- compiler/GHC/Runtime/Loader.hs
- compiler/GHC/StgToJS/Apply.hs
- compiler/GHC/StgToJS/Linker/Utils.hs
- compiler/GHC/StgToJS/Prim.hs
- compiler/GHC/Tc/Deriv/Generate.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/Head.hs
- compiler/GHC/Tc/Module.hs
- compiler/GHC/Tc/TyCl/Class.hs
- compiler/GHC/Types/Error/Codes.hs
- compiler/GHC/Types/Hint.hs
- compiler/GHC/Types/Hint/Ppr.hs
- compiler/GHC/Unit/Types.hs
- compiler/Setup.hs
- compiler/ghc.cabal.in
- hadrian/bindist/Makefile


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/69c7254e382f9ac2b5eaa01cd83a31543fa3cb8a...53c2d50d425d31e6aa1bc927df57e5f82e7d9d51

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/69c7254e382f9ac2b5eaa01cd83a31543fa3cb8a...53c2d50d425d31e6aa1bc927df57e5f82e7d9d51
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/20230505/eb139e14/attachment-0001.html>


More information about the ghc-commits mailing list