Commits on Source (8)
-
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.
4c37a04a -
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.
69527c0f -
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.
c622035f -
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.
3683bb11 -
Includes fix upload_ghc_libs glob
0861cbff -
* 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.
2ee60455 -
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.
d928e35b -
This has no observable effect, but avoids storing useless data.
a03a6ced
Showing
- .gitlab/gen_ci.hs 4 additions, 1 deletion.gitlab/gen_ci.hs
- .gitlab/jobs.yaml 20 additions, 9 deletions.gitlab/jobs.yaml
- .gitlab/rel_eng/upload_ghc_libs.py 5 additions, 1 deletion.gitlab/rel_eng/upload_ghc_libs.py
- compiler/GHC/Core/Lint.hs 1 addition, 1 deletioncompiler/GHC/Core/Lint.hs
- compiler/GHC/Core/UsageEnv.hs 9 additions, 3 deletionscompiler/GHC/Core/UsageEnv.hs
- compiler/GHC/Driver/Session.hs 1 addition, 0 deletionscompiler/GHC/Driver/Session.hs
- compiler/GHC/Runtime/Loader.hs 13 additions, 6 deletionscompiler/GHC/Runtime/Loader.hs
- compiler/GHC/StgToJS/Linker/Utils.hs 4 additions, 0 deletionscompiler/GHC/StgToJS/Linker/Utils.hs
- compiler/GHC/StgToJS/Prim.hs 567 additions, 489 deletionscompiler/GHC/StgToJS/Prim.hs
- compiler/GHC/Tc/Gen/Head.hs 2 additions, 2 deletionscompiler/GHC/Tc/Gen/Head.hs
- compiler/GHC/Unit/Types.hs 44 additions, 2 deletionscompiler/GHC/Unit/Types.hs
- compiler/Setup.hs 17 additions, 4 deletionscompiler/Setup.hs
- compiler/ghc.cabal.in 11 additions, 4 deletionscompiler/ghc.cabal.in
- hadrian/bindist/Makefile 1 addition, 1 deletionhadrian/bindist/Makefile
- hadrian/bootstrap/plan-9_2_1.json 1 addition, 1 deletionhadrian/bootstrap/plan-9_2_1.json
- hadrian/bootstrap/plan-9_2_2.json 1 addition, 1 deletionhadrian/bootstrap/plan-9_2_2.json
- hadrian/bootstrap/plan-9_2_3.json 1 addition, 1 deletionhadrian/bootstrap/plan-9_2_3.json
- hadrian/bootstrap/plan-9_2_4.json 1 addition, 1 deletionhadrian/bootstrap/plan-9_2_4.json
- hadrian/bootstrap/plan-9_2_5.json 1 addition, 1 deletionhadrian/bootstrap/plan-9_2_5.json
- hadrian/bootstrap/plan-9_2_6.json 1 addition, 1 deletionhadrian/bootstrap/plan-9_2_6.json